Configurable chunk map caching

This commit is contained in:
Byteflux 2015-07-15 16:16:27 -07:00
parent 82ad0725c6
commit d0249a6935

View File

@ -17,6 +17,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ private int emptySectionBits;
+
+ public PacketPlayOutMapChunk.ChunkMap getChunkMap() {
+ if (!world.paperSpigotConfig.cacheChunkMaps) {
+ return PacketPlayOutMapChunk.a(this, true, !world.worldProvider.o(), '\uffff');
+ }
+
+ boolean isDirty = false;
+ for (int i = 0; i < sections.length; ++i) {
+ ChunkSection section = sections[i];
@ -110,6 +114,21 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
this.a[j] = chunk.locX;
this.b[j] = chunk.locZ;
diff --git a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
+++ b/src/main/java/org/github/paperspigot/PaperSpigotWorldConfig.java
@@ -0,0 +0,0 @@ public class PaperSpigotWorldConfig
{
mobSpawnerTickRate = getInt( "mob-spawner-tick-rate", 1 );
}
+
+ public boolean cacheChunkMaps;
+ private void cacheChunkMaps()
+ {
+ cacheChunkMaps = getBoolean( "cache-chunk-maps", false );
+ }
}
--
1.9.5.msysgit.1