From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Bud Gidiere Date: Thu, 6 Aug 2020 19:47:50 -0500 Subject: [PATCH] Yatopia-Server-Fixes diff --git a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java index 841a8d2b392acdcef90592b841cbbcb2237c6901..88513b8830ea666ddf831771680b6e76e7cf95f0 100644 --- a/src/main/java/co/aikar/timings/TimingsExport.java +++ b/src/main/java/co/aikar/timings/TimingsExport.java @@ -231,7 +231,7 @@ public class TimingsExport extends Thread { pair("bukkit", mapAsJSON(Bukkit.spigot().getBukkitConfig(), null)), pair("paper", mapAsJSON(Bukkit.spigot().getPaperConfig(), null)), // Tuinity - add config to timings report pair("tuinity", mapAsJSON(Bukkit.spigot().getTuinityConfig(), null)) // Tuinity - add config to timings report - , pair("akarin", mapAsJSON(Bukkit.spigot().getAkarinConfig(), null)) // Akarin - Server config + , pair("purpur", mapAsJSON(Bukkit.spigot().getPurpurConfig(), null)) // Yatopia - add config to timings report )); new TimingsExport(listeners, parent, history).start(); diff --git a/src/main/java/co/aikar/timings/TimingsExport.java.rej b/src/main/java/co/aikar/timings/TimingsExport.java.rej deleted file mode 100644 index 572780ca665c0fb254cc7431af3dd7759a94f26c..0000000000000000000000000000000000000000 --- a/src/main/java/co/aikar/timings/TimingsExport.java.rej +++ /dev/null @@ -1,9 +0,0 @@ -diff a/src/main/java/co/aikar/timings/TimingsExport.java b/src/main/java/co/aikar/timings/TimingsExport.java (rejected hunks) -@@ -230,6 +230,7 @@ public class TimingsExport extends Thread { - pair("spigot", mapAsJSON(Bukkit.spigot().getSpigotConfig(), null)), - pair("bukkit", mapAsJSON(Bukkit.spigot().getBukkitConfig(), null)), - pair("paper", mapAsJSON(Bukkit.spigot().getPaperConfig(), null)) -+ , pair("rainforest", mapAsJSON(Bukkit.spigot().getRainforestConfig(), null)) // Rainforest - )); - - new TimingsExport(listeners, parent, history).start(); diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java index f81bd67a323f2e72bdad76c52016993a0bf88307..98a898f8b8469969e5eb388edb818e519ff68681 100644 --- a/src/main/java/com/destroystokyo/paper/PaperCommand.java +++ b/src/main/java/com/destroystokyo/paper/PaperCommand.java @@ -439,18 +439,18 @@ public class PaperCommand extends Command { ChunkProviderServer chunkProviderServer = world.getChunkProvider(); Collection entities = world.entitiesById.values(); - entities.forEach(e -> { - MinecraftKey key = e.getMinecraftKey(); - if (e.shouldBeRemoved) return; // Paper + for (Entity entity : entities) { + MinecraftKey key = entity.getMinecraftKey(); + if (entity.shouldBeRemoved) continue; MutablePair> info = list.computeIfAbsent(key, k -> MutablePair.of(0, Maps.newHashMap())); - ChunkCoordIntPair chunk = new ChunkCoordIntPair(e.chunkX, e.chunkZ); + ChunkCoordIntPair chunk = new ChunkCoordIntPair(entity.chunkX, entity.chunkZ); info.left++; info.right.put(chunk, info.right.getOrDefault(chunk, 0) + 1); - if (!chunkProviderServer.isInEntityTickingChunk(e)) { + if (!chunkProviderServer.isInEntityTickingChunk(entity)) { nonEntityTicking.merge(key, Integer.valueOf(1), Integer::sum); } - }); + } if (names.size() == 1) { MinecraftKey name = names.iterator().next(); diff --git a/src/main/java/com/destroystokyo/paper/PaperCommand.java.rej b/src/main/java/com/destroystokyo/paper/PaperCommand.java.rej deleted file mode 100644 index 8f31dba6a29514aad6e74e265bf000014cd1e3c3..0000000000000000000000000000000000000000 --- a/src/main/java/com/destroystokyo/paper/PaperCommand.java.rej +++ /dev/null @@ -1,26 +0,0 @@ -diff a/src/main/java/com/destroystokyo/paper/PaperCommand.java b/src/main/java/com/destroystokyo/paper/PaperCommand.java (rejected hunks) -@@ -429,18 +439,18 @@ public class PaperCommand extends Command { - ChunkProviderServer chunkProviderServer = world.getChunkProvider(); - - Collection entities = world.entitiesById.values(); -- entities.forEach(e -> { -- MinecraftKey key = e.getMinecraftKey(); -- if (e.shouldBeRemoved) return; // Paper -+ for (Entity entity : entities) { -+ MinecraftKey key = entity.getMinecraftKey(); -+ if (entity.shouldBeRemoved) continue; - - MutablePair> info = list.computeIfAbsent(key, k -> MutablePair.of(0, Maps.newHashMap())); -- ChunkCoordIntPair chunk = new ChunkCoordIntPair(e.getChunkX(), e.getChunkZ()); -+ ChunkCoordIntPair chunk = new ChunkCoordIntPair(entity.getChunkX(), entity.getChunkZ()); - info.left++; - info.right.put(chunk, info.right.getOrDefault(chunk, 0) + 1); -- if (!chunkProviderServer.isInEntityTickingChunk(e)) { -+ if (!chunkProviderServer.isInEntityTickingChunk(entity)) { - nonEntityTicking.merge(key, Integer.valueOf(1), Integer::sum); - } -- }); -+ } - - if (names.size() == 1) { - MinecraftKey name = names.iterator().next(); diff --git a/src/main/java/com/destroystokyo/paper/server/ticklist/PaperTickList.java b/src/main/java/com/destroystokyo/paper/server/ticklist/PaperTickList.java index dee9655b89d061ec8218ea2c54660c6003e8548f..253b73cfc597d4c7106d969be7b18c68166128ae 100644 --- a/src/main/java/com/destroystokyo/paper/server/ticklist/PaperTickList.java +++ b/src/main/java/com/destroystokyo/paper/server/ticklist/PaperTickList.java @@ -295,7 +295,7 @@ public final class PaperTickList extends TickListServer { // extend to avo this.shortScheduledIndex = getNextIndex(this.shortScheduledIndex, SHORT_SCHEDULE_TICK_THRESHOLD); this.timingCleanup.stopTiming(); - this.world.getMethodProfiler().exitEnter("ticking"); + //this.world.getMethodProfiler().exitEnter("ticking"); // Akarin - remove caller this.timingTicking.startTiming(); for (final NextTickListEntry toTick : this.toTickThisTick) { diff --git a/src/main/java/com/destroystokyo/paper/server/ticklist/PaperTickList.java.rej b/src/main/java/com/destroystokyo/paper/server/ticklist/PaperTickList.java.rej deleted file mode 100644 index c9fa39c5b4b013b56720e339463ffcb5fd3c13f9..0000000000000000000000000000000000000000 --- a/src/main/java/com/destroystokyo/paper/server/ticklist/PaperTickList.java.rej +++ /dev/null @@ -1,10 +0,0 @@ -diff a/src/main/java/com/destroystokyo/paper/server/ticklist/PaperTickList.java b/src/main/java/com/destroystokyo/paper/server/ticklist/PaperTickList.java (rejected hunks) -@@ -283,7 +283,7 @@ public final class PaperTickList extends TickListServer { // extend to avo - this.nextTick = this.world.getTime() + 1; - - this.timingCleanup.stopTiming(); -- this.world.getMethodProfiler().exitEnter("ticking"); -+ //this.world.getMethodProfiler().exitEnter("ticking"); // Akarin - remove caller - this.timingTicking.startTiming(); - - for (final NextTickListEntry toTick : this.toTickThisTick) { diff --git a/src/main/java/de/minebench/origami/OrigamiConfig.java b/src/main/java/de/minebench/origami/OrigamiConfig.java index fe7330fabe386966c2d203a190a00a785ea21be0..2cedf4d7aaefc064f5730015c41c1f5102bc747d 100644 --- a/src/main/java/de/minebench/origami/OrigamiConfig.java +++ b/src/main/java/de/minebench/origami/OrigamiConfig.java @@ -112,6 +112,19 @@ public final class OrigamiConfig { config.addDefault("worlds.default." + path, Double.valueOf(dfl)); return config.getDouble("worlds." + worldName + "." + path, config.getDouble("worlds.default." + path, dfl)); } + + public boolean tickEmptyHoppers = true; + public int fullHopperCooldown = 128; + private void hopperOptimizations() { + tickEmptyHoppers = getBoolean("tick-empty-hoppers", tickEmptyHoppers); + fullHopperCooldown = getInt("ticks-per.full-hopper-cooldown", fullHopperCooldown); + } + + public boolean fastFeatureSearchDontLoad = false; + private void fastFeatureSearchDontLoad() { + fastFeatureSearchDontLoad = getBoolean("fast-feature-search-dont-load", fastFeatureSearchDontLoad); + } + } } \ No newline at end of file diff --git a/src/main/java/de/minebench/origami/OrigamiConfig.java.rej b/src/main/java/de/minebench/origami/OrigamiConfig.java.rej deleted file mode 100644 index 8428d4bd05075e86b281312fa38106882c54735b..0000000000000000000000000000000000000000 --- a/src/main/java/de/minebench/origami/OrigamiConfig.java.rej +++ /dev/null @@ -1,14 +0,0 @@ -diff a/src/main/java/de/minebench/origami/OrigamiConfig.java b/src/main/java/de/minebench/origami/OrigamiConfig.java (rejected hunks) -@@ -169,6 +169,12 @@ public final class OrigamiConfig { - Bukkit.getLogger().info("Farm detection radius: " + pigmenFarmsRadius + ", count: " + pigmenFarmsCount); - } - } -+ public boolean tickEmptyHoppers = false; -+ public int fullHopperCooldown = 128; -+ private void hopperOptimizations() { -+ tickEmptyHoppers = getBoolean("tick-empty-hoppers", tickEmptyHoppers); -+ fullHopperCooldown = getInt("ticks-per.full-hopper-cooldown", fullHopperCooldown); -+ } - } - - public static boolean teleportingOfVehiclesWithPassenger = true; diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java index ee10abb6bc4d957676e7eef377cdc68dc3f43370..c12f4326f68020fbb140e97f0ef43ddcf5a71072 100644 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java +++ b/src/main/java/net/minecraft/server/ChunkProviderServer.java @@ -974,11 +974,11 @@ public class ChunkProviderServer extends IChunkProvider { player.playerNaturallySpawnedEvent = event; } // Paper end - optimize isOutisdeRange - this.world.getMethodProfiler().enter("pollingChunks"); + //this.world.getMethodProfiler().enter("pollingChunks"); // Akarin - remove caller int k = this.world.getGameRules().getInt(GameRules.RANDOM_TICK_SPEED); boolean flag2 = world.ticksPerAnimalSpawns != 0L && worlddata.getTime() % world.ticksPerAnimalSpawns == 0L; // CraftBukkit - this.world.getMethodProfiler().enter("naturalSpawnCount"); + //this.world.getMethodProfiler().enter("naturalSpawnCount"); // Akarin - remove caller this.world.timings.countNaturalMobs.startTiming(); // Paper - timings int l = this.chunkMapDistance.b(); // Paper start - per player mob spawning diff --git a/src/main/java/net/minecraft/server/ChunkProviderServer.java.rej b/src/main/java/net/minecraft/server/ChunkProviderServer.java.rej deleted file mode 100644 index d1152585c5f482e554966f965561626c78ac4d3a..0000000000000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/ChunkProviderServer.java.rej +++ /dev/null @@ -1,15 +0,0 @@ -diff a/src/main/java/net/minecraft/server/ChunkProviderServer.java b/src/main/java/net/minecraft/server/ChunkProviderServer.java (rejected hunks) -@@ -971,11 +971,11 @@ public class ChunkProviderServer extends IChunkProvider { - player.lastEntitySpawnRadiusSquared = (double)((range << 4) * (range << 4)); // used in isOutsideRange - } - // Paper end - optimize isOutisdeRange -- this.world.getMethodProfiler().enter("pollingChunks"); -+ //this.world.getMethodProfiler().enter("pollingChunks"); // Akarin - remove caller - int k = this.world.getGameRules().getInt(GameRules.RANDOM_TICK_SPEED); - boolean flag2 = world.ticksPerAnimalSpawns != 0L && worlddata.getTime() % world.ticksPerAnimalSpawns == 0L; // CraftBukkit - -- this.world.getMethodProfiler().enter("naturalSpawnCount"); -+ //this.world.getMethodProfiler().enter("naturalSpawnCount"); // Akarin - remove caller - this.world.timings.countNaturalMobs.startTiming(); // Paper - timings - int l = this.chunkMapDistance.b(); - // Paper start - per player mob spawning diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java index 77b6e4dd34893f0959574f95078bc3fa6896e69c..7ac6ef0a125499de4b5e6a9ed80f963ba623b9f6 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -181,6 +181,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer // Paper end com.tuinity.tuinity.config.TuinityConfig.init((java.io.File) options.valueOf("tuinity-settings")); // Tuinity - Server Config app.akarin.server.Config.init((java.io.File) options.valueOf("akarin-settings")); // Akarin - Server Config + com.proximyst.rainforest.RainforestConfig.init((java.io.File) options.valueOf("rainforest-settings")); // Rainforest this.setPVP(dedicatedserverproperties.pvp); this.setAllowFlight(dedicatedserverproperties.allowFlight); diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java.rej b/src/main/java/net/minecraft/server/DedicatedServer.java.rej deleted file mode 100644 index 4c2d5b3e080c925d687733ec40d4fb4b22552c96..0000000000000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/DedicatedServer.java.rej +++ /dev/null @@ -1,9 +0,0 @@ -diff a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java (rejected hunks) -@@ -170,6 +170,7 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer - com.destroystokyo.paper.PaperConfig.registerCommands(); - com.destroystokyo.paper.VersionHistoryManager.INSTANCE.getClass(); // load version history now - // Paper end -+ com.proximyst.rainforest.RainforestConfig.init((java.io.File) options.valueOf("rainforest-settings")); // Rainforest - - this.setPVP(dedicatedserverproperties.pvp); - this.setAllowFlight(dedicatedserverproperties.allowFlight); diff --git a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java index 70ae2923e21d7a0312e629a903ca9e380d6c6114..d906c5e530c2e7f779df079223aee619a73b5d51 100644 --- a/src/main/java/net/minecraft/server/EntityVillager.java +++ b/src/main/java/net/minecraft/server/EntityVillager.java @@ -164,6 +164,10 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation protected void mobTick() { mobTick(false); } protected void mobTick(boolean inactive) { //this.world.getMethodProfiler().enter("villagerBrain"); // Akarin - remove caller + // Purpur start + boolean tick = (world.getTime() + brainTickOffset) % world.purpurConfig.villagerBrainTicks == 0; + if (((WorldServer) world).getMinecraftServer().lagging ? tick : world.purpurConfig.villagerUseBrainTicksOnlyWhenLagging || tick) + // Purpur end if (!inactive) this.getBehaviorController().a((WorldServer) this.world, this); // CraftBukkit - decompile error // Paper if (this.bM) { this.bM = false; diff --git a/src/main/java/net/minecraft/server/EntityVillager.java.rej b/src/main/java/net/minecraft/server/EntityVillager.java.rej deleted file mode 100644 index 68f0fc0230a4148ab9fc4181736ce93297c7e1b9..0000000000000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/EntityVillager.java.rej +++ /dev/null @@ -1,12 +0,0 @@ -diff a/src/main/java/net/minecraft/server/EntityVillager.java b/src/main/java/net/minecraft/server/EntityVillager.java (rejected hunks) -@@ -166,6 +168,10 @@ public class EntityVillager extends EntityVillagerAbstract implements Reputation - protected void mobTick() { mobTick(false); } - protected void mobTick(boolean inactive) { - this.world.getMethodProfiler().enter("villagerBrain"); -+ // Purpur start -+ boolean tick = (world.getTime() + brainTickOffset) % world.purpurConfig.villagerBrainTicks == 0; -+ if (((WorldServer) world).getMinecraftServer().lagging ? tick : world.purpurConfig.villagerUseBrainTicksOnlyWhenLagging || tick) -+ // Purpur end - if (!inactive) this.getBehaviorController().a((WorldServer) this.world, this); // CraftBukkit - decompile error // Paper - if (this.bM) { - this.bM = false; diff --git a/src/main/java/net/minecraft/server/LightEngineThreaded.java b/src/main/java/net/minecraft/server/LightEngineThreaded.java index 9d6d882ad1479771b2a9e7c3a14c71dd00b63172..cc22d89d540a4f86e11d7d09ad2be7fcf070f43d 100644 --- a/src/main/java/net/minecraft/server/LightEngineThreaded.java +++ b/src/main/java/net/minecraft/server/LightEngineThreaded.java @@ -334,10 +334,14 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { private final java.util.List post = new java.util.ArrayList<>(); private void b() { if (queue.poll(pre, post)) { - pre.forEach(Runnable::run); + for (Runnable runnable1 : pre) { + runnable1.run(); + } pre.clear(); super.a(Integer.MAX_VALUE, true, true); - post.forEach(Runnable::run); + for (Runnable runnable : post) { + runnable.run(); + } post.clear(); } else { // might have level updates to go still diff --git a/src/main/java/net/minecraft/server/LightEngineThreaded.java.rej b/src/main/java/net/minecraft/server/LightEngineThreaded.java.rej deleted file mode 100644 index 74d10212e547adf96762155adb03c0158df00a16..0000000000000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/LightEngineThreaded.java.rej +++ /dev/null @@ -1,18 +0,0 @@ -diff a/src/main/java/net/minecraft/server/LightEngineThreaded.java b/src/main/java/net/minecraft/server/LightEngineThreaded.java (rejected hunks) -@@ -288,10 +288,14 @@ public class LightEngineThreaded extends LightEngine implements AutoCloseable { - int i = Math.min(queue.size(), 4); - boolean ran = false; - while (i-- > 0 && queue.poll(pre, post)) { -- pre.forEach(Runnable::run); -+ for (Runnable runnable1 : pre) { -+ runnable1.run(); -+ } - pre.clear(); - super.a(Integer.MAX_VALUE, true, true); -- post.forEach(Runnable::run); -+ for (Runnable runnable : post) { -+ runnable.run(); -+ } - post.clear(); - ran = true; - } diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java index ff1692c131b43f217de1fb6657a8274136a3dd08..5960ed2e91008b363dad900c72064055413eafd9 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -1001,7 +1001,13 @@ public abstract class MinecraftServer extends IAsyncTaskHandlerReentrant> 4; pos.setValues(player.locX(), 0, player.locZ()); double twoThirdModifier = 2D / 3D; - MCUtil.getSpiralOutChunks(pos, Math.min(6, viewDistance)).forEach(coord -> { - if (shouldSkipPrioritization(coord)) return; + for (ChunkCoordIntPair coordIntPair : MCUtil.getSpiralOutChunks(pos, Math.min(6, viewDistance))) { + if (shouldSkipPrioritization(coordIntPair)) continue; - double dist = MCUtil.distance(playerChunkX, 0, playerChunkZ, coord.x, 0, coord.z); + double dist = MCUtil.distance(playerChunkX, 0, playerChunkZ, coordIntPair.x, 0, coordIntPair.z); // Prioritize immediate if (dist <= 4 * 4) { - updateChunkPriorityMap(priorities, coord.pair(), (int) (27 - Math.sqrt(dist))); - return; + updateChunkPriorityMap(priorities, coordIntPair.pair(), (int) (27 - Math.sqrt(dist))); + continue; } // Prioritize nearby chunks - updateChunkPriorityMap(priorities, coord.pair(), (int) (20 - Math.sqrt(dist) * twoThirdModifier)); - }); + updateChunkPriorityMap(priorities, coordIntPair.pair(), (int) (20 - Math.sqrt(dist) * twoThirdModifier)); + } // Prioritize Frustum near 3 ChunkCoordIntPair front3 = player.getChunkInFront(3); pos.setValues(front3.x << 4, 0, front3.z << 4); - MCUtil.getSpiralOutChunks(pos, Math.min(5, viewDistance)).forEach(coord -> { - if (shouldSkipPrioritization(coord)) return; + for (ChunkCoordIntPair chunkCoordIntPair : MCUtil.getSpiralOutChunks(pos, Math.min(5, viewDistance))) { + if (shouldSkipPrioritization(chunkCoordIntPair)) continue; - double dist = MCUtil.distance(playerChunkX, 0, playerChunkZ, coord.x, 0, coord.z); - updateChunkPriorityMap(priorities, coord.pair(), (int) (25 - Math.sqrt(dist) * twoThirdModifier)); - }); + double dist = MCUtil.distance(playerChunkX, 0, playerChunkZ, chunkCoordIntPair.x, 0, chunkCoordIntPair.z); + updateChunkPriorityMap(priorities, chunkCoordIntPair.pair(), (int) (25 - Math.sqrt(dist) * twoThirdModifier)); + } // Prioritize Frustum near 5 if (viewDistance > 4) { ChunkCoordIntPair front5 = player.getChunkInFront(5); pos.setValues(front5.x << 4, 0, front5.z << 4); - MCUtil.getSpiralOutChunks(pos, 4).forEach(coord -> { - if (shouldSkipPrioritization(coord)) return; + for (ChunkCoordIntPair coord : MCUtil.getSpiralOutChunks(pos, 3)) { + if (shouldSkipPrioritization(coord)) continue; double dist = MCUtil.distance(playerChunkX, 0, playerChunkZ, coord.x, 0, coord.z); updateChunkPriorityMap(priorities, coord.pair(), (int) (25 - Math.sqrt(dist) * twoThirdModifier)); - }); + } } // Prioritize Frustum far 7 @@ -1168,7 +1168,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { } this.getVillagePlace().loadInData(chunkcoordintpair, chunkHolder.poiData); - chunkHolder.tasks.forEach(Runnable::run); + for (Runnable task : chunkHolder.tasks) { + task.run(); + } // Paper end if (chunkHolder.protoChunk != null) {try (Timing ignored2 = this.world.timings.chunkLoadLevelTimer.startTimingIfSync()) { // Paper start - timings // Paper - chunk is created async diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java.rej b/src/main/java/net/minecraft/server/PlayerChunkMap.java.rej deleted file mode 100644 index 759862aba781ec6f1ae0c9a76c4ab6352d603a4c..0000000000000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/PlayerChunkMap.java.rej +++ /dev/null @@ -1,84 +0,0 @@ -diff a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java (rejected hunks) -@@ -480,53 +471,53 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { - double playerChunkZ = MathHelper.floor(player.locZ()) >> 4; - pos.setValues(player.locX(), 0, player.locZ()); - double twoThirdModifier = 2D / 3D; -- MCUtil.getSpiralOutChunks(pos, Math.min(6, viewDistance)).forEach(coord -> { -- if (shouldSkipPrioritization(coord)) return; -+ for (ChunkCoordIntPair coordIntPair : MCUtil.getSpiralOutChunks(pos, Math.min(6, viewDistance))) { -+ if (shouldSkipPrioritization(coordIntPair)) continue; - -- double dist = MCUtil.distance(playerChunkX, 0, playerChunkZ, coord.x, 0, coord.z); -+ double dist = MCUtil.distance(playerChunkX, 0, playerChunkZ, coordIntPair.x, 0, coordIntPair.z); - // Prioritize immediate - if (dist <= 4 * 4) { -- updateChunkPriorityMap(priorities, coord.pair(), (int) (27 - Math.sqrt(dist))); -- return; -+ updateChunkPriorityMap(priorities, coordIntPair.pair(), (int) (27 - Math.sqrt(dist))); -+ continue; - } - - // Prioritize nearby chunks -- updateChunkPriorityMap(priorities, coord.pair(), (int) (20 - Math.sqrt(dist) * twoThirdModifier)); -- }); -+ updateChunkPriorityMap(priorities, coordIntPair.pair(), (int) (20 - Math.sqrt(dist) * twoThirdModifier)); -+ } - - // Prioritize Frustum near 3 - ChunkCoordIntPair front3 = player.getChunkInFront(3); - pos.setValues(front3.x << 4, 0, front3.z << 4); -- MCUtil.getSpiralOutChunks(pos, Math.min(5, viewDistance)).forEach(coord -> { -- if (shouldSkipPrioritization(coord)) return; -+ for (ChunkCoordIntPair chunkCoordIntPair : MCUtil.getSpiralOutChunks(pos, Math.min(5, viewDistance))) { -+ if (shouldSkipPrioritization(chunkCoordIntPair)) continue; - -- double dist = MCUtil.distance(playerChunkX, 0, playerChunkZ, coord.x, 0, coord.z); -- updateChunkPriorityMap(priorities, coord.pair(), (int) (25 - Math.sqrt(dist) * twoThirdModifier)); -- }); -+ double dist = MCUtil.distance(playerChunkX, 0, playerChunkZ, chunkCoordIntPair.x, 0, chunkCoordIntPair.z); -+ updateChunkPriorityMap(priorities, chunkCoordIntPair.pair(), (int) (25 - Math.sqrt(dist) * twoThirdModifier)); -+ } - - // Prioritize Frustum near 5 - if (viewDistance > 4) { - ChunkCoordIntPair front5 = player.getChunkInFront(5); - pos.setValues(front5.x << 4, 0, front5.z << 4); -- MCUtil.getSpiralOutChunks(pos, 4).forEach(coord -> { -- if (shouldSkipPrioritization(coord)) return; -+ for (ChunkCoordIntPair coord : MCUtil.getSpiralOutChunks(pos, 4)) { -+ if (shouldSkipPrioritization(coord)) continue; - - double dist = MCUtil.distance(playerChunkX, 0, playerChunkZ, coord.x, 0, coord.z); - updateChunkPriorityMap(priorities, coord.pair(), (int) (25 - Math.sqrt(dist) * twoThirdModifier)); -- }); -+ } - } - - // Prioritize Frustum far 7 - if (viewDistance > 6) { - ChunkCoordIntPair front7 = player.getChunkInFront(7); - pos.setValues(front7.x << 4, 0, front7.z << 4); -- MCUtil.getSpiralOutChunks(pos, 3).forEach(coord -> { -+ for (ChunkCoordIntPair coord : MCUtil.getSpiralOutChunks(pos, 3)) { - if (shouldSkipPrioritization(coord)) { -- return; -+ continue; - } - double dist = MCUtil.distance(playerChunkX, 0, playerChunkZ, coord.x, 0, coord.z); - updateChunkPriorityMap(priorities, coord.pair(), (int) (25 - Math.sqrt(dist) * twoThirdModifier)); -- }); -+ } - } - - pos.close(); -@@ -1122,7 +1131,9 @@ public class PlayerChunkMap extends IChunkLoader implements PlayerChunk.d { - if (ioThrowable != null) { - com.destroystokyo.paper.util.SneakyThrow.sneaky(ioThrowable); - } -- chunkHolder.tasks.forEach(Runnable::run); -+ for (Runnable task : chunkHolder.tasks) { -+ task.run(); -+ } - // Paper end - - if (chunkHolder.protoChunk != null) {try (Timing ignored2 = this.world.timings.chunkLoadLevelTimer.startTimingIfSync()) { // Paper start - timings // Paper - chunk is created async diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java index 6eb81504146af614a806add6e5effe0c2b111c8a..512afdfcbaab630a291d1aa120a90e554855d34f 100644 --- a/src/main/java/net/minecraft/server/StructureGenerator.java +++ b/src/main/java/net/minecraft/server/StructureGenerator.java @@ -139,6 +139,11 @@ public abstract class StructureGenerator int j2 = i1 + k * l1; ChunkCoordIntPair chunkcoordintpair = this.a(structuresettingsfeature, j, seededrandom, i2, j2); if (!iworldreader.getWorldBorder().isChunkInBounds(chunkcoordintpair.x, chunkcoordintpair.z)) { continue; } // Paper + // Origami start - seed based feature search doesn't load + if (iworldreader instanceof World && ((World) iworldreader).origamiConfig.fastFeatureSearchDontLoad) { + return chunkcoordintpair.l(); + } + // Origami end IChunkAccess ichunkaccess = iworldreader.getChunkAt(chunkcoordintpair.x, chunkcoordintpair.z, ChunkStatus.STRUCTURE_STARTS); StructureStart structurestart = structuremanager.a(SectionPosition.a(ichunkaccess.getPos(), 0), this, ichunkaccess); diff --git a/src/main/java/net/minecraft/server/StructureGenerator.java.rej b/src/main/java/net/minecraft/server/StructureGenerator.java.rej deleted file mode 100644 index 8b5d001fb8ecb4a5b96bda6532cf8d5900816290..0000000000000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/StructureGenerator.java.rej +++ /dev/null @@ -1,13 +0,0 @@ -diff a/src/main/java/net/minecraft/server/StructureGenerator.java b/src/main/java/net/minecraft/server/StructureGenerator.java (rejected hunks) -@@ -139,6 +139,11 @@ public abstract class StructureGenerator - int j2 = i1 + k * l1; - ChunkCoordIntPair chunkcoordintpair = this.a(structuresettingsfeature, j, seededrandom, i2, j2); - if (!iworldreader.getWorldBorder().isChunkInBounds(chunkcoordintpair.x, chunkcoordintpair.z)) { continue; } // Paper -+ // Origami start - seed based feature search doesn't load -+ if (iworldreader instanceof World && ((World) iworldreader).origamiConfig.fastFeatureSearchDontLoad) { -+ return chunkcoordintpair.l(); -+ } -+ // Origami end - // Origami start - option to only find generated features to not generate new chunks - IChunkAccess ichunkaccess = iworldreader.getChunkAt(chunkcoordintpair.x, chunkcoordintpair.z, ChunkStatus.STRUCTURE_STARTS, !(iworldreader instanceof World) || !((World) iworldreader).origamiConfig.onlyFindGeneratedFeatures); - if (ichunkaccess == null) { diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java index 2fbbc1588c2943c8998550db4da6642e666650d8..3ff61141aede4b5a09bf83153222de0d14db5ad0 100644 --- a/src/main/java/net/minecraft/server/TileEntityHopper.java +++ b/src/main/java/net/minecraft/server/TileEntityHopper.java @@ -508,6 +508,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi entityitem = (EntityItem) iterator.next(); } while (!a((IInventory) ihopper, entityitem)); + if (ihopper instanceof TileEntityHopper) ((TileEntityHopper) ihopper).shouldTick = true; // Origami - don't tick empty hoppers return true; } return false; // EMC diff --git a/src/main/java/net/minecraft/server/TileEntityHopper.java.rej b/src/main/java/net/minecraft/server/TileEntityHopper.java.rej deleted file mode 100644 index cc8866ec1ccbc131e8491c50eda4f85590bb667b..0000000000000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/TileEntityHopper.java.rej +++ /dev/null @@ -1,9 +0,0 @@ -diff a/src/main/java/net/minecraft/server/TileEntityHopper.java b/src/main/java/net/minecraft/server/TileEntityHopper.java (rejected hunks) -@@ -466,6 +497,7 @@ public class TileEntityHopper extends TileEntityLootable implements IHopper, ITi - entityitem = (EntityItem) iterator.next(); - } while (!a((IInventory) ihopper, entityitem)); - -+ if (ihopper instanceof TileEntityHopper) ((TileEntityHopper) ihopper).shouldTick = true; // Origami - don't tick empty hoppers - return true; - } - } diff --git a/src/main/java/net/minecraft/server/TileEntityShulkerBox.java b/src/main/java/net/minecraft/server/TileEntityShulkerBox.java index 7fe085e48b6ad625a510edf33b112bef24f7d7ad..9459efde54d507231b4aacb7cba14e9905ebb4d7 100644 --- a/src/main/java/net/minecraft/server/TileEntityShulkerBox.java +++ b/src/main/java/net/minecraft/server/TileEntityShulkerBox.java @@ -11,7 +11,18 @@ import org.bukkit.entity.HumanEntity; public class TileEntityShulkerBox extends TileEntityLootable implements IWorldInventory, ITickable { - private static final int[] a = IntStream.range(0, 27).toArray(); + private static final int[] a; + + static { + int[] arr = new int[10]; + int count = 0; + for (int i1 = 0; i1 < 27; i1++) { + if (arr.length == count) arr = Arrays.copyOf(arr, count * 2); + arr[count++] = i1; + } + arr = Arrays.copyOfRange(arr, 0, count); + a = arr; + } private NonNullList contents; public int c; // PAIL private -> public, rename viewerCount private TileEntityShulkerBox.AnimationPhase i; diff --git a/src/main/java/net/minecraft/server/TileEntityShulkerBox.java.rej b/src/main/java/net/minecraft/server/TileEntityShulkerBox.java.rej deleted file mode 100644 index bada470cba41cce9beb9eb04227b42c1d489d731..0000000000000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/TileEntityShulkerBox.java.rej +++ /dev/null @@ -1,22 +0,0 @@ -diff a/src/main/java/net/minecraft/server/TileEntityShulkerBox.java b/src/main/java/net/minecraft/server/TileEntityShulkerBox.java (rejected hunks) -@@ -10,7 +11,19 @@ import org.bukkit.entity.HumanEntity; - - public class TileEntityShulkerBox extends TileEntityLootable implements IWorldInventory, ITickable { - -- private static final int[] a = IntStream.range(0, 27).toArray(); -+ private static final int[] a; -+ -+ static { -+ int[] arr = new int[10]; -+ int count = 0; -+ for (int i1 = 0; i1 < 27; i1++) { -+ if (arr.length == count) arr = Arrays.copyOf(arr, count * 2); -+ arr[count++] = i1; -+ } -+ arr = Arrays.copyOfRange(arr, 0, count); -+ a = arr; -+ } -+ - private NonNullList contents; - private int c; - private TileEntityShulkerBox.AnimationPhase i; diff --git a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java index 0890bca50858ec8d544be2e1ff4ac2da73c7d830..44af511da96b265a8441052cc87e356e630699a6 100644 --- a/src/main/java/net/minecraft/server/World.java +++ b/src/main/java/net/minecraft/server/World.java @@ -97,6 +97,9 @@ public abstract class World implements GeneratorAccess, AutoCloseable { public final com.tuinity.tuinity.config.TuinityConfig.WorldConfig tuinityConfig; // Tuinity - Server Config public final app.akarin.server.Config.WorldConfig akarinConfig; // Akarin - Server Config + public final net.pl3x.purpur.PurpurWorldConfig purpurConfig; // Purpur + public final de.minebench.origami.OrigamiConfig.WorldConfig origamiConfig; // Origami - World Config + public final RainforestWorldConfig rainforestConfig; // Rainforest public final co.aikar.timings.WorldTimingsHandler timings; // Paper public static BlockPosition lastPhysicsProblem; // Spigot @@ -127,6 +130,11 @@ public abstract class World implements GeneratorAccess, AutoCloseable { this.chunkPacketBlockController = this.paperConfig.antiXray ? new ChunkPacketBlockControllerAntiXray(this.paperConfig, executor) : ChunkPacketBlockController.NO_OPERATION_INSTANCE; // Paper - Anti-Xray this.tuinityConfig = new com.tuinity.tuinity.config.TuinityConfig.WorldConfig(((WorldDataServer)worlddatamutable).getName()); // Tuinity - Server Config this.akarinConfig = new app.akarin.server.Config.WorldConfig(((WorldDataServer)worlddatamutable).getName()); // Akarin - Server Config + this.purpurConfig = new net.pl3x.purpur.PurpurWorldConfig((((WorldDataServer)worlddatamutable).getName())); // Purpur + this.origamiConfig = new de.minebench.origami.OrigamiConfig.WorldConfig(((WorldDataServer)worlddatamutable).getName()); // Origami - World Config + this.rainforestConfig = new RainforestWorldConfig((((WorldDataServer)worlddatamutable).getName()), this.paperConfig); // Rainforest + + this.generator = gen; this.world = new CraftWorld((WorldServer) this, gen, env); this.ticksPerAnimalSpawns = this.getServer().getTicksPerAnimalSpawns(); // CraftBukkit @@ -637,6 +645,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { public void b(BlockPosition blockposition, IBlockData iblockdata, IBlockData iblockdata1) {} + public void applyPhysics(BlockPosition blockposition, Block block) { if (captureBlockStates) { return; } // Paper - Cancel all physics during placement this.a(blockposition.west(), block, blockposition); @@ -674,6 +683,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { } + public void neighborChanged(BlockPosition pos, Block blockIn, BlockPosition fromPos) { a(pos, blockIn, fromPos); } // Paper - OBFHELPER public void a(BlockPosition blockposition, Block block, BlockPosition blockposition1) { if (!this.isClientSide) { IBlockData iblockdata = this.getTypeIfLoaded(blockposition); // EMC diff --git a/src/main/java/net/minecraft/server/World.java.rej b/src/main/java/net/minecraft/server/World.java.rej deleted file mode 100644 index c632cd030e36d8abfd92a14948e4893d885823ad..0000000000000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/World.java.rej +++ /dev/null @@ -1,9 +0,0 @@ -diff a/src/main/java/net/minecraft/server/World.java b/src/main/java/net/minecraft/server/World.java (rejected hunks) -@@ -646,6 +646,7 @@ public abstract class World implements GeneratorAccess, AutoCloseable { - - } - -+ public void neighborChanged(BlockPosition pos, Block blockIn, BlockPosition fromPos) { a(pos, blockIn, fromPos); } // Paper - OBFHELPER - public void a(BlockPosition blockposition, Block block, BlockPosition blockposition1) { - if (!this.isClientSide) { - IBlockData iblockdata = this.getType(blockposition); diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java index 64f7fc40a6847ebc6c84b3c179614e186f861e1f..3782d329dc62a9e834f16a9009f4102b5b4aad6f 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -943,7 +943,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { } // CraftBukkit end */ - gameprofilerfiller.enter("checkDespawn"); + //gameprofilerfiller.enter("checkDespawn"); // Akarin - remove caller if (!entity.dead) { entity.checkDespawn(); // Tuinity start - optimise notify() @@ -955,7 +955,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { // Tuinity end - optimise notify() } - gameprofilerfiller.exit(); + //gameprofilerfiller.exit(); // Akarin - remove caller if (entity1 != null) { if (!entity1.dead && entity1.w(entity)) { continue; @@ -964,13 +964,13 @@ public class WorldServer extends World implements GeneratorAccessSeed { entity.stopRiding(); } - gameprofilerfiller.enter("tick"); + //gameprofilerfiller.enter("tick"); // Akarin - remove caller if (!entity.dead && !(entity instanceof EntityComplexPart)) { this.a(this::entityJoinedWorld, entity); } - gameprofilerfiller.exit(); - gameprofilerfiller.enter("remove"); + //gameprofilerfiller.exit(); // Akarin - remove caller + //gameprofilerfiller.enter("remove"); // Akarin - remove caller if (entity.dead) { this.removeEntityFromChunk(entity); this.entitiesById.remove(entity.getId()); // Tuinity @@ -982,7 +982,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { } // Tuinity end - optimise notify() - gameprofilerfiller.exit(); + //gameprofilerfiller.exit(); // Akarin - remove caller } timings.entityTick.stopTiming(); // Spigot @@ -1414,7 +1414,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { // Tuinity end } - this.getMethodProfiler().exit(); + // this.getMethodProfiler().exit(); // Akarin - remove caller } } diff --git a/src/main/java/net/minecraft/server/WorldServer.java.rej b/src/main/java/net/minecraft/server/WorldServer.java.rej deleted file mode 100644 index 87367c60dd036f8623d6593e73dd2412a477f6a4..0000000000000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/WorldServer.java.rej +++ /dev/null @@ -1,50 +0,0 @@ -diff a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java (rejected hunks) -@@ -943,12 +943,12 @@ public class WorldServer extends World implements GeneratorAccessSeed { - } - // CraftBukkit end */ - -- gameprofilerfiller.enter("checkDespawn"); -+ //gameprofilerfiller.enter("checkDespawn"); // Akarin - remove caller - if (!entity.dead) { - entity.checkDespawn(); - } - -- gameprofilerfiller.exit(); -+ //gameprofilerfiller.exit(); // Akarin - remove caller - if (entity1 != null) { - if (!entity1.dead && entity1.w(entity)) { - continue; -@@ -957,20 +957,20 @@ public class WorldServer extends World implements GeneratorAccessSeed { - entity.stopRiding(); - } - -- gameprofilerfiller.enter("tick"); -+ //gameprofilerfiller.enter("tick"); // Akarin - remove caller - if (!entity.dead && !(entity instanceof EntityComplexPart)) { - this.a(this::entityJoinedWorld, entity); - } - -- gameprofilerfiller.exit(); -- gameprofilerfiller.enter("remove"); -+ //gameprofilerfiller.exit(); // Akarin - remove caller -+ //gameprofilerfiller.enter("remove"); // Akarin - remove caller - if (entity.dead) { - this.removeEntityFromChunk(entity); - this.entitiesById.remove(entity.getId()); // Tuinity - this.unregisterEntity(entity); - } - -- gameprofilerfiller.exit(); -+ //gameprofilerfiller.exit(); // Akarin - remove caller - } - timings.entityTick.stopTiming(); // Spigot - -@@ -1377,7 +1377,7 @@ public class WorldServer extends World implements GeneratorAccessSeed { - } - } - -- this.getMethodProfiler().exit(); -+ //this.getMethodProfiler().exit(); // Akarin - remove caller - } - } - diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java index 1d00832bffc2b6bcc6153b9065a92035ba974138..b3d6e713c2bfa1a0432b4afc3e8c31d4d7ca5844 100644 --- a/src/main/java/net/pl3x/purpur/PurpurConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurConfig.java @@ -127,4 +127,23 @@ public class PurpurConfig { config.addDefault(path, def); return config.getString(path, config.getString(path)); } + + public static double laggingThreshold = 19.0D; + private static void tickLoopSettings() { + laggingThreshold = getDouble("settings.lagging-threshold", laggingThreshold); + } + + public static boolean useAlternateKeepAlive = false; + private static void useAlternateKeepAlive() { + useAlternateKeepAlive = getBoolean("settings.use-alternate-keepalive", useAlternateKeepAlive); + } + public static boolean dontSendUselessEntityPackets = false; + private static void dontSendUselessEntityPackets() { + dontSendUselessEntityPackets = getBoolean("settings.dont-send-useless-entity-packets", dontSendUselessEntityPackets); + } + + public static boolean tpsCatchup = true; + private static void tpsCatchup() { + tpsCatchup = getBoolean("settings.tps-catchup", tpsCatchup); + } } diff --git a/src/main/java/net/pl3x/purpur/PurpurConfig.java.rej b/src/main/java/net/pl3x/purpur/PurpurConfig.java.rej deleted file mode 100644 index ff05ff6aef1e0f61eb4437253020632745ee2bd2..0000000000000000000000000000000000000000 --- a/src/main/java/net/pl3x/purpur/PurpurConfig.java.rej +++ /dev/null @@ -1,11 +0,0 @@ -diff a/src/main/java/net/pl3x/purpur/PurpurConfig.java b/src/main/java/net/pl3x/purpur/PurpurConfig.java (rejected hunks) -@@ -194,4 +194,9 @@ public class PurpurConfig { - loggerSuppressInitLegacyMaterialError = getBoolean("settings.logger.suppress-init-legacy-material-errors", loggerSuppressInitLegacyMaterialError); - loggerSuppressIgnoredAdvancementWarnings = getBoolean("settings.logger.suppress-ignored-advancement-warnings", loggerSuppressIgnoredAdvancementWarnings); - } -+ -+ public static boolean tpsCatchup = true; -+ private static void tpsCatchup() { -+ tpsCatchup = getBoolean("settings.tps-catchup", tpsCatchup); -+ } - } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java index 361f7857e461578e90cb71e15027dadaf794cb69..7cde55ae407012b3445f11b07a0ebc9d00e031e3 100644 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java +++ b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java @@ -56,4 +56,16 @@ public class PurpurWorldConfig { PurpurConfig.config.addDefault("world-settings.default." + path, def); return PurpurConfig.config.getString("world-settings." + worldName + "." + path, PurpurConfig.config.getString("world-settings.default." + path)); } + + public int villagerBrainTicks = 1; + public boolean villagerUseBrainTicksOnlyWhenLagging = true; + private void villagerSettings() { + villagerBrainTicks = getInt("mobs.villager.brain-ticks", villagerBrainTicks); + villagerUseBrainTicksOnlyWhenLagging = getBoolean("mobs.villager.use-brain-ticks-only-when-lagging", villagerUseBrainTicksOnlyWhenLagging); + } + + public boolean saveProjectilesToDisk = true; + private void miscGameplayMechanicsSettings() { + saveProjectilesToDisk = getBoolean("gameplay-mechanics.save-projectiles-to-disk", saveProjectilesToDisk); + } } diff --git a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java.rej b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java.rej deleted file mode 100644 index 120d0df27e76c9beef9f09e6cdc0972454fdd4ca..0000000000000000000000000000000000000000 --- a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java.rej +++ /dev/null @@ -1,15 +0,0 @@ -diff a/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java b/src/main/java/net/pl3x/purpur/PurpurWorldConfig.java (rejected hunks) -@@ -113,11 +113,13 @@ public class PurpurWorldConfig { - public boolean disableDropsOnCrammingDeath = false; - public boolean entitiesPickUpLootBypassMobGriefing = false; - public boolean milkCuresBadOmen = true; -+ public boolean saveProjectilesToDisk = true; - public double tridentLoyaltyVoidReturnHeight = 0.0D; - private void miscGameplayMechanicsSettings() { - disableDropsOnCrammingDeath = getBoolean("gameplay-mechanics.disable-drops-on-cramming-death", disableDropsOnCrammingDeath); - entitiesPickUpLootBypassMobGriefing = getBoolean("gameplay-mechanics.entities-pick-up-loot-bypass-mob-griefing", entitiesPickUpLootBypassMobGriefing); - milkCuresBadOmen = getBoolean("gameplay-mechanics.milk-cures-bad-omen", milkCuresBadOmen); -+ saveProjectilesToDisk = getBoolean("gameplay-mechanics.save-projectiles-to-disk", saveProjectilesToDisk); - tridentLoyaltyVoidReturnHeight = getDouble("gameplay-mechanics.trident-loyalty-void-return-height", tridentLoyaltyVoidReturnHeight); - } - diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index afaa6ab4744190b134aeb616a1355cefd1333e37..4153c9f6ab5876e96b745f9270ed1003dcfa2950 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -836,6 +836,9 @@ public final class CraftServer implements Server { com.destroystokyo.paper.PaperConfig.init((File) console.options.valueOf("paper-settings")); // Paper com.tuinity.tuinity.config.TuinityConfig.init((File) console.options.valueOf("tuinity-settings")); // Tuinity - Server Config app.akarin.server.Config.init((File) console.options.valueOf("akarin-settings")); // Akarin - Server Config + net.pl3x.purpur.PurpurConfig.init((File) console.options.valueOf("purpur-settings")); // Purpur + de.minebench.origami.OrigamiConfig.init((File) console.options.valueOf("origami-settings")); // Origami - Server Config + com.proximyst.rainforest.RainforestConfig.init((File) console.options.valueOf("rainforest-settings")); // Rainforest for (WorldServer world : console.getWorlds()) { world.worldDataServer.setDifficulty(config.difficulty); world.setSpawnFlags(config.spawnMonsters, config.spawnAnimals); @@ -872,6 +875,9 @@ public final class CraftServer implements Server { world.paperConfig.init(); // Paper world.tuinityConfig.init(); // Tuinity - Server Config world.akarinConfig.init(); // Akarin - Server Config + world.rainforestConfig.init(); // Rainforest + world.purpurConfig.init(); // Purpur + world.origamiConfig.init(); // Origami - World Config } Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper @@ -2249,6 +2255,25 @@ public final class CraftServer implements Server { } // Akarin End - Server Config + // Rainforest start + @Override + public YamlConfiguration getRainforestConfig() { + return com.proximyst.rainforest.RainforestConfig.config; + } + // Rainforest end + + // Purpur start + @Override + public YamlConfiguration getPurpurConfig() { + return net.pl3x.purpur.PurpurConfig.config; + } + /*@Override + public java.util.Properties getServerProperties() { + return getProperties().properties; + }*/ + // Purpur end + + @Override public void restart() { org.spigotmc.RestartCommand.restart(); @@ -2388,4 +2413,11 @@ public final class CraftServer implements Server { return mobGoals; } // Paper end + + // Purpur start + @Override + public boolean isLagging() { + return getServer().lagging; + } + // Purpur end } diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java.rej b/src/main/java/org/bukkit/craftbukkit/CraftServer.java.rej deleted file mode 100644 index a3c8dfd94f78b49341e5f5aba1735651096c9d70..0000000000000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java.rej +++ /dev/null @@ -1,31 +0,0 @@ -diff a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java (rejected hunks) -@@ -848,6 +848,7 @@ public final class CraftServer implements Server { - - org.spigotmc.SpigotConfig.init((File) console.options.valueOf("spigot-settings")); // Spigot - com.destroystokyo.paper.PaperConfig.init((File) console.options.valueOf("paper-settings")); // Paper -+ com.proximyst.rainforest.RainforestConfig.init((File) console.options.valueOf("rainforest-settings")); // Rainforest - for (WorldServer world : console.getWorlds()) { - world.worldDataServer.setDifficulty(config.difficulty); - world.setSpawnFlags(config.spawnMonsters, config.spawnAnimals); -@@ -882,6 +883,7 @@ public final class CraftServer implements Server { - } - world.spigotConfig.init(); // Spigot - world.paperConfig.init(); // Paper -+ world.rainforestConfig.init(); // Rainforest - } - - Plugin[] pluginClone = pluginManager.getPlugins().clone(); // Paper -@@ -2238,6 +2240,13 @@ public final class CraftServer implements Server { - return com.destroystokyo.paper.PaperConfig.config; - } - -+ // Rainforest start -+ @Override -+ public YamlConfiguration getRainforestConfig() { -+ return com.proximyst.rainforest.RainforestConfig.config; -+ } -+ // Rainforest end -+ - @Override - public void restart() { - org.spigotmc.RestartCommand.restart(); diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java index 2d12ad72be927712d38d6fb6991f4af7a196fb9b..1a454f74b322605b1006da5be13760b13cc5f931 100644 --- a/src/main/java/org/bukkit/craftbukkit/Main.java +++ b/src/main/java/org/bukkit/craftbukkit/Main.java @@ -138,6 +138,7 @@ public class Main { .defaultsTo(new File("paper.yml")) .describedAs("Yml file"); // Paper end + // Tuinity Start - Server Config acceptsAll(asList("tuinity", "tuinity-settings"), "File for tuinity settings") .withRequiredArg() @@ -154,6 +155,22 @@ public class Main { .describedAs("Yml file"); // Akarin End - Server Config + // Origami Start - Server Config + acceptsAll(asList("origami", "origami-settings"), "File for origami settings") + .withRequiredArg() + .ofType(File.class) + .defaultsTo(new File("origami.yml")) + .describedAs("Yml file"); + // Origami end - Server Config + + // Purpur Start + acceptsAll(asList("purpur", "purpur-settings"), "File for purpur settings") + .withRequiredArg() + .ofType(File.class) + .defaultsTo(new File("purpur.yml")) + .describedAs("Yml file"); + // Purpur end + // Paper start acceptsAll(asList("server-name"), "Name of the server") .withRequiredArg() diff --git a/src/main/java/org/bukkit/craftbukkit/Main.java.rej b/src/main/java/org/bukkit/craftbukkit/Main.java.rej deleted file mode 100644 index 916603085d652444027e4513b77293ece84a6c4f..0000000000000000000000000000000000000000 --- a/src/main/java/org/bukkit/craftbukkit/Main.java.rej +++ /dev/null @@ -1,16 +0,0 @@ -diff a/src/main/java/org/bukkit/craftbukkit/Main.java b/src/main/java/org/bukkit/craftbukkit/Main.java (rejected hunks) -@@ -139,6 +139,14 @@ public class Main { - .describedAs("Yml file"); - // Paper end - -+ // Rainforest start -+ acceptsAll(asList("rainforest", "rainforest-settings"), "File for rainforest settings") -+ .withRequiredArg() -+ .ofType(File.class) -+ .defaultsTo(new File("rainforest.yml")) -+ .describedAs("Yml file"); -+ // Rainforest end -+ - // Paper start - acceptsAll(asList("server-name"), "Name of the server") - .withRequiredArg()