From b3f1d47932753e7a223d167f9e122f2048837f76 Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Fri, 11 Jun 2021 09:46:11 -0500 Subject: [PATCH] Fix build --- .../server/0001-Tuinity-Server-Changes.patch | 62 +++---------------- .../server/0093-Populator-seed-controls.patch | 24 ++----- 2 files changed, 16 insertions(+), 70 deletions(-) diff --git a/patches/server/0001-Tuinity-Server-Changes.patch b/patches/server/0001-Tuinity-Server-Changes.patch index 423f0cc9b..149496770 100644 --- a/patches/server/0001-Tuinity-Server-Changes.patch +++ b/patches/server/0001-Tuinity-Server-Changes.patch @@ -5659,10 +5659,10 @@ index 0000000000000000000000000000000000000000..0e4442a94559346b19a536d35ce5def6 +} diff --git a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java new file mode 100644 -index 0000000000000000000000000000000000000000..79acb3fbca1abc6260d18ee40f7abb9efd14968b +index 0000000000000000000000000000000000000000..6736b6c29a1b4c8eac7ca0d012b73b501fd99042 --- /dev/null +++ b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java -@@ -0,0 +1,470 @@ +@@ -0,0 +1,454 @@ +package com.tuinity.tuinity.config; + +import com.destroystokyo.paper.util.SneakyThrow; @@ -6114,22 +6114,6 @@ index 0000000000000000000000000000000000000000..79acb3fbca1abc6260d18ee40f7abb9e + final int threads = this.getInt("tick-threads", -1); + this.threads = threads == -1 ? TuinityConfig.tickThreads : threads; + }*/ -+ -+ public int spawnLimitMonsters; -+ public int spawnLimitAnimals; -+ public int spawnLimitWaterAmbient; -+ public int spawnLimitWaterAnimals; -+ public int spawnLimitAmbient; -+ -+ private void perWorldSpawnLimit() { -+ final String path = "spawn-limits"; -+ -+ this.spawnLimitMonsters = this.getIntRaw(path + ".monsters", -1); -+ this.spawnLimitAnimals = this.getIntRaw(path + ".animals", -1); -+ this.spawnLimitWaterAmbient = this.getIntRaw(path + ".water-ambient", -1); -+ this.spawnLimitWaterAnimals = this.getIntRaw(path + ".water-animals", -1); -+ this.spawnLimitAmbient = this.getIntRaw(path + ".ambient", -1); -+ } + } + +} @@ -20767,7 +20751,7 @@ index cebecee640ed5a7fc2b978e00ff7eb012228267d..507c5255542ba1b958470b4db2c35b1b public void restart() { org.spigotmc.RestartCommand.restart(); diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java -index c0b49a0eaeda06b89a4fb425eec3d5bfa9717379..d4ed84e5825e5fb544980a20f0ac4eec48ddd799 100644 +index c0b49a0eaeda06b89a4fb425eec3d5bfa9717379..3562c20dee06913d03aee49d12cb27831c008842 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -298,7 +298,7 @@ public class CraftWorld implements World { @@ -20788,33 +20772,7 @@ index c0b49a0eaeda06b89a4fb425eec3d5bfa9717379..d4ed84e5825e5fb544980a20f0ac4eec if (chunkHolder.getChunk() != null) { ++ret; } -@@ -353,13 +353,20 @@ public class CraftWorld implements World { - this.generator = gen; - - environment = env; -+ // Tuinity start - per world spawn limits -+ this.monsterSpawn = world.tuinityConfig.spawnLimitMonsters; -+ this.animalSpawn = world.tuinityConfig.spawnLimitAnimals; -+ this.waterAmbientSpawn = world.tuinityConfig.spawnLimitWaterAmbient; -+ this.waterAnimalSpawn = world.tuinityConfig.spawnLimitWaterAnimals; -+ this.ambientSpawn = world.tuinityConfig.spawnLimitAmbient; - // Paper start - per world spawn limits -- this.monsterSpawn = this.world.paperConfig.spawnLimitMonsters; -- this.animalSpawn = this.world.paperConfig.spawnLimitAnimals; -- this.waterAnimalSpawn = this.world.paperConfig.spawnLimitWaterAnimals; -- this.waterAmbientSpawn = this.world.paperConfig.spawnLimitWaterAmbient; -- this.ambientSpawn = this.world.paperConfig.spawnLimitAmbient; -+ if (this.monsterSpawn == -1) this.monsterSpawn = this.world.paperConfig.spawnLimitMonsters; -+ if (this.animalSpawn == -1) this.animalSpawn = this.world.paperConfig.spawnLimitAnimals; -+ if (this.waterAnimalSpawn == -1) this.waterAnimalSpawn = this.world.paperConfig.spawnLimitWaterAnimals; -+ if (this.waterAmbientSpawn == -1) this.waterAmbientSpawn = this.world.paperConfig.spawnLimitWaterAmbient; -+ if (this.ambientSpawn == -1) this.ambientSpawn = this.world.paperConfig.spawnLimitAmbient; - // Paper end -+ // Tuinity end - per world spawn limits - } - - @Override -@@ -433,14 +440,7 @@ public class CraftWorld implements World { +@@ -433,14 +433,7 @@ public class CraftWorld implements World { @Override public Chunk getChunkAt(int x, int z) { @@ -20830,7 +20788,7 @@ index c0b49a0eaeda06b89a4fb425eec3d5bfa9717379..d4ed84e5825e5fb544980a20f0ac4eec } // Paper start -@@ -488,13 +488,16 @@ public class CraftWorld implements World { +@@ -488,13 +481,16 @@ public class CraftWorld implements World { public Chunk[] getLoadedChunks() { // Paper start if (Thread.currentThread() != world.getMinecraftWorld().serverThread) { @@ -20851,7 +20809,7 @@ index c0b49a0eaeda06b89a4fb425eec3d5bfa9717379..d4ed84e5825e5fb544980a20f0ac4eec return chunks.values().stream().map(PlayerChunk::getFullChunk).filter(Objects::nonNull).map(net.minecraft.world.level.chunk.Chunk::getBukkitChunk).toArray(Chunk[]::new); } -@@ -523,6 +526,7 @@ public class CraftWorld implements World { +@@ -523,6 +519,7 @@ public class CraftWorld implements World { org.spigotmc.AsyncCatcher.catchOp("chunk unload"); // Spigot if (isChunkLoaded(x, z)) { world.getChunkProvider().removeTicket(TicketType.PLUGIN, new ChunkCoordIntPair(x, z), 0, Unit.INSTANCE); // Paper @@ -20859,7 +20817,7 @@ index c0b49a0eaeda06b89a4fb425eec3d5bfa9717379..d4ed84e5825e5fb544980a20f0ac4eec } return true; -@@ -736,6 +740,30 @@ public class CraftWorld implements World { +@@ -736,6 +733,30 @@ public class CraftWorld implements World { return ret.entrySet().stream().collect(ImmutableMap.toImmutableMap(Map.Entry::getKey, (entry) -> entry.getValue().build())); } @@ -20890,7 +20848,7 @@ index c0b49a0eaeda06b89a4fb425eec3d5bfa9717379..d4ed84e5825e5fb544980a20f0ac4eec @Override public boolean isChunkForceLoaded(int x, int z) { return getHandle().getForceLoadedChunks().contains(ChunkCoordIntPair.pair(x, z)); -@@ -2668,7 +2696,7 @@ public class CraftWorld implements World { +@@ -2668,7 +2689,7 @@ public class CraftWorld implements World { } return this.world.getChunkProvider().getChunkAtAsynchronously(x, z, gen, urgent).thenComposeAsync((either) -> { net.minecraft.world.level.chunk.Chunk chunk = (net.minecraft.world.level.chunk.Chunk) either.left().orElse(null); @@ -20899,7 +20857,7 @@ index c0b49a0eaeda06b89a4fb425eec3d5bfa9717379..d4ed84e5825e5fb544980a20f0ac4eec return CompletableFuture.completedFuture(chunk == null ? null : chunk.getBukkitChunk()); }, net.minecraft.server.MinecraftServer.getServer()); } -@@ -2693,14 +2721,14 @@ public class CraftWorld implements World { +@@ -2693,14 +2714,14 @@ public class CraftWorld implements World { throw new IllegalArgumentException("View distance " + viewDistance + " is out of range of [2, 32]"); } PlayerChunkMap chunkMap = getHandle().getChunkProvider().playerChunkMap; @@ -20916,7 +20874,7 @@ index c0b49a0eaeda06b89a4fb425eec3d5bfa9717379..d4ed84e5825e5fb544980a20f0ac4eec } @Override -@@ -2709,11 +2737,22 @@ public class CraftWorld implements World { +@@ -2709,11 +2730,22 @@ public class CraftWorld implements World { throw new IllegalArgumentException("View distance " + viewDistance + " is out of range of [2, 32]"); } PlayerChunkMap chunkMap = getHandle().getChunkProvider().playerChunkMap; diff --git a/patches/server/0093-Populator-seed-controls.patch b/patches/server/0093-Populator-seed-controls.patch index 74557ab2e..675d1f145 100644 --- a/patches/server/0093-Populator-seed-controls.patch +++ b/patches/server/0093-Populator-seed-controls.patch @@ -18,7 +18,7 @@ index 5e672a0660d0aceffcdb26d185590ca18aa4f023..4b171a2a60e24947e884f8988920f335 } final Object val = config.get(key); diff --git a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java -index 79acb3fbca1abc6260d18ee40f7abb9efd14968b..1938b780d20c1d29d63aefeed7ba42fcd2495986 100644 +index 6736b6c29a1b4c8eac7ca0d012b73b501fd99042..1938b780d20c1d29d63aefeed7ba42fcd2495986 100644 --- a/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java +++ b/src/main/java/com/tuinity/tuinity/config/TuinityConfig.java @@ -1,5 +1,6 @@ @@ -28,26 +28,14 @@ index 79acb3fbca1abc6260d18ee40f7abb9efd14968b..1938b780d20c1d29d63aefeed7ba42fc import com.destroystokyo.paper.util.SneakyThrow; import net.minecraft.server.MinecraftServer; import net.minecraft.server.level.TicketType; -@@ -450,21 +451,19 @@ public final class TuinityConfig { +@@ -449,6 +450,20 @@ public final class TuinityConfig { + final int threads = this.getInt("tick-threads", -1); this.threads = threads == -1 ? TuinityConfig.tickThreads : threads; }*/ - -- public int spawnLimitMonsters; -- public int spawnLimitAnimals; -- public int spawnLimitWaterAmbient; -- public int spawnLimitWaterAnimals; -- public int spawnLimitAmbient; ++ + public Long populatorSeed; + public boolean useRandomPopulatorSeed; - -- private void perWorldSpawnLimit() { -- final String path = "spawn-limits"; -- -- this.spawnLimitMonsters = this.getIntRaw(path + ".monsters", -1); -- this.spawnLimitAnimals = this.getIntRaw(path + ".animals", -1); -- this.spawnLimitWaterAmbient = this.getIntRaw(path + ".water-ambient", -1); -- this.spawnLimitWaterAnimals = this.getIntRaw(path + ".water-animals", -1); -- this.spawnLimitAmbient = this.getIntRaw(path + ".ambient", -1); ++ + private void populatorSeed() { + final String seedString = this.getString("worldgen.seeds.populator", "default"); + if (seedString.equalsIgnoreCase("random")) { @@ -56,7 +44,7 @@ index 79acb3fbca1abc6260d18ee40f7abb9efd14968b..1938b780d20c1d29d63aefeed7ba42fc + this.populatorSeed = Long.parseLong(seedString); + } + if (!TimingsManager.hiddenConfigs.contains("worldgen.seeds.populator")) TimingsManager.hiddenConfigs.add("worldgen.seeds.populator"); - } ++ } + }