From e8933c189041ff814055c62d7ecab26f045c09a9 Mon Sep 17 00:00:00 2001 From: md_5 Date: Tue, 28 Jan 2014 20:36:05 +1100 Subject: [PATCH] Allow Configuring Chunks per Packet. This enables server owners to cram more chunks per packet, potentially leading to higher compression ratios, thus saving bandwidth and load time. This is currently set at the Vanilla default value of 5, however initial testing seems to suggest there could be good performance / usability / bandwidth gains by setting it to its maximum value of 32768. Testers are welcome to experiment with this option, beware the placebo though! --- ...-Allow-Configuring-Chunks-per-Packet.patch | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 CraftBukkit-Patches/0105-Allow-Configuring-Chunks-per-Packet.patch diff --git a/CraftBukkit-Patches/0105-Allow-Configuring-Chunks-per-Packet.patch b/CraftBukkit-Patches/0105-Allow-Configuring-Chunks-per-Packet.patch new file mode 100644 index 0000000000..74107d6b40 --- /dev/null +++ b/CraftBukkit-Patches/0105-Allow-Configuring-Chunks-per-Packet.patch @@ -0,0 +1,38 @@ +From 0ddeee73819235b33c3b7491e01eced191f6ec5c Mon Sep 17 00:00:00 2001 +From: md_5 +Date: Tue, 28 Jan 2014 20:35:35 +1100 +Subject: [PATCH] Allow Configuring Chunks per Packet + + +diff --git a/src/main/java/net/minecraft/server/EntityPlayer.java b/src/main/java/net/minecraft/server/EntityPlayer.java +index 550ef44..9b853a9 100644 +--- a/src/main/java/net/minecraft/server/EntityPlayer.java ++++ b/src/main/java/net/minecraft/server/EntityPlayer.java +@@ -210,7 +210,7 @@ public class EntityPlayer extends EntityHuman implements ICrafting { + + Chunk chunk; + +- while (iterator1.hasNext() && arraylist.size() < PacketPlayOutMapChunkBulk.c()) { ++ while (iterator1.hasNext() && arraylist.size() < this.world.spigotConfig.maxBulkChunk) { // Spigot + ChunkCoordIntPair chunkcoordintpair = (ChunkCoordIntPair) iterator1.next(); + + if (chunkcoordintpair != null) { +diff --git a/src/main/java/org/spigotmc/SpigotWorldConfig.java b/src/main/java/org/spigotmc/SpigotWorldConfig.java +index 5a6e369..4cff009 100644 +--- a/src/main/java/org/spigotmc/SpigotWorldConfig.java ++++ b/src/main/java/org/spigotmc/SpigotWorldConfig.java +@@ -264,4 +264,11 @@ public class SpigotWorldConfig + enableZombiePigmenPortalSpawns = getBoolean( "enable-zombie-pigmen-portal-spawns", true ); + log( "Allow Zombie Pigmen to spawn from portal blocks: " + enableZombiePigmenPortalSpawns ); + } ++ ++ public int maxBulkChunk; ++ private void bulkChunkCount() ++ { ++ maxBulkChunk = getInt( "max-bulk-chunks", 5 ); ++ log( "Sending up to " + maxBulkChunk + " chunks per packet" ); ++ } + } +-- +1.8.3.2 +