make build work & fix some crashes

This commit is contained in:
Badbird-5907
2022-06-17 21:09:08 -04:00
parent 6610ac05db
commit 5bfd9f9a8e
8 changed files with 32 additions and 22 deletions

View File

@@ -15,7 +15,7 @@ public interface Terminator {
String getBotName();
int getId();
int getEntityId();
GameProfile getGameProfile();
@@ -29,7 +29,7 @@ public interface Terminator {
Location getLocation();
boolean isAlive();
boolean isBotAlive(); //Has to be named like this because paper re-obfuscates it
float getHealth();
@@ -37,11 +37,11 @@ public interface Terminator {
void ignite();
boolean isOnFire();
boolean isBotOnFire();
boolean isFalling();
boolean isBlocking();
boolean isBotBlocking();
void block(int length, int cooldown);

View File

@@ -36,7 +36,7 @@ public class BotAgent extends Agent {
// This is where the code starts to get spicy
private void tickBot(Terminator bot) {
if (!bot.isAlive()) return;
if (!bot.isBotAlive()) return;
Location loc = bot.getLocation();

View File

@@ -64,7 +64,7 @@ public class LegacyAgent extends Agent {
}
private void center(Terminator bot) {
if (bot == null || !bot.isAlive()) {
if (bot == null || !bot.isBotAlive()) {
return;
}
@@ -89,7 +89,7 @@ public class LegacyAgent extends Agent {
}
private void tickBot(Terminator bot) {
if (!bot.isAlive()) {
if (!bot.isBotAlive()) {
return;
}
@@ -227,7 +227,7 @@ public class LegacyAgent extends Agent {
NeuralNetwork network = bot.getNeuralNetwork();
if (network.dynamicLR()) {
if (bot.isBlocking()) {
if (bot.isBotBlocking()) {
vel.multiply(0.6);
}
@@ -253,7 +253,7 @@ public class LegacyAgent extends Agent {
boolean left = network.check(BotNode.LEFT);
boolean right = network.check(BotNode.RIGHT);
if (bot.isBlocking()) {
if (bot.isBotBlocking()) {
vel.multiply(0.6);
}
@@ -313,7 +313,7 @@ public class LegacyAgent extends Agent {
double dot = loc.toVector().subtract(player.getLocation().toVector()).normalize().dot(loc.getDirection());
if (bot.isBlocking() && dot >= -0.1) {
if (bot.isBotBlocking() && dot >= -0.1) {
player.getWorld().playSound(bot.getLocation(), Sound.ITEM_SHIELD_BLOCK, 1, 1);
event.setCancelled(true);
}
@@ -903,7 +903,7 @@ public class LegacyAgent extends Agent {
String worldName = world.getName();
Location loc = bot.getLocation();
if (bot.isOnFire()) {
if (bot.isBotOnFire()) {
if (bot.getBukkitEntity().getWorld().getEnvironment() != World.Environment.NETHER) {
placeWaterDown(bot, world, loc);
}
@@ -1035,7 +1035,7 @@ public class LegacyAgent extends Agent {
scheduler.runTaskLater(plugin, () -> {
boatCooldown.remove(bot);
if (bot.isAlive()) {
if (bot.isBotAlive()) {
bot.faceLocation(target.getLocation());
}
}, 5);

View File

@@ -244,7 +244,7 @@ public class IntelligenceAgent {
}
private int aliveCount() {
return (int) bots.values().stream().filter(Terminator::isAlive).count();
return (int) bots.values().stream().filter(Terminator::isBotAlive).count();
}
private void close() {