make macing/shield mechanic even more OP and add testserver
Some checks failed
Compile / gradle (ubuntu-latest) (push) Has been cancelled

This commit is contained in:
Justus Wolff
2026-03-05 15:44:16 +01:00
parent eab7fc2380
commit b553e36819
310 changed files with 90910 additions and 31 deletions

View File

@@ -57,6 +57,7 @@ public class LegacyAgent extends Agent {
private double regionWeightX;
private double regionWeightY;
private double regionWeightZ;
private boolean waitformace = false;
public static final Set<EntityType> CUSTOM_MOB_LIST = new HashSet<>();
public static CustomListMode customListMode = CustomListMode.CUSTOM;
@@ -131,6 +132,9 @@ public class LegacyAgent extends Agent {
return;
} else if (bot.getVelocity().getY() < 0 || bot.isFalling()) {
tryWindchargeMaceAttack(bot, livingTarget, false);
} else if (bot.getLocation().getY() > livingTarget.getLocation().getY() && bot.getLocation().distanceSquared(livingTarget.getLocation()) <= 4 && macemode(bot)) {
bot.jump();
macesmash(bot, livingTarget, false, 2.5);
}
blockCheck.clutch(bot, livingTarget);
@@ -150,7 +154,7 @@ public class LegacyAgent extends Agent {
}
if (entholdsmace(livingTarget) && livingTarget.getLocation().getY() > bot.getLocation().getY()) {
bot.block(10, 10);
bot.block(10, 0);
}
if (bot.tickDelay(3) && !miningAnim.containsKey(botPlayer)) {
Location botEyeLoc = botPlayer.getEyeLocation();
@@ -204,7 +208,9 @@ public class LegacyAgent extends Agent {
if (checkDown(bot, botPlayer, livingTarget.getLocation(), bothXZ)) return;
if ((withinTargetXZ || sameXZ) && checkUp(bot, livingTarget, botPlayer, target, withinTargetXZ, sameXZ)) return;
if ((withinTargetXZ || sameXZ) && entholdsmace(livingTarget) && livingTarget.getLocation().getY() > bot.getLocation().getY() && bot.getLocation().distanceSquared(livingTarget.getLocation()) > 5) {
if (checkUp(bot, livingTarget, botPlayer, target, withinTargetXZ, sameXZ)) return;
}
if (bothXZ) sideResult = checkSide(bot, livingTarget, botPlayer);
@@ -1475,7 +1481,41 @@ public class LegacyAgent extends Agent {
return tryWindchargeMaceAttack(bot, target, true);
}
private void macesmash(Terminator bot, LivingEntity target, boolean setwaitmace, double extradmg) {
bot.setItem(bot.getDefaultItem());
bot.faceLocation(target.getLocation());
bot.punch();
World world = bot.getBukkitEntity().getWorld();
if (bot.getLocation().distanceSquared(target.getLocation()) <= 5) {
double exdmg = extradmg;
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, () -> {
bot.attack(target, exdmg); // apply damage only if within range
// effect stuff
if (world != null && exdmg > 0) {
bot.setVelocity(bot.getVelocity().setY(0.1)); // no fall damage
// schedule next mace attempt to make a streak potentially
if (setwaitmace) waitformace = false;
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, () -> {tryWindchargeMaceAttack(bot, target);}, 0);
world.playSound(bot.getLocation(), Sound.ITEM_MACE_SMASH_GROUND, SoundCategory.PLAYERS, 1, 1);
world.spawnParticle(Particle.EXPLOSION, target.getLocation(), 10, 0.5, 0.5, 0.5, 0.1);
} else {
if (setwaitmace) waitformace = false;
//Bukkit.getLogger().info("exdmg !> 0");
}
}, 1);
} else {
if (setwaitmace) waitformace = false;
//Bukkit.getLogger().info("Bot out of range.");
}
}
private boolean tryWindchargeMaceAttack(Terminator bot, LivingEntity target, boolean attemptwindcharge) {
if (waitformace) return false;
LivingEntity botEntity = bot.getBukkitEntity();
if (botEntity == null) {
return false;
@@ -1497,6 +1537,7 @@ public class LegacyAgent extends Agent {
if (attemptwindcharge)
if (!useWindcharge(bot)) return false;
waitformace = true;
Bukkit.getScheduler().scheduleAsyncDelayedTask(plugin, () -> {
while (!bot.isBotOnGround() && bot.getLocation().distanceSquared(target.getLocation()) > 3) {}
@@ -1517,32 +1558,7 @@ public class LegacyAgent extends Agent {
falldist = clamp(falldist-5,0,Double.MAX_VALUE);
extradmg += falldist; // remaining blocks handling
}
bot.setItem(bot.getDefaultItem());
bot.faceLocation(target.getLocation());
bot.punch();
World world = bot.getBukkitEntity().getWorld();
if (bot.getLocation().distanceSquared(target.getLocation()) <= 5) {
double exdmg = extradmg;
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, () -> {
bot.attack(target, exdmg); // apply damage only if within range
// effect stuff
if (world != null && exdmg > 0) {
bot.setVelocity(bot.getVelocity().setY(0.1)); // no fall damage
// schedule next mace attempt to make a streak potentially
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, () -> {tryWindchargeMaceAttack(bot, target);}, 0);
world.playSound(bot.getLocation(), Sound.ITEM_MACE_SMASH_GROUND, SoundCategory.PLAYERS, 1, 1);
world.spawnParticle(Particle.EXPLOSION, target.getLocation(), 10, 0.5, 0.5, 0.5, 0.1);
} else {
//Bukkit.getLogger().info("exdmg !> 0");
}
}, 1);
} else {
//Bukkit.getLogger().info("Bot out of range.");
}
macesmash(bot, target, true, extradmg);
}, 0);
}, attemptwindcharge ? 8 : 0);