Compare commits
5 Commits
53b4f6a04a
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4491025245 | ||
|
|
b553e36819 | ||
|
|
eab7fc2380 | ||
|
|
e0ebe898b4 | ||
|
|
a3d1b3fcf3 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
11
.idea/gradle.xml
generated
Normal file
11
.idea/gradle.xml
generated
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="GradleSettings">
|
||||||
|
<option name="linkedExternalProjectsSettings">
|
||||||
|
<GradleProjectSettings>
|
||||||
|
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
||||||
|
<option name="gradleJvm" value="21" />
|
||||||
|
</GradleProjectSettings>
|
||||||
|
</option>
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
4
.idea/misc.xml
generated
Normal file
4
.idea/misc.xml
generated
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||||
|
</project>
|
||||||
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="VcsDirectoryMappings">
|
||||||
|
<mapping directory="" vcs="Git" />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
81
.idea/workspace.xml
generated
Normal file
81
.idea/workspace.xml
generated
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project version="4">
|
||||||
|
<component name="AutoImportSettings">
|
||||||
|
<option name="autoReloadType" value="SELECTIVE" />
|
||||||
|
</component>
|
||||||
|
<component name="ChangeListManager">
|
||||||
|
<list default="true" id="5102ee95-ea95-49aa-8d82-42bb833a7600" name="Changes" comment="">
|
||||||
|
<change beforePath="$PROJECT_DIR$/.gradle/9.0.0/checksums/checksums.lock" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/9.0.0/checksums/checksums.lock" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/.gradle/9.0.0/checksums/sha1-checksums.bin" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/9.0.0/checksums/sha1-checksums.bin" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/.gradle/9.0.0/executionHistory/executionHistory.bin" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/9.0.0/executionHistory/executionHistory.bin" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/.gradle/9.0.0/executionHistory/executionHistory.lock" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/9.0.0/executionHistory/executionHistory.lock" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/.gradle/9.0.0/fileHashes/fileHashes.bin" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/9.0.0/fileHashes/fileHashes.bin" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/.gradle/9.0.0/fileHashes/fileHashes.lock" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/9.0.0/fileHashes/fileHashes.lock" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/.gradle/9.0.0/fileHashes/resourceHashesCache.bin" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/9.0.0/fileHashes/resourceHashesCache.bin" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/.gradle/buildOutputCleanup/buildOutputCleanup.lock" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/buildOutputCleanup/buildOutputCleanup.lock" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/.gradle/file-system.probe" beforeDir="false" afterPath="$PROJECT_DIR$/.gradle/file-system.probe" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/TerminatorPlus-API/bin/main/net/nuggetmc/tplus/api/Terminator.class" beforeDir="false" afterPath="$PROJECT_DIR$/TerminatorPlus-API/bin/main/net/nuggetmc/tplus/api/Terminator.class" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/TerminatorPlus-API/bin/main/net/nuggetmc/tplus/api/agent/botagent/BotAgent.class" beforeDir="false" afterPath="$PROJECT_DIR$/TerminatorPlus-API/bin/main/net/nuggetmc/tplus/api/agent/botagent/BotAgent.class" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/TerminatorPlus-API/bin/main/net/nuggetmc/tplus/api/agent/legacyagent/LegacyAgent$1.class" beforeDir="false" afterPath="$PROJECT_DIR$/TerminatorPlus-API/bin/main/net/nuggetmc/tplus/api/agent/legacyagent/LegacyAgent$1.class" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/TerminatorPlus-API/bin/main/net/nuggetmc/tplus/api/agent/legacyagent/LegacyAgent$2.class" beforeDir="false" afterPath="$PROJECT_DIR$/TerminatorPlus-API/bin/main/net/nuggetmc/tplus/api/agent/legacyagent/LegacyAgent$2.class" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/TerminatorPlus-API/bin/main/net/nuggetmc/tplus/api/agent/legacyagent/LegacyAgent.class" beforeDir="false" afterPath="$PROJECT_DIR$/TerminatorPlus-API/bin/main/net/nuggetmc/tplus/api/agent/legacyagent/LegacyAgent.class" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/TerminatorPlus-API/bin/main/net/nuggetmc/tplus/api/utils/ItemUtils.class" beforeDir="false" afterPath="$PROJECT_DIR$/TerminatorPlus-API/bin/main/net/nuggetmc/tplus/api/utils/ItemUtils.class" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/TerminatorPlus-API/src/main/java/net/nuggetmc/tplus/api/Terminator.java" beforeDir="false" afterPath="$PROJECT_DIR$/TerminatorPlus-API/src/main/java/net/nuggetmc/tplus/api/Terminator.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/TerminatorPlus-API/src/main/java/net/nuggetmc/tplus/api/agent/botagent/BotAgent.java" beforeDir="false" afterPath="$PROJECT_DIR$/TerminatorPlus-API/src/main/java/net/nuggetmc/tplus/api/agent/botagent/BotAgent.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/TerminatorPlus-API/src/main/java/net/nuggetmc/tplus/api/agent/legacyagent/LegacyAgent.java" beforeDir="false" afterPath="$PROJECT_DIR$/TerminatorPlus-API/src/main/java/net/nuggetmc/tplus/api/agent/legacyagent/LegacyAgent.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/TerminatorPlus-API/src/main/java/net/nuggetmc/tplus/api/utils/ItemUtils.java" beforeDir="false" afterPath="$PROJECT_DIR$/TerminatorPlus-API/src/main/java/net/nuggetmc/tplus/api/utils/ItemUtils.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/TerminatorPlus-Plugin/.gradle/caches/paperweight/taskCache/reobfJar.log" beforeDir="false" afterPath="$PROJECT_DIR$/TerminatorPlus-Plugin/.gradle/caches/paperweight/taskCache/reobfJar.log" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/TerminatorPlus-Plugin/bin/main/net/nuggetmc/tplus/bot/Bot.class" beforeDir="false" afterPath="$PROJECT_DIR$/TerminatorPlus-Plugin/bin/main/net/nuggetmc/tplus/bot/Bot.class" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/TerminatorPlus-Plugin/bin/main/net/nuggetmc/tplus/bot/BotManagerImpl.class" beforeDir="false" afterPath="$PROJECT_DIR$/TerminatorPlus-Plugin/bin/main/net/nuggetmc/tplus/bot/BotManagerImpl.class" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/TerminatorPlus-Plugin/bin/main/net/nuggetmc/tplus/bot/CitizensNPC.class" beforeDir="false" afterPath="$PROJECT_DIR$/TerminatorPlus-Plugin/bin/main/net/nuggetmc/tplus/bot/CitizensNPC.class" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/TerminatorPlus-Plugin/bin/main/net/nuggetmc/tplus/utils/Debugger.class" beforeDir="false" afterPath="$PROJECT_DIR$/TerminatorPlus-Plugin/bin/main/net/nuggetmc/tplus/utils/Debugger.class" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/TerminatorPlus-Plugin/src/main/java/net/nuggetmc/tplus/bot/Bot.java" beforeDir="false" afterPath="$PROJECT_DIR$/TerminatorPlus-Plugin/src/main/java/net/nuggetmc/tplus/bot/Bot.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/TerminatorPlus-Plugin/src/main/java/net/nuggetmc/tplus/bot/BotManagerImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/TerminatorPlus-Plugin/src/main/java/net/nuggetmc/tplus/bot/BotManagerImpl.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/TerminatorPlus-Plugin/src/main/java/net/nuggetmc/tplus/bot/CitizensNPC.java" beforeDir="false" afterPath="$PROJECT_DIR$/TerminatorPlus-Plugin/src/main/java/net/nuggetmc/tplus/bot/CitizensNPC.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/TerminatorPlus-Plugin/src/main/java/net/nuggetmc/tplus/utils/Debugger.java" beforeDir="false" afterPath="$PROJECT_DIR$/TerminatorPlus-Plugin/src/main/java/net/nuggetmc/tplus/utils/Debugger.java" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/buildSrc/.gradle/9.0.0/executionHistory/executionHistory.lock" beforeDir="false" afterPath="$PROJECT_DIR$/buildSrc/.gradle/9.0.0/executionHistory/executionHistory.lock" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/buildSrc/.gradle/buildOutputCleanup/buildOutputCleanup.lock" beforeDir="false" afterPath="$PROJECT_DIR$/buildSrc/.gradle/buildOutputCleanup/buildOutputCleanup.lock" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/buildSrc/.gradle/file-system.probe" beforeDir="false" afterPath="$PROJECT_DIR$/buildSrc/.gradle/file-system.probe" afterDir="false" />
|
||||||
|
</list>
|
||||||
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||||
|
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||||
|
</component>
|
||||||
|
<component name="Git.Settings">
|
||||||
|
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||||
|
</component>
|
||||||
|
<component name="ProjectColorInfo"><![CDATA[{
|
||||||
|
"customColor": "",
|
||||||
|
"associatedIndex": 3
|
||||||
|
}]]></component>
|
||||||
|
<component name="ProjectId" id="3AUBaHjRoLsKlorfhrHm7B6wL6W" />
|
||||||
|
<component name="ProjectViewState">
|
||||||
|
<option name="hideEmptyMiddlePackages" value="true" />
|
||||||
|
<option name="showLibraryContents" value="true" />
|
||||||
|
</component>
|
||||||
|
<component name="PropertiesComponent"><![CDATA[{
|
||||||
|
"keyToString": {
|
||||||
|
"ModuleVcsDetector.initialDetectionPerformed": "true",
|
||||||
|
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||||
|
"RunOnceActivity.git.unshallow": "true"
|
||||||
|
}
|
||||||
|
}]]></component>
|
||||||
|
<component name="SharedIndexes">
|
||||||
|
<attachedChunks>
|
||||||
|
<set>
|
||||||
|
<option value="bundled-jdk-30f59d01ecdd-2fc7cc6b9a17-intellij.indexing.shared.core-IU-253.30387.90" />
|
||||||
|
</set>
|
||||||
|
</attachedChunks>
|
||||||
|
</component>
|
||||||
|
<component name="TaskManager">
|
||||||
|
<task active="true" id="Default" summary="Default task">
|
||||||
|
<changelist id="5102ee95-ea95-49aa-8d82-42bb833a7600" name="Changes" comment="" />
|
||||||
|
<created>1772637332226</created>
|
||||||
|
<option name="number" value="Default" />
|
||||||
|
<option name="presentableId" value="Default" />
|
||||||
|
<updated>1772637332226</updated>
|
||||||
|
</task>
|
||||||
|
<servers />
|
||||||
|
</component>
|
||||||
|
</project>
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
TerminatorPlus-API/build/libs/TerminatorPlus-API-4.5.1-BETA.jar
Normal file
BIN
TerminatorPlus-API/build/libs/TerminatorPlus-API-4.5.1-BETA.jar
Normal file
Binary file not shown.
Binary file not shown.
2
TerminatorPlus-API/build/tmp/jar/MANIFEST.MF
Normal file
2
TerminatorPlus-API/build/tmp/jar/MANIFEST.MF
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
Manifest-Version: 1.0
|
||||||
|
|
||||||
@@ -18,7 +18,6 @@ import java.util.List;
|
|||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
public interface Terminator {
|
public interface Terminator {
|
||||||
|
|
||||||
String getBotName();
|
String getBotName();
|
||||||
|
|
||||||
int getEntityId();
|
int getEntityId();
|
||||||
@@ -74,6 +73,7 @@ public interface Terminator {
|
|||||||
void faceLocation(Location location);
|
void faceLocation(Location location);
|
||||||
|
|
||||||
void attack(Entity target);
|
void attack(Entity target);
|
||||||
|
void attack(Entity target, double extra);
|
||||||
|
|
||||||
void attemptBlockPlace(Location loc, Material type, boolean down);
|
void attemptBlockPlace(Location loc, Material type, boolean down);
|
||||||
|
|
||||||
@@ -103,6 +103,8 @@ public interface Terminator {
|
|||||||
|
|
||||||
void setDefaultItem(ItemStack item);
|
void setDefaultItem(ItemStack item);
|
||||||
|
|
||||||
|
ItemStack getDefaultItem();
|
||||||
|
|
||||||
Vector getOffset();
|
Vector getOffset();
|
||||||
|
|
||||||
Vector getVelocity();
|
Vector getVelocity();
|
||||||
|
|||||||
@@ -7,7 +7,10 @@ import net.nuggetmc.tplus.api.utils.MathUtils;
|
|||||||
import net.nuggetmc.tplus.api.utils.PlayerUtils;
|
import net.nuggetmc.tplus.api.utils.PlayerUtils;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.plugin.Plugin;
|
import org.bukkit.plugin.Plugin;
|
||||||
import org.bukkit.util.Vector;
|
import org.bukkit.util.Vector;
|
||||||
|
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import net.nuggetmc.tplus.api.event.BotDeathEvent;
|
|||||||
import net.nuggetmc.tplus.api.event.BotFallDamageEvent;
|
import net.nuggetmc.tplus.api.event.BotFallDamageEvent;
|
||||||
import net.nuggetmc.tplus.api.event.TerminatorLocateTargetEvent;
|
import net.nuggetmc.tplus.api.event.TerminatorLocateTargetEvent;
|
||||||
import net.nuggetmc.tplus.api.utils.BotUtils;
|
import net.nuggetmc.tplus.api.utils.BotUtils;
|
||||||
|
import net.nuggetmc.tplus.api.utils.ItemUtils;
|
||||||
import net.nuggetmc.tplus.api.utils.MathUtils;
|
import net.nuggetmc.tplus.api.utils.MathUtils;
|
||||||
import net.nuggetmc.tplus.api.utils.PlayerUtils;
|
import net.nuggetmc.tplus.api.utils.PlayerUtils;
|
||||||
import org.bukkit.*;
|
import org.bukkit.*;
|
||||||
@@ -56,6 +57,7 @@ public class LegacyAgent extends Agent {
|
|||||||
private double regionWeightX;
|
private double regionWeightX;
|
||||||
private double regionWeightY;
|
private double regionWeightY;
|
||||||
private double regionWeightZ;
|
private double regionWeightZ;
|
||||||
|
private boolean waitformace = false;
|
||||||
|
|
||||||
public static final Set<EntityType> CUSTOM_MOB_LIST = new HashSet<>();
|
public static final Set<EntityType> CUSTOM_MOB_LIST = new HashSet<>();
|
||||||
public static CustomListMode customListMode = CustomListMode.CUSTOM;
|
public static CustomListMode customListMode = CustomListMode.CUSTOM;
|
||||||
@@ -102,6 +104,26 @@ 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 placeblocking(Location location, Terminator bot) {
|
||||||
|
Block block = location.getBlock();
|
||||||
|
if (block.getType() == Material.AIR) {
|
||||||
|
bot.setItem(new ItemStack(Material.COBBLESTONE));
|
||||||
|
block.setType(Material.COBBLESTONE);
|
||||||
|
bot.punch();
|
||||||
|
for (Player all : Bukkit.getOnlinePlayers())
|
||||||
|
all.playSound(bot.getLocation(), Sound.BLOCK_STONE_PLACE, SoundCategory.BLOCKS, 1, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void tickBot(Terminator bot) {
|
private void tickBot(Terminator bot) {
|
||||||
if (!bot.isBotAlive()) {
|
if (!bot.isBotAlive()) {
|
||||||
return;
|
return;
|
||||||
@@ -119,6 +141,11 @@ 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);
|
||||||
|
} else if (bot.getLocation().getY() > livingTarget.getLocation().getY() && bot.getLocation().distanceSquared(livingTarget.getLocation()) <= 4 && macemode(bot)) {
|
||||||
|
bot.jump();
|
||||||
|
macesmash(bot, livingTarget, false, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
blockCheck.clutch(bot, livingTarget);
|
blockCheck.clutch(bot, livingTarget);
|
||||||
@@ -137,6 +164,9 @@ public class LegacyAgent extends Agent {
|
|||||||
network.feed(BotData.generate(bot, livingTarget));
|
network.feed(BotData.generate(bot, livingTarget));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (livingTarget.getLocation().getY() > bot.getLocation().getY()) {
|
||||||
|
bot.block(10, 0);
|
||||||
|
}
|
||||||
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();
|
||||||
@@ -144,11 +174,21 @@ public class LegacyAgent extends Agent {
|
|||||||
|
|
||||||
if (ai) {
|
if (ai) {
|
||||||
if (network.check(BotNode.BLOCK) && loc.distance(livingTarget.getLocation()) < 6) {
|
if (network.check(BotNode.BLOCK) && loc.distance(livingTarget.getLocation()) < 6) {
|
||||||
bot.block(10, 10);
|
bot.block(20, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (LegacyUtils.checkFreeSpace(botEyeLoc, playerEyeLoc) || LegacyUtils.checkFreeSpace(botEyeLoc, playerLoc) && bot.getLocation().distanceSquared(livingTarget.getLocation()) <= 10) {
|
||||||
|
// place an block over the target such that he cant windcharge away or smth
|
||||||
|
World world = livingTarget.getWorld();
|
||||||
|
placeblocking(livingTarget.getLocation().add(new Location(world, 0, 2, 0)), bot); // over target
|
||||||
|
placeblocking(livingTarget.getLocation().add(new Location(world, 0, 0, 1)), bot); // +z
|
||||||
|
placeblocking(livingTarget.getLocation().add(new Location(world, 0, 0, -1)), bot); // -z
|
||||||
|
placeblocking(livingTarget.getLocation().add(new Location(world, 1, 0, 0)), bot); // +x
|
||||||
|
placeblocking(livingTarget.getLocation().add(new Location(world, -1, 0, 0)), bot); // -x
|
||||||
|
|
||||||
if (LegacyUtils.checkFreeSpace(botEyeLoc, playerEyeLoc) || LegacyUtils.checkFreeSpace(botEyeLoc, playerLoc)) {
|
|
||||||
attack(bot, livingTarget, loc);
|
attack(bot, livingTarget, loc);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -187,7 +227,9 @@ public class LegacyAgent extends Agent {
|
|||||||
|
|
||||||
if (checkDown(bot, botPlayer, livingTarget.getLocation(), bothXZ)) return;
|
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);
|
if (bothXZ) sideResult = checkSide(bot, livingTarget, botPlayer);
|
||||||
|
|
||||||
@@ -801,6 +843,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));
|
||||||
@@ -1394,12 +1447,154 @@ public class LegacyAgent extends Agent {
|
|||||||
return check;
|
return check;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private double clamp(double value, double min, double max) {
|
||||||
|
return Math.max(min, Math.min(max, value));
|
||||||
|
}
|
||||||
|
|
||||||
|
/*private double getdistfromfloor(LivingEntity entity) {
|
||||||
|
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) {
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get inventory - Citizens NPCs should have inventory even if not Player instance
|
||||||
|
ItemStack mainHand;
|
||||||
|
if (botEntity instanceof Player player) {
|
||||||
|
mainHand = player.getInventory().getItemInMainHand();
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if bot has a mace in main hand
|
||||||
|
if (bot.getDefaultItem().getType() != Material.MACE && mainHand.getType() != Material.MACE) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (attemptwindcharge)
|
||||||
|
if (!useWindcharge(bot)) return false;
|
||||||
|
|
||||||
|
waitformace = true;
|
||||||
|
Bukkit.getScheduler().scheduleAsyncDelayedTask(plugin, () -> {
|
||||||
|
while (!bot.isBotOnGround() && bot.getLocation().distanceSquared(target.getLocation()) > 3) {}
|
||||||
|
|
||||||
|
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, () -> {
|
||||||
|
double falldist = -(bot.getVelocity().getY()*15); // CERTAINLY not the best way but meh
|
||||||
|
//Bukkit.getLogger().info("fall dist: "+falldist+" cvy: "+bot.getVelocity().getY());
|
||||||
|
|
||||||
|
/*if (bot.isBotOnGround()) {
|
||||||
|
//Bukkit.getLogger().info("Bot -> ground, no mace");
|
||||||
|
return;
|
||||||
|
}*/
|
||||||
|
|
||||||
|
double extradmg = 0;
|
||||||
|
if (falldist >= 1.5) {
|
||||||
|
extradmg += clamp(falldist,0,3)*4; // first 3 blocks handling
|
||||||
|
falldist = clamp(falldist-3,0,Double.MAX_VALUE);
|
||||||
|
extradmg += clamp(falldist,0,5)*2; // next 5 blocks handling
|
||||||
|
falldist = clamp(falldist-5,0,Double.MAX_VALUE);
|
||||||
|
extradmg += falldist; // remaining blocks handling
|
||||||
|
}
|
||||||
|
macesmash(bot, target, true, extradmg);
|
||||||
|
}, 0);
|
||||||
|
}, attemptwindcharge ? 8 : 0);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
private void attack(Terminator bot, LivingEntity target, Location loc) {
|
private void attack(Terminator bot, LivingEntity target, Location loc) {
|
||||||
if ((target instanceof Player && PlayerUtils.isInvincible(((Player) target).getGameMode())) || target.getNoDamageTicks() >= 5 || loc.distance(target.getLocation()) >= 4)
|
if ((target instanceof Player && PlayerUtils.isInvincible(((Player) target).getGameMode())) || target.getNoDamageTicks() >= 5 || loc.distance(target.getLocation()) >= 4)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (tryWindchargeMaceAttack(bot, target)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
bot.attack(target);
|
bot.attack(target);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public void setRegion(BoundingBox region, double regionWeightX, double regionWeightY, double regionWeightZ) {
|
public void setRegion(BoundingBox region, double regionWeightX, double regionWeightY, double regionWeightZ) {
|
||||||
this.region = region;
|
this.region = region;
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ public class ItemUtils {
|
|||||||
case IRON_SWORD:
|
case IRON_SWORD:
|
||||||
case DIAMOND_AXE:
|
case DIAMOND_AXE:
|
||||||
case NETHERITE_PICKAXE:
|
case NETHERITE_PICKAXE:
|
||||||
|
case MACE:
|
||||||
return 6;
|
return 6;
|
||||||
|
|
||||||
case DIAMOND_SWORD:
|
case DIAMOND_SWORD:
|
||||||
|
|||||||
@@ -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 1642.84 ms.
|
[INFO] Finished after 1693.73 ms.
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user