From 1db0b7ed585897a2ce66b43fc2d8a6f0b7c0ab8c Mon Sep 17 00:00:00 2001 From: Aikar Date: Sat, 21 Jul 2018 17:24:18 -0400 Subject: [PATCH] Readd configurable max chunk gens per tick --- ...ups-for-Entity-TileEntity-Current-Ch.patch | 2 +- ...Configurable-Max-Chunk-Gens-per-Tick.patch | 109 ++++++++++++++++++ ...urable-sprint-interruption-on-attack.patch | 7 +- ...ent-consumeArrow-and-getArrowItem-AP.patch | 6 +- ...ld.spawnParticle-API-and-add-Builder.patch | 2 +- .../Extend-Player-Interact-cancellation.patch | 2 +- ...e-EntityShootBowEvent-for-Illusioner.patch | 2 +- ...leHitEvent-to-include-the-BlockFace-.patch | 2 +- .../InventoryCloseEvent-Reason-API.patch | 16 +-- ...Load-version-history-at-server-start.patch | 2 +- ...-max-squid-spawn-height-configurable.patch | 16 +-- .../Player.setPlayerProfile-API.patch | 2 +- ...nilla-entity-warnings-for-duplicates.patch | 2 +- ...r-crits-helps-mitigate-hacked-client.patch | 4 +- .../WitchConsumePotionEvent.patch | 2 +- .../WitchReadyPotionEvent.patch | 2 +- .../WitchThrowPotionEvent.patch | 2 +- .../getPlayerUniqueId-API.patch | 2 +- scripts/importmcdev.sh | 10 +- 19 files changed, 148 insertions(+), 44 deletions(-) create mode 100644 Spigot-Server-Patches/Configurable-Max-Chunk-Gens-per-Tick.patch diff --git a/Spigot-Server-Patches/Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch b/Spigot-Server-Patches/Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch index fe9361e162..ed730d0769 100644 --- a/Spigot-Server-Patches/Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch +++ b/Spigot-Server-Patches/Avoid-Chunk-Lookups-for-Entity-TileEntity-Current-Ch.patch @@ -10,7 +10,7 @@ to the object directly on the Entity/TileEntity object we can directly grab. Use that local value instead to reduce lookups in many hot places. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index 2612d4207..b3cdc0b7d 100644 +index 9e798038b..03afa1236 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { diff --git a/Spigot-Server-Patches/Configurable-Max-Chunk-Gens-per-Tick.patch b/Spigot-Server-Patches/Configurable-Max-Chunk-Gens-per-Tick.patch new file mode 100644 index 0000000000..ee7257fe4f --- /dev/null +++ b/Spigot-Server-Patches/Configurable-Max-Chunk-Gens-per-Tick.patch @@ -0,0 +1,109 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Aikar +Date: Mon, 1 Jan 2018 16:10:24 -0500 +Subject: [PATCH] Configurable Max Chunk Gens per Tick + +Limit the number of generations that can occur in a single tick, forcing them +to be spread out more. + +Defaulting to 10 as an average generation is going to be 3-6ms, which means 10 will +likely cause the server to lose TPS, but constrain how much. + +This should result in no noticeable speed reduction in generation for servers not +lagging, and let larger servers reduce this value according to their own desires. + +diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +index 703642c0b..faa7597b3 100644 +--- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java ++++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +@@ -0,0 +0,0 @@ public class PaperWorldConfig { + } + log("Max Chunk Sends Per Tick: " + maxChunkSendsPerTick); + } ++ ++ public int maxChunkGensPerTick = 10; ++ private void maxChunkGensPerTick() { ++ maxChunkGensPerTick = getInt("max-chunk-gens-per-tick", maxChunkGensPerTick); ++ if (maxChunkGensPerTick <= 0) { ++ maxChunkGensPerTick = Integer.MAX_VALUE; ++ log("Max Chunk Gens Per Tick: Unlimited (NOT RECOMMENDED)"); ++ } else { ++ log("Max Chunk Gens Per Tick: " + maxChunkGensPerTick); ++ } ++ } + } +diff --git a/src/main/java/net/minecraft/server/PlayerChunk.java b/src/main/java/net/minecraft/server/PlayerChunk.java +index 344b95233..fcd9f5491 100644 +--- a/src/main/java/net/minecraft/server/PlayerChunk.java ++++ b/src/main/java/net/minecraft/server/PlayerChunk.java +@@ -0,0 +0,0 @@ public class PlayerChunk { + // CraftBukkit start - add fields + // You know the drill, https://hub.spigotmc.org/stash/projects/SPIGOT/repos/craftbukkit/browse + // All may seem good at first, but there's deeper issues if you play for a bit ++ boolean chunkExists; // Paper + private boolean loadInProgress = false; + private Runnable loadedRunnable = new Runnable() { + public void run() { +@@ -0,0 +0,0 @@ public class PlayerChunk { + this.playerChunkMap = playerchunkmap; + this.location = new ChunkCoordIntPair(i, j); + this.chunk = playerchunkmap.getWorld().getChunkProviderServer().getOrLoadChunkAt(i, j); ++ this.chunkExists = this.chunk != null || ChunkIOExecutor.hasQueuedChunkLoad(playerChunkMap.getWorld(), i, j); // Paper + markChunkUsed(); // Paper - delay chunk unloads + } + +diff --git a/src/main/java/net/minecraft/server/PlayerChunkMap.java b/src/main/java/net/minecraft/server/PlayerChunkMap.java +index 9fd07f859..e29aaab2d 100644 +--- a/src/main/java/net/minecraft/server/PlayerChunkMap.java ++++ b/src/main/java/net/minecraft/server/PlayerChunkMap.java +@@ -0,0 +0,0 @@ public class PlayerChunkMap { + // Spigot start + org.spigotmc.SlackActivityAccountant activityAccountant = this.world.getMinecraftServer().slackActivityAccountant; + activityAccountant.startActivity(0.5); ++ int chunkGensAllowed = world.paperConfig.maxChunkGensPerTick; // Paper + // Spigot end + + Iterator iterator1 = this.h.iterator(); +@@ -0,0 +0,0 @@ public class PlayerChunkMap { + + if (playerchunk1.f() == null) { + boolean flag = playerchunk1.a(PlayerChunkMap.b); ++ // Paper start ++ if (flag && !playerchunk1.chunkExists && chunkGensAllowed-- <= 0) { ++ continue; ++ } ++ // Paper end + + if (playerchunk1.a(flag)) { + iterator1.remove(); +diff --git a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOExecutor.java b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOExecutor.java +index 9aaca21a7..f50d55c8e 100644 +--- a/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOExecutor.java ++++ b/src/main/java/org/bukkit/craftbukkit/chunkio/ChunkIOExecutor.java +@@ -0,0 +0,0 @@ public class ChunkIOExecutor { + public static void tick() { + instance.finishActive(); + } ++ ++ // Paper start ++ public static boolean hasQueuedChunkLoad(World world, int x, int z) { ++ return instance.hasTask(new QueuedChunk(x, z, null, world, null)); ++ } ++ // Paper end + } +diff --git a/src/main/java/org/bukkit/craftbukkit/util/AsynchronousExecutor.java b/src/main/java/org/bukkit/craftbukkit/util/AsynchronousExecutor.java +index 193c3621c..cf1258c55 100644 +--- a/src/main/java/org/bukkit/craftbukkit/util/AsynchronousExecutor.java ++++ b/src/main/java/org/bukkit/craftbukkit/util/AsynchronousExecutor.java +@@ -0,0 +0,0 @@ public final class AsynchronousExecutor { + public void setActiveThreads(final int coreSize) { + pool.setCorePoolSize(coreSize); + } ++ ++ // Paper start ++ public boolean hasTask(P parameter) throws IllegalStateException { ++ return tasks.get(parameter) != null; ++ } ++ // Paper end + } +-- \ No newline at end of file diff --git a/Spigot-Server-Patches/Configurable-sprint-interruption-on-attack.patch b/Spigot-Server-Patches/Configurable-sprint-interruption-on-attack.patch index 6b8d2308c5..800e85977d 100644 --- a/Spigot-Server-Patches/Configurable-sprint-interruption-on-attack.patch +++ b/Spigot-Server-Patches/Configurable-sprint-interruption-on-attack.patch @@ -6,20 +6,21 @@ Subject: [PATCH] Configurable sprint interruption on attack If the sprint interruption is disabled players continue sprinting when they attack entities. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 4ca31c8eb..b07ff9587 100644 +index 79df2c171..b07ff9587 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -0,0 +0,0 @@ public class PaperWorldConfig { + private void squidMaxSpawnHeight() { squidMaxSpawnHeight = getDouble("squid-spawn-height.maximum", 0.0D); } - ++ + public boolean disableSprintInterruptionOnAttack; + private void disableSprintInterruptionOnAttack() { + disableSprintInterruptionOnAttack = getBoolean("game-mechanics.disable-sprint-interruption-on-attack", false); + } } diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 65f4ea6cc..a766a1467 100644 +index de1b6ac86..4aba5716c 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving { diff --git a/Spigot-Server-Patches/EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch b/Spigot-Server-Patches/EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch index 03210a4af8..84cf61ed74 100644 --- a/Spigot-Server-Patches/EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch +++ b/Spigot-Server-Patches/EntityShootBowEvent-consumeArrow-and-getArrowItem-AP.patch @@ -6,7 +6,7 @@ Subject: [PATCH] EntityShootBowEvent consumeArrow and getArrowItem API Adds ability to get what arrow was shot, and control if it should be consumed. diff --git a/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java b/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java -index c2bc8060ac..1ae967d1c0 100644 +index c2bc8060a..1ae967d1c 100644 --- a/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java +++ b/src/main/java/net/minecraft/server/EntitySkeletonAbstract.java @@ -0,0 +0,0 @@ public abstract class EntitySkeletonAbstract extends EntityMonster implements IR @@ -19,7 +19,7 @@ index c2bc8060ac..1ae967d1c0 100644 event.getProjectile().remove(); return; diff --git a/src/main/java/net/minecraft/server/ItemBow.java b/src/main/java/net/minecraft/server/ItemBow.java -index 4aa3b6249f..c8fc180458 100644 +index 4aa3b6249..c8fc18045 100644 --- a/src/main/java/net/minecraft/server/ItemBow.java +++ b/src/main/java/net/minecraft/server/ItemBow.java @@ -0,0 +0,0 @@ public class ItemBow extends Item { @@ -58,7 +58,7 @@ index 4aa3b6249f..c8fc180458 100644 if (itemstack1.isEmpty()) { entityhuman.inventory.f(itemstack1); diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 8df07536f8..28b156e439 100644 +index 8df07536f..28b156e43 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -0,0 +0,0 @@ public class CraftEventFactory { diff --git a/Spigot-Server-Patches/Expand-World.spawnParticle-API-and-add-Builder.patch b/Spigot-Server-Patches/Expand-World.spawnParticle-API-and-add-Builder.patch index b8b1748805..8c3b992efe 100644 --- a/Spigot-Server-Patches/Expand-World.spawnParticle-API-and-add-Builder.patch +++ b/Spigot-Server-Patches/Expand-World.spawnParticle-API-and-add-Builder.patch @@ -9,7 +9,7 @@ the standard API is to send the packet to everyone in the world, which is ineffe This adds a new Builder API which is much friendlier to use. diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index c5da2cde3..4ac2d39c5 100644 +index 23414c776..9e3804579 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { diff --git a/Spigot-Server-Patches/Extend-Player-Interact-cancellation.patch b/Spigot-Server-Patches/Extend-Player-Interact-cancellation.patch index 616fe9715f..8060394e2a 100644 --- a/Spigot-Server-Patches/Extend-Player-Interact-cancellation.patch +++ b/Spigot-Server-Patches/Extend-Player-Interact-cancellation.patch @@ -13,7 +13,7 @@ Update adjacent blocks of doors, double plants, pistons and beds when cancelling interaction. diff --git a/src/main/java/net/minecraft/server/PlayerInteractManager.java b/src/main/java/net/minecraft/server/PlayerInteractManager.java -index e34198e4..e375e255 100644 +index e34198e40..e375e2556 100644 --- a/src/main/java/net/minecraft/server/PlayerInteractManager.java +++ b/src/main/java/net/minecraft/server/PlayerInteractManager.java @@ -0,0 +0,0 @@ public class PlayerInteractManager { diff --git a/Spigot-Server-Patches/Fire-EntityShootBowEvent-for-Illusioner.patch b/Spigot-Server-Patches/Fire-EntityShootBowEvent-for-Illusioner.patch index c357141d8d..048c623f7d 100644 --- a/Spigot-Server-Patches/Fire-EntityShootBowEvent-for-Illusioner.patch +++ b/Spigot-Server-Patches/Fire-EntityShootBowEvent-for-Illusioner.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Fire EntityShootBowEvent for Illusioner diff --git a/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java b/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java -index d03fa6318..16c3be42e 100644 +index d64664c4d..4832fdd02 100644 --- a/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java +++ b/src/main/java/net/minecraft/server/EntityIllagerIllusioner.java @@ -0,0 +0,0 @@ public class EntityIllagerIllusioner extends EntityIllagerWizard implements IRan diff --git a/Spigot-Server-Patches/Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch b/Spigot-Server-Patches/Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch index a86ff89218..275663c7b8 100644 --- a/Spigot-Server-Patches/Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch +++ b/Spigot-Server-Patches/Improve-ProjectileHitEvent-to-include-the-BlockFace-.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Improve ProjectileHitEvent to include the BlockFace where the diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 28b156e439..8ac599b7a2 100644 +index 28b156e43..8ac599b7a 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -0,0 +0,0 @@ public class CraftEventFactory { diff --git a/Spigot-Server-Patches/InventoryCloseEvent-Reason-API.patch b/Spigot-Server-Patches/InventoryCloseEvent-Reason-API.patch index d735f0b8f6..304b07350b 100644 --- a/Spigot-Server-Patches/InventoryCloseEvent-Reason-API.patch +++ b/Spigot-Server-Patches/InventoryCloseEvent-Reason-API.patch @@ -7,7 +7,7 @@ Allows you to determine why an inventory was closed, enabling plugin developers to "confirm" things based on if it was player triggered close or not. diff --git a/src/main/java/net/minecraft/server/Chunk.java b/src/main/java/net/minecraft/server/Chunk.java -index f31524eb02..2612d4207f 100644 +index ac90ca802..9e798038b 100644 --- a/src/main/java/net/minecraft/server/Chunk.java +++ b/src/main/java/net/minecraft/server/Chunk.java @@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess { @@ -29,7 +29,7 @@ index f31524eb02..2612d4207f 100644 } } diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 4aba5716ce..d84bb0e40c 100644 +index 4aba5716c..d84bb0e40 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving { @@ -56,7 +56,7 @@ index 4aba5716ce..d84bb0e40c 100644 this.activeContainer = this.defaultContainer; } diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java -index 5db6e07640..99c638857b 100644 +index 5db6e0764..99c638857 100644 --- a/src/main/java/net/minecraft/server/EntityPlayer.java +++ b/src/main/java/net/minecraft/server/EntityPlayer.java @@ -0,0 +0,0 @@ public class EntityPlayer extends EntityHuman implements ICrafting { @@ -110,7 +110,7 @@ index 5db6e07640..99c638857b 100644 this.m(); } diff --git a/src/main/java/net/minecraft/server/PlayerConnection.java b/src/main/java/net/minecraft/server/PlayerConnection.java -index 067f7b9908..97b315bca0 100644 +index 067f7b990..97b315bca 100644 --- a/src/main/java/net/minecraft/server/PlayerConnection.java +++ b/src/main/java/net/minecraft/server/PlayerConnection.java @@ -0,0 +0,0 @@ public class PlayerConnection implements PacketListenerPlayIn, ITickable { @@ -123,7 +123,7 @@ index 067f7b9908..97b315bca0 100644 this.player.m(); } diff --git a/src/main/java/net/minecraft/server/PlayerList.java b/src/main/java/net/minecraft/server/PlayerList.java -index 879780c5b1..907f0232bf 100644 +index 879780c5b..907f0232b 100644 --- a/src/main/java/net/minecraft/server/PlayerList.java +++ b/src/main/java/net/minecraft/server/PlayerList.java @@ -0,0 +0,0 @@ public abstract class PlayerList { @@ -136,7 +136,7 @@ index 879780c5b1..907f0232bf 100644 PlayerQuitEvent playerQuitEvent = new PlayerQuitEvent(cserver.getPlayer(entityplayer), "\u00A7e" + entityplayer.getName() + " left the game"); cserver.getPluginManager().callEvent(playerQuitEvent); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java -index 4b9ecb4a62..b602a5d1b9 100644 +index 4b9ecb4a6..b602a5d1b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java @@ -0,0 +0,0 @@ public class CraftHumanEntity extends CraftLivingEntity implements HumanEntity { @@ -155,7 +155,7 @@ index 4b9ecb4a62..b602a5d1b9 100644 public boolean isBlocking() { return getHandle().isBlocking(); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java -index 60bc6d3316..b25980027b 100644 +index 60bc6d331..b25980027 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -0,0 +0,0 @@ public class CraftPlayer extends CraftHumanEntity implements Player { @@ -168,7 +168,7 @@ index 60bc6d3316..b25980027b 100644 // Check if the fromWorld and toWorld are the same. diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java -index 8ac599b7a2..cf398cd250 100644 +index 8ac599b7a..cf398cd25 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -0,0 +0,0 @@ public class CraftEventFactory { diff --git a/Spigot-Server-Patches/Load-version-history-at-server-start.patch b/Spigot-Server-Patches/Load-version-history-at-server-start.patch index f820f1b51b..4d46d091e0 100644 --- a/Spigot-Server-Patches/Load-version-history-at-server-start.patch +++ b/Spigot-Server-Patches/Load-version-history-at-server-start.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Load version history at server start diff --git a/src/main/java/net/minecraft/server/DedicatedServer.java b/src/main/java/net/minecraft/server/DedicatedServer.java -index 927cbeedcd..ae7a8c1046 100644 +index 927cbeedc..ae7a8c104 100644 --- a/src/main/java/net/minecraft/server/DedicatedServer.java +++ b/src/main/java/net/minecraft/server/DedicatedServer.java @@ -0,0 +0,0 @@ public class DedicatedServer extends MinecraftServer implements IMinecraftServer diff --git a/Spigot-Server-Patches/Make-max-squid-spawn-height-configurable.patch b/Spigot-Server-Patches/Make-max-squid-spawn-height-configurable.patch index 509430070a..dd2735e716 100644 --- a/Spigot-Server-Patches/Make-max-squid-spawn-height-configurable.patch +++ b/Spigot-Server-Patches/Make-max-squid-spawn-height-configurable.patch @@ -7,30 +7,18 @@ I don't know why upstream made only the minimum height configurable but whatever diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index 703642c0b..a33c55f41 100644 +index faa7597b3..fddd52caf 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -0,0 +0,0 @@ public class PaperWorldConfig { + log("Max Chunk Gens Per Tick: " + maxChunkGensPerTick); } - log("Max Chunk Sends Per Tick: " + maxChunkSendsPerTick); } + -+ public int maxChunkGensPerTick = 10; -+ private void maxChunkGensPerTick() { -+ maxChunkGensPerTick = getInt("max-chunk-gens-per-tick", maxChunkGensPerTick); -+ if (maxChunkGensPerTick <= 0) { -+ maxChunkGensPerTick = Integer.MAX_VALUE; -+ log("Max Chunk Gens Per Tick: Unlimited (NOT RECOMMENDED)"); -+ } else { -+ log("Max Chunk Gens Per Tick: " + maxChunkGensPerTick); -+ } -+ } -+ + public double squidMaxSpawnHeight; + private void squidMaxSpawnHeight() { + squidMaxSpawnHeight = getDouble("squid-spawn-height.maximum", 0.0D); + } -+ } diff --git a/src/main/java/net/minecraft/server/EntitySquid.java b/src/main/java/net/minecraft/server/EntitySquid.java index ffc6d0b68..70b251210 100644 diff --git a/Spigot-Server-Patches/Player.setPlayerProfile-API.patch b/Spigot-Server-Patches/Player.setPlayerProfile-API.patch index 898e3fff04..c4effa329f 100644 --- a/Spigot-Server-Patches/Player.setPlayerProfile-API.patch +++ b/Spigot-Server-Patches/Player.setPlayerProfile-API.patch @@ -6,7 +6,7 @@ Subject: [PATCH] Player.setPlayerProfile API This can be useful for changing name or skins after a player has logged in. diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index 4fb300468..65f4ea6cc 100644 +index 98fdfcb60..de1b6ac86 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving { diff --git a/Spigot-Server-Patches/Re-add-vanilla-entity-warnings-for-duplicates.patch b/Spigot-Server-Patches/Re-add-vanilla-entity-warnings-for-duplicates.patch index 18e0458eec..8c7fe5080f 100644 --- a/Spigot-Server-Patches/Re-add-vanilla-entity-warnings-for-duplicates.patch +++ b/Spigot-Server-Patches/Re-add-vanilla-entity-warnings-for-duplicates.patch @@ -8,7 +8,7 @@ These are a critical sign that somethin went wrong, and you've lost some data... We should kind of know about these things you know. diff --git a/src/main/java/net/minecraft/server/WorldServer.java b/src/main/java/net/minecraft/server/WorldServer.java -index d6d3ffa6f..2c5004e61 100644 +index 44d867663..fcb5f68f8 100644 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -0,0 +0,0 @@ public class WorldServer extends World implements IAsyncTaskHandler { diff --git a/Spigot-Server-Patches/Toggleable-player-crits-helps-mitigate-hacked-client.patch b/Spigot-Server-Patches/Toggleable-player-crits-helps-mitigate-hacked-client.patch index d46e251314..43cf743b7d 100644 --- a/Spigot-Server-Patches/Toggleable-player-crits-helps-mitigate-hacked-client.patch +++ b/Spigot-Server-Patches/Toggleable-player-crits-helps-mitigate-hacked-client.patch @@ -5,7 +5,7 @@ Subject: [PATCH] Toggleable player crits, helps mitigate hacked clients. diff --git a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java -index a33c55f41..4ca31c8eb 100644 +index fddd52caf..79df2c171 100644 --- a/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java +++ b/src/main/java/com/destroystokyo/paper/PaperWorldConfig.java @@ -0,0 +0,0 @@ public class PaperWorldConfig { @@ -21,7 +21,7 @@ index a33c55f41..4ca31c8eb 100644 private void allChunksAreSlimeChunks() { allChunksAreSlimeChunks = getBoolean("all-chunks-are-slime-chunks", false); diff --git a/src/main/java/net/minecraft/server/EntityHuman.java b/src/main/java/net/minecraft/server/EntityHuman.java -index ae4dd621d..4fb300468 100644 +index 28688f2ac..98fdfcb60 100644 --- a/src/main/java/net/minecraft/server/EntityHuman.java +++ b/src/main/java/net/minecraft/server/EntityHuman.java @@ -0,0 +0,0 @@ public abstract class EntityHuman extends EntityLiving { diff --git a/Spigot-Server-Patches/WitchConsumePotionEvent.patch b/Spigot-Server-Patches/WitchConsumePotionEvent.patch index b8def6d503..d035212720 100644 --- a/Spigot-Server-Patches/WitchConsumePotionEvent.patch +++ b/Spigot-Server-Patches/WitchConsumePotionEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] WitchConsumePotionEvent Fires when a witch consumes the potion in their hand diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java -index 71d8b6f8f..cf0669589 100644 +index 524d84c5b..c77328e76 100644 --- a/src/main/java/net/minecraft/server/EntityWitch.java +++ b/src/main/java/net/minecraft/server/EntityWitch.java @@ -0,0 +0,0 @@ public class EntityWitch extends EntityMonster implements IRangedEntity { diff --git a/Spigot-Server-Patches/WitchReadyPotionEvent.patch b/Spigot-Server-Patches/WitchReadyPotionEvent.patch index d2385c4fd3..2c39dd8f7a 100644 --- a/Spigot-Server-Patches/WitchReadyPotionEvent.patch +++ b/Spigot-Server-Patches/WitchReadyPotionEvent.patch @@ -5,7 +5,7 @@ Subject: [PATCH] WitchReadyPotionEvent diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java -index 59f3f4404..45b6e2b7b 100644 +index 2d8e307e7..b6f4ec842 100644 --- a/src/main/java/net/minecraft/server/EntityWitch.java +++ b/src/main/java/net/minecraft/server/EntityWitch.java @@ -0,0 +0,0 @@ public class EntityWitch extends EntityMonster implements IRangedEntity { diff --git a/Spigot-Server-Patches/WitchThrowPotionEvent.patch b/Spigot-Server-Patches/WitchThrowPotionEvent.patch index 9beb930235..d94f47e2ef 100644 --- a/Spigot-Server-Patches/WitchThrowPotionEvent.patch +++ b/Spigot-Server-Patches/WitchThrowPotionEvent.patch @@ -6,7 +6,7 @@ Subject: [PATCH] WitchThrowPotionEvent Fired when a witch throws a potion at a player diff --git a/src/main/java/net/minecraft/server/EntityWitch.java b/src/main/java/net/minecraft/server/EntityWitch.java -index cf0669589..59f3f4404 100644 +index c77328e76..2d8e307e7 100644 --- a/src/main/java/net/minecraft/server/EntityWitch.java +++ b/src/main/java/net/minecraft/server/EntityWitch.java @@ -0,0 +0,0 @@ public class EntityWitch extends EntityMonster implements IRangedEntity { diff --git a/Spigot-Server-Patches/getPlayerUniqueId-API.patch b/Spigot-Server-Patches/getPlayerUniqueId-API.patch index 57ae921785..63d94493a4 100644 --- a/Spigot-Server-Patches/getPlayerUniqueId-API.patch +++ b/Spigot-Server-Patches/getPlayerUniqueId-API.patch @@ -9,7 +9,7 @@ In Offline Mode, will return an Offline UUID This is a more performant way to obtain a UUID for a name than loading an OfflinePlayer diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java -index d605e5792..0b361d82f 100644 +index b1d3f2a5e..f3050b126 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -0,0 +0,0 @@ public final class CraftServer implements Server { diff --git a/scripts/importmcdev.sh b/scripts/importmcdev.sh index 255d8b25f4..9217d06df0 100755 --- a/scripts/importmcdev.sh +++ b/scripts/importmcdev.sh @@ -69,8 +69,14 @@ for f in $files; do fi done -import NBTList -import NBTBase +# Temporarily add new NMS dev imports here before you run paper patch +# but after you have paper rb'd your changes, remove the line from this file before committing. +# we do not need any lines added to this file + +# import FileName + + + set -e cd "$workdir/Spigot/Spigot-Server/"