diff --git a/paper-server/nms-patches/TicketType.patch b/paper-server/nms-patches/TicketType.patch index e1d53f13a3..dd2a2a4b35 100644 --- a/paper-server/nms-patches/TicketType.patch +++ b/paper-server/nms-patches/TicketType.patch @@ -1,5 +1,14 @@ --- a/net/minecraft/server/TicketType.java +++ b/net/minecraft/server/TicketType.java +@@ -6,7 +6,7 @@ + + private final String i; + private final Comparator j; +- private final long k; ++ private long k; // PAIL + public static final TicketType START = a("start", (unit, unit1) -> { + return 0; + }); @@ -19,6 +19,7 @@ public static final TicketType PORTAL = a("portal", Comparator.comparingLong(BlockPosition2D::b)); public static final TicketType POST_TELEPORT = a("post_teleport", Integer::compareTo, 5); @@ -8,3 +17,14 @@ public static TicketType a(String s, Comparator comparator) { return new TicketType<>(s, comparator, 0L); +@@ -45,4 +46,10 @@ + public long b() { + return this.k; + } ++ ++ // CraftBukkit start ++ public void setLoadPeriod(int ticks) { ++ this.k = ticks; ++ } ++ // CraftBukkit end + } diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java index faeb4bc468..14aa8ad550 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -49,7 +49,6 @@ import net.minecraft.server.BlockPosition; import net.minecraft.server.BossBattleCustom; import net.minecraft.server.CommandDispatcher; import net.minecraft.server.CommandListenerWrapper; -import net.minecraft.server.CraftingManager; import net.minecraft.server.DedicatedPlayerList; import net.minecraft.server.DedicatedServer; import net.minecraft.server.DedicatedServerProperties; @@ -70,6 +69,7 @@ import net.minecraft.server.MobEffects; import net.minecraft.server.PlayerList; import net.minecraft.server.ServerCommand; import net.minecraft.server.TagsServer; +import net.minecraft.server.TicketType; import net.minecraft.server.Vec3D; import net.minecraft.server.WorldData; import net.minecraft.server.WorldMap; @@ -306,6 +306,7 @@ public final class CraftServer implements Server { ambientSpawn = configuration.getInt("spawn-limits.ambient"); console.autosavePeriod = configuration.getInt("ticks-per.autosave"); warningState = WarningState.value(configuration.getString("settings.deprecated-verbose")); + TicketType.PLUGIN.setLoadPeriod(configuration.getInt("chunk-gc.period-in-ticks")); minimumAPI = configuration.getString("settings.minimum-api"); loadIcon(); } @@ -716,6 +717,7 @@ public final class CraftServer implements Server { waterAnimalSpawn = configuration.getInt("spawn-limits.water-animals"); ambientSpawn = configuration.getInt("spawn-limits.ambient"); warningState = WarningState.value(configuration.getString("settings.deprecated-verbose")); + TicketType.PLUGIN.setLoadPeriod(configuration.getInt("chunk-gc.period-in-ticks")); minimumAPI = configuration.getString("settings.minimum-api"); printSaveWarning = false; console.autosavePeriod = configuration.getInt("ticks-per.autosave"); diff --git a/paper-server/src/main/resources/configurations/bukkit.yml b/paper-server/src/main/resources/configurations/bukkit.yml index 43502ae9a3..39dbf58ceb 100644 --- a/paper-server/src/main/resources/configurations/bukkit.yml +++ b/paper-server/src/main/resources/configurations/bukkit.yml @@ -28,6 +28,8 @@ spawn-limits: animals: 10 water-animals: 15 ambient: 15 +chunk-gc: + period-in-ticks: 600 ticks-per: animal-spawns: 400 monster-spawns: 1