emergency commit
Some checks failed
Compile / gradle (ubuntu-latest) (push) Has been cancelled

This commit is contained in:
Justus Wolff
2026-03-04 22:04:47 +01:00
parent e0ebe898b4
commit eab7fc2380
15 changed files with 82 additions and 22 deletions

Binary file not shown.

View File

@@ -103,6 +103,15 @@ public class LegacyAgent extends Agent {
btList.put(botEntity, loc); btList.put(botEntity, loc);
} }
private boolean entholdsmace(LivingEntity target) {
if (target instanceof Player player) {
if (player.getInventory().getItemInMainHand().getType() == Material.MACE) return true;
return false;
} else {
return false;
}
}
private void tickBot(Terminator bot) { private void tickBot(Terminator bot) {
if (!bot.isBotAlive()) { if (!bot.isBotAlive()) {
return; return;
@@ -120,6 +129,8 @@ public class LegacyAgent extends Agent {
if (livingTarget == null) { if (livingTarget == null) {
stopMining(bot); stopMining(bot);
return; return;
} else if (bot.getVelocity().getY() < 0 || bot.isFalling()) {
tryWindchargeMaceAttack(bot, livingTarget, false);
} }
blockCheck.clutch(bot, livingTarget); blockCheck.clutch(bot, livingTarget);
@@ -138,6 +149,9 @@ public class LegacyAgent extends Agent {
network.feed(BotData.generate(bot, livingTarget)); network.feed(BotData.generate(bot, livingTarget));
} }
if (entholdsmace(livingTarget) && livingTarget.getLocation().getY() > bot.getLocation().getY()) {
bot.block(10, 10);
}
if (bot.tickDelay(3) && !miningAnim.containsKey(botPlayer)) { if (bot.tickDelay(3) && !miningAnim.containsKey(botPlayer)) {
Location botEyeLoc = botPlayer.getEyeLocation(); Location botEyeLoc = botPlayer.getEyeLocation();
Location playerEyeLoc = livingTarget.getEyeLocation(); Location playerEyeLoc = livingTarget.getEyeLocation();
@@ -148,6 +162,8 @@ public class LegacyAgent extends Agent {
bot.block(10, 10); bot.block(10, 10);
} }
} }
if (LegacyUtils.checkFreeSpace(botEyeLoc, playerEyeLoc) || LegacyUtils.checkFreeSpace(botEyeLoc, playerLoc)) { if (LegacyUtils.checkFreeSpace(botEyeLoc, playerEyeLoc) || LegacyUtils.checkFreeSpace(botEyeLoc, playerLoc)) {
attack(bot, livingTarget, loc); attack(bot, livingTarget, loc);
@@ -802,6 +818,17 @@ public class LegacyAgent extends Agent {
Material m1 = playerNPC.getLocation().add(0, 1, 0).getBlock().getType(); Material m1 = playerNPC.getLocation().add(0, 1, 0).getBlock().getType();
Material m2 = playerNPC.getLocation().add(0, 2, 0).getBlock().getType(); Material m2 = playerNPC.getLocation().add(0, 2, 0).getBlock().getType();
if (macemode(npc)) {
//npc.jump();
//useWindcharge(npc);
//Bukkit.getScheduler().scheduleAsyncDelayedTask(plugin, () -> {
// while (npc.getVelocity().getY() > 0) {}
// Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, () -> {
// blockCheck.placeBlock(npc, playerNPC, get);
// }, 0);
//}, 0);
//return false;
}
if (LegacyMats.BREAK.contains(m0) && LegacyMats.BREAK.contains(m1) && LegacyMats.BREAK.contains(m2)) { if (LegacyMats.BREAK.contains(m0) && LegacyMats.BREAK.contains(m1) && LegacyMats.BREAK.contains(m2)) {
npc.setItem(new ItemStack(Material.COBBLESTONE)); npc.setItem(new ItemStack(Material.COBBLESTONE));
@@ -1403,7 +1430,52 @@ public class LegacyAgent extends Agent {
return Math.abs(entity.getWorld().getHighestBlockYAt(entity.getLocation()) - entity.getLocation().getY()); return Math.abs(entity.getWorld().getHighestBlockYAt(entity.getLocation()) - entity.getLocation().getY());
}*/ }*/
private boolean macemode(Terminator bot) {
LivingEntity botEntity = bot.getBukkitEntity();
if (botEntity == null) {
return false;
}
ItemStack mainHand;
if (botEntity instanceof Player player) {
mainHand = player.getInventory().getItemInMainHand();
} else {
return false;
}
if (bot.getDefaultItem().getType() != Material.MACE && mainHand.getType() != Material.MACE) {
return false;
}
return true;
}
private boolean useWindcharge(Terminator bot) {
if (!bot.isBotOnGround() && Math.random() >= 0.5) return false;
// Face the ground at own position to launch upward
bot.look(org.bukkit.block.BlockFace.DOWN);
// Jump boost from windcharge with higher velocity
bot.setItem(new ItemStack(Material.WIND_CHARGE, 1));
Vector jumpVel = new Vector(0, 0.6, 0);
Vector cvel = bot.getVelocity().add(jumpVel);
cvel.setX(clamp(cvel.getX(), -0.05, 0.05));
cvel.setZ(clamp(cvel.getZ(), -0.05, 0.05));
bot.setVelocity(cvel);
World world = bot.getLocation().getWorld();
if (world != null) {
world.playSound(bot.getLocation(), Sound.ENTITY_WIND_CHARGE_WIND_BURST, SoundCategory.PLAYERS, 1, 1);
world.spawnParticle(Particle.GUST_EMITTER_SMALL, bot.getLocation(), 1, 0, 0, 0, 0.1);
}
return true;
}
private boolean tryWindchargeMaceAttack(Terminator bot, LivingEntity target) { private boolean tryWindchargeMaceAttack(Terminator bot, LivingEntity target) {
return tryWindchargeMaceAttack(bot, target, true);
}
private boolean tryWindchargeMaceAttack(Terminator bot, LivingEntity target, boolean attemptwindcharge) {
LivingEntity botEntity = bot.getBukkitEntity(); LivingEntity botEntity = bot.getBukkitEntity();
if (botEntity == null) { if (botEntity == null) {
return false; return false;
@@ -1422,35 +1494,20 @@ public class LegacyAgent extends Agent {
return false; return false;
} }
if (!bot.isBotOnGround() && Math.random() >= 0.5) return false; if (attemptwindcharge)
if (!useWindcharge(bot)) return false;
// Face the ground at own position to launch upward
bot.look(org.bukkit.block.BlockFace.DOWN);
// Jump boost from windcharge with higher velocity
bot.setItem(new ItemStack(Material.WIND_CHARGE, 1));
Vector jumpVel = new Vector(0, 0.6, 0);
Vector cvel = bot.getVelocity().add(jumpVel);
cvel.setX(clamp(cvel.getX(), -0.05, 0.05));
cvel.setZ(clamp(cvel.getZ(), -0.05, 0.05));
bot.setVelocity(cvel);
World world = bot.getLocation().getWorld();
if (world != null) {
world.playSound(bot.getLocation(), Sound.ENTITY_WIND_CHARGE_WIND_BURST, SoundCategory.PLAYERS, 1, 1);
world.spawnParticle(Particle.GUST_EMITTER_SMALL, target.getLocation(), 1, 0, 0, 0, 0.1);
}
Bukkit.getScheduler().scheduleAsyncDelayedTask(plugin, () -> { Bukkit.getScheduler().scheduleAsyncDelayedTask(plugin, () -> {
while (!bot.isBotOnGround() && bot.getLocation().distanceSquared(target.getLocation()) > 3) {} while (!bot.isBotOnGround() && bot.getLocation().distanceSquared(target.getLocation()) > 3) {}
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, () -> { Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, () -> {
double falldist = -(bot.getVelocity().getY()*10); // CERTAINLY not the best way but meh double falldist = -(bot.getVelocity().getY()*15); // CERTAINLY not the best way but meh
//Bukkit.getLogger().info("fall dist: "+falldist+" cvy: "+bot.getVelocity().getY()); //Bukkit.getLogger().info("fall dist: "+falldist+" cvy: "+bot.getVelocity().getY());
if (bot.isBotOnGround()) { /*if (bot.isBotOnGround()) {
//Bukkit.getLogger().info("Bot -> ground, no mace"); //Bukkit.getLogger().info("Bot -> ground, no mace");
return; return;
} }*/
double extradmg = 0; double extradmg = 0;
if (falldist >= 1.5) { if (falldist >= 1.5) {
@@ -1463,6 +1520,9 @@ public class LegacyAgent extends Agent {
bot.setItem(bot.getDefaultItem()); bot.setItem(bot.getDefaultItem());
bot.faceLocation(target.getLocation()); bot.faceLocation(target.getLocation());
bot.punch(); bot.punch();
World world = bot.getBukkitEntity().getWorld();
if (bot.getLocation().distanceSquared(target.getLocation()) <= 5) { if (bot.getLocation().distanceSquared(target.getLocation()) <= 5) {
double exdmg = extradmg; double exdmg = extradmg;
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, () -> { Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, () -> {
@@ -1484,7 +1544,7 @@ public class LegacyAgent extends Agent {
//Bukkit.getLogger().info("Bot out of range."); //Bukkit.getLogger().info("Bot out of range.");
} }
}, 0); }, 0);
}, 8); }, attemptwindcharge ? 8 : 0);
return true; return true;
} }

View File

@@ -1,2 +1,2 @@
Command: C:\Program Files\Java\jdk-21.0.10\bin\java.exe -Xmx1G -classpath C:\Users\JUFS-STL-SECONDARY\.gradle\caches\modules-2\files-2.1\net.fabricmc\tiny-remapper\0.12.0\bfb93e1bfb66d47272ccd37ce894dcfc20ba0b6\tiny-remapper-0.12.0-fat.jar net.fabricmc.tinyremapper.Main C:\Users\JUFS-STL-SECONDARY\Desktop\terminatorplus\TerminatorPlus-Plugin\build\libs\TerminatorPlus-Plugin-4.5.1-BETA.jar C:\Users\JUFS-STL-SECONDARY\Desktop\terminatorplus\TerminatorPlus-Plugin\build\libs\TerminatorPlus-Plugin-4.5.1-BETA-reobf.jar C:\Users\JUFS-STL-SECONDARY\Desktop\terminatorplus\TerminatorPlus-Plugin\.gradle\caches\paperweight\taskCache\reobfMappings.tiny mojang spigot C:\Users\JUFS-STL-SECONDARY\Desktop\terminatorplus\TerminatorPlus-Plugin\.gradle\caches\paperweight\taskCache\mappedServerJar.jar --threads=1 Command: C:\Program Files\Java\jdk-21.0.10\bin\java.exe -Xmx1G -classpath C:\Users\JUFS-STL-SECONDARY\.gradle\caches\modules-2\files-2.1\net.fabricmc\tiny-remapper\0.12.0\bfb93e1bfb66d47272ccd37ce894dcfc20ba0b6\tiny-remapper-0.12.0-fat.jar net.fabricmc.tinyremapper.Main C:\Users\JUFS-STL-SECONDARY\Desktop\terminatorplus\TerminatorPlus-Plugin\build\libs\TerminatorPlus-Plugin-4.5.1-BETA.jar C:\Users\JUFS-STL-SECONDARY\Desktop\terminatorplus\TerminatorPlus-Plugin\build\libs\TerminatorPlus-Plugin-4.5.1-BETA-reobf.jar C:\Users\JUFS-STL-SECONDARY\Desktop\terminatorplus\TerminatorPlus-Plugin\.gradle\caches\paperweight\taskCache\reobfMappings.tiny mojang spigot C:\Users\JUFS-STL-SECONDARY\Desktop\terminatorplus\TerminatorPlus-Plugin\.gradle\caches\paperweight\taskCache\mappedServerJar.jar --threads=1
[INFO] Finished after 1622.09 ms. [INFO] Finished after 1790.62 ms.

Binary file not shown.