make build work & fix some crashes
This commit is contained in:
@@ -67,7 +67,7 @@ public class Bot extends ServerPlayer implements Terminator {
|
||||
private boolean removeOnDeath;
|
||||
private int aliveTicks;
|
||||
private int kills;
|
||||
private byte fireTicks;
|
||||
private byte fireTicks; // Fire animation isn't played? Bot still takes damage.
|
||||
private byte groundTicks;
|
||||
private byte jumpTicks;
|
||||
private byte noFallTicks;
|
||||
@@ -129,6 +129,11 @@ public class Bot extends ServerPlayer implements Terminator {
|
||||
return displayName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEntityId() {
|
||||
return getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public NeuralNetwork getNeuralNetwork() {
|
||||
return network;
|
||||
@@ -245,6 +250,11 @@ public class Bot extends ServerPlayer implements Terminator {
|
||||
Bukkit.getOnlinePlayers().forEach(p -> ((CraftPlayer) p).getHandle().connection.send(packet));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBotAlive() {
|
||||
return isAlive();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
loadChunks();
|
||||
@@ -352,7 +362,7 @@ public class Bot extends ServerPlayer implements Terminator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOnFire() {
|
||||
public boolean isBotOnFire() {
|
||||
return fireTicks != 0;
|
||||
}
|
||||
|
||||
@@ -395,8 +405,8 @@ public class Bot extends ServerPlayer implements Terminator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBlocking() {
|
||||
return blocking;
|
||||
public boolean isBotBlocking() {
|
||||
return isBlocking();
|
||||
}
|
||||
|
||||
public void setShield(boolean enabled) {
|
||||
|
||||
@@ -186,7 +186,7 @@ public class BotManagerImpl implements BotManager, Listener {
|
||||
@Override
|
||||
public Terminator getBot(int entityId) {
|
||||
for (Terminator bot : bots) {
|
||||
if (bot.getId() == entityId) {
|
||||
if (bot.getEntityId() == entityId) {
|
||||
return bot;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@ public class Debugger {
|
||||
|
||||
public void tpall() {
|
||||
Player player = (Player) sender;
|
||||
TerminatorPlus.getInstance().getManager().fetch().stream().filter(Terminator::isAlive).forEach(bot -> bot.getBukkitEntity().teleport(player));
|
||||
TerminatorPlus.getInstance().getManager().fetch().stream().filter(Terminator::isBotAlive).forEach(bot -> bot.getBukkitEntity().teleport(player));
|
||||
}
|
||||
|
||||
public void viewsession() {
|
||||
@@ -334,7 +334,7 @@ public class Debugger {
|
||||
}
|
||||
|
||||
public void tp() {
|
||||
Terminator bot = MathUtils.getRandomSetElement(TerminatorPlus.getInstance().getManager().fetch().stream().filter(Terminator::isAlive).collect(Collectors.toSet()));
|
||||
Terminator bot = MathUtils.getRandomSetElement(TerminatorPlus.getInstance().getManager().fetch().stream().filter(Terminator::isBotAlive).collect(Collectors.toSet()));
|
||||
|
||||
if (bot == null) {
|
||||
print("Failed to locate a bot.");
|
||||
|
||||
Reference in New Issue
Block a user