first commit-ish, forked and updated for 1.21.11
Some checks failed
Compile / gradle (ubuntu-latest) (push) Has been cancelled

This commit is contained in:
Justus Wolff
2026-03-02 15:40:11 +01:00
parent ff9220654b
commit 53b4f6a04a
491 changed files with 98649 additions and 86 deletions

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.

View File

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.

View File

Binary file not shown.

View File

@@ -0,0 +1,2 @@
#Mon Mar 02 13:41:08 CET 2026
gradle.version=9.0.0

Binary file not shown.

BIN
.gradle/file-system.probe Normal file

Binary file not shown.

Binary file not shown.

View File

View File

@@ -17,6 +17,7 @@ repositories {
} }
dependencies { dependencies {
compileOnly("io.papermc.paper:paper-api:1.21.1-R0.1-SNAPSHOT") compileOnly("io.papermc.paper:paper-api:1.21.11-R0.1-SNAPSHOT")
compileOnly("com.mojang:authlib:3.2.38") compileOnly("com.mojang:authlib:3.2.38")
compileOnly("com.googlecode.json-simple:json-simple:1.1.1")
} }

View File

@@ -21,15 +21,15 @@ public interface BotManager {
List<String> fetchNames(); List<String> fetchNames();
Terminator createBot(Location loc, String name, String skin, String signature); Terminator createBot(Location loc, String name, String skin);
void createBots(CommandSender sender, String name, String skinName, int n, Location location); void createBots(CommandSender sender, String name, String skinName, int n, Location location);
void createBots(CommandSender sender, String name, String skinName, int n, NeuralNetwork network, Location location); void createBots(CommandSender sender, String name, String skinName, int n, NeuralNetwork network, Location location);
Set<Terminator> createBots(Location loc, String name, String[] skin, List<NeuralNetwork> networks); Set<Terminator> createBots(Location loc, String name, String skin, List<NeuralNetwork> networks);
Set<Terminator> createBots(Location loc, String name, String[] skin, int n, NeuralNetwork network); Set<Terminator> createBots(Location loc, String name, String skin, int n, NeuralNetwork network);
void remove(Terminator bot); void remove(Terminator bot);

View File

@@ -1068,6 +1068,7 @@ public class LegacyAgent extends Agent {
} }
private void blockBreakEffect(Terminator bot, LivingEntity player, Block block, LegacyLevel.LevelWrapper wrapper) { private void blockBreakEffect(Terminator bot, LivingEntity player, Block block, LegacyLevel.LevelWrapper wrapper) {
if (bot == null) {return;}
if (LegacyMats.NO_CRACK.contains(block.getType())) return; if (LegacyMats.NO_CRACK.contains(block.getType())) return;
@@ -1314,7 +1315,7 @@ public class LegacyAgent extends Agent {
bot.look(BlockFace.DOWN); bot.look(BlockFace.DOWN);
bot.punch(); bot.punch();
Boat boat = (Boat) world.spawnEntity(place, EntityType.BOAT); Boat boat = (Boat) world.spawnEntity(place, EntityType.OAK_BOAT);
scheduler.runTaskLater(plugin, () -> { scheduler.runTaskLater(plugin, () -> {
if (!boat.isDead()) { if (!boat.isDead()) {
@@ -1565,6 +1566,8 @@ public class LegacyAgent extends Agent {
} }
private boolean validateCloserEntity(LivingEntity entity, Location loc, LivingEntity result) { private boolean validateCloserEntity(LivingEntity entity, Location loc, LivingEntity result) {
if (entity == null)
return false;
double regionDistEntity = getWeightedRegionDist(entity.getLocation()); double regionDistEntity = getWeightedRegionDist(entity.getLocation());
if (regionDistEntity == Double.MAX_VALUE) if (regionDistEntity == Double.MAX_VALUE)
return false; return false;

View File

@@ -132,7 +132,7 @@ public class LegacyMats {
public static final Set<Material> OBSTACLES = new HashSet<>(concatTypes(Lists.newArrayList( public static final Set<Material> OBSTACLES = new HashSet<>(concatTypes(Lists.newArrayList(
Material.IRON_BARS, Material.IRON_BARS,
Material.CHAIN, Material.IRON_CHAIN,
Material.END_ROD, Material.END_ROD,
Material.LIGHTNING_ROD, Material.LIGHTNING_ROD,
Material.COBWEB, Material.COBWEB,
@@ -282,7 +282,7 @@ public class LegacyMats {
public static boolean canPlaceWater(Block block, Optional<Double> entityYPos) { public static boolean canPlaceWater(Block block, Optional<Double> entityYPos) {
if (isSolid(block.getType())) { if (isSolid(block.getType())) {
if (block.getType() == Material.CHAIN && ((Chain)block.getBlockData()).getAxis() == Axis.Y if (block.getType() == Material.IRON_CHAIN && ((Chain)block.getBlockData()).getAxis() == Axis.Y
&& !((Chain)block.getBlockData()).isWaterlogged()) && !((Chain)block.getBlockData()).isWaterlogged())
return false; return false;
if ((block.getType().data == Leaves.class || block.getType() == Material.MANGROVE_ROOTS if ((block.getType().data == Leaves.class || block.getType() == Material.MANGROVE_ROOTS
@@ -387,7 +387,7 @@ public class LegacyMats {
case CACTUS: case CACTUS:
case DRAGON_EGG: case DRAGON_EGG:
case TURTLE_EGG: case TURTLE_EGG:
case CHAIN: case IRON_CHAIN:
case IRON_BARS: case IRON_BARS:
case LANTERN: case LANTERN:
case SOUL_LANTERN: case SOUL_LANTERN:

View File

@@ -7,7 +7,6 @@ import net.nuggetmc.tplus.api.agent.legacyagent.EnumTargetGoal;
import net.nuggetmc.tplus.api.agent.legacyagent.LegacyAgent; import net.nuggetmc.tplus.api.agent.legacyagent.LegacyAgent;
import net.nuggetmc.tplus.api.utils.ChatUtils; import net.nuggetmc.tplus.api.utils.ChatUtils;
import net.nuggetmc.tplus.api.utils.MathUtils; import net.nuggetmc.tplus.api.utils.MathUtils;
import net.nuggetmc.tplus.api.utils.MojangAPI;
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.ChatColor; import org.bukkit.ChatColor;
@@ -102,14 +101,12 @@ public class IntelligenceAgent {
print("Starting generation " + ChatColor.RED + generation + ChatColor.RESET + "..."); print("Starting generation " + ChatColor.RED + generation + ChatColor.RESET + "...");
sleep(2000); //sleep(2000);
String skinName = botSkin == null ? this.botName : botSkin; String skinName = botSkin == null ? this.botName : botSkin;
print("Fetching skin data for " + ChatColor.GREEN + skinName + ChatColor.RESET + "..."); print("Fetching skin data for " + ChatColor.GREEN + skinName + ChatColor.RESET + "...");
String[] skinData = MojangAPI.getSkin(skinName);
String botName = this.botName.endsWith("%") ? this.botName : this.botName + "%"; String botName = this.botName.endsWith("%") ? this.botName : this.botName + "%";
print("Creating " + (populationSize == 1 ? "new bot" : ChatColor.RED + NumberFormat.getInstance(Locale.US).format(populationSize) + ChatColor.RESET + " new bots") print("Creating " + (populationSize == 1 ? "new bot" : ChatColor.RED + NumberFormat.getInstance(Locale.US).format(populationSize) + ChatColor.RESET + " new bots")
@@ -124,7 +121,7 @@ public class IntelligenceAgent {
Set<Terminator> bots; Set<Terminator> bots;
if (loadedProfiles == null) { if (loadedProfiles == null) {
bots = manager.createBots(loc, botName, skinData, populationSize, NeuralNetwork.RANDOM); bots = manager.createBots(loc, botName, skinName, populationSize, NeuralNetwork.RANDOM);
} else { } else {
List<NeuralNetwork> networks = new ArrayList<>(); List<NeuralNetwork> networks = new ArrayList<>();
loadedProfiles.forEach(profile -> networks.add(NeuralNetwork.createNetworkFromProfile(profile))); loadedProfiles.forEach(profile -> networks.add(NeuralNetwork.createNetworkFromProfile(profile)));
@@ -136,7 +133,7 @@ public class IntelligenceAgent {
return; return;
} }
bots = manager.createBots(loc, botName, skinData, networks); bots = manager.createBots(loc, botName, skinName, networks);
} }
bots.forEach(bot -> { bots.forEach(bot -> {
@@ -151,16 +148,16 @@ public class IntelligenceAgent {
}); });
while (bots.size() != populationSize) { while (bots.size() != populationSize) {
sleep(1000); sleep(100);
} }
sleep(2000); //sleep(2000);
print("The bots will now attack each other."); print("The bots will now attack each other.");
agent.setTargetType(EnumTargetGoal.NEAREST_BOT); agent.setTargetType(EnumTargetGoal.NEAREST_BOT);
while (aliveCount() > 1) { while (aliveCount() > 1) {
sleep(1000); sleep(100);
} }
print("Generation " + ChatColor.RED + generation + ChatColor.RESET + " has ended."); print("Generation " + ChatColor.RED + generation + ChatColor.RESET + " has ended.");
@@ -188,7 +185,7 @@ public class IntelligenceAgent {
i++; i++;
} }
sleep(3000); //sleep(3000);
Map<BotNode, Map<BotDataType, List<Double>>> lists = new HashMap<>(); Map<BotNode, Map<BotDataType, List<Double>>> lists = new HashMap<>();
@@ -236,9 +233,12 @@ public class IntelligenceAgent {
genProfiles.put(generation + 1, profiles); genProfiles.put(generation + 1, profiles);
sleep(2000); //sleep(2000);
clearBots(); clearBots();
while (bots.size() != 0) {
sleep(100);
}
agent.setTargetType(EnumTargetGoal.NONE); agent.setTargetType(EnumTargetGoal.NONE);
} }
@@ -326,8 +326,11 @@ public class IntelligenceAgent {
if (!bots.isEmpty()) { if (!bots.isEmpty()) {
print("Removing all cached bots..."); print("Removing all cached bots...");
scheduler.runTask(plugin, () -> {
bots.values().forEach(Terminator::removeBot); bots.values().forEach(Terminator::removeBot);
bots.clear(); bots.clear();
});
} }
/*print("Removing all current bots..."); /*print("Removing all current bots...");

View File

@@ -0,0 +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
[INFO] Finished after 1642.84 ms.

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More