mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-19 14:51:27 +01:00
Configurable chunk map caching
This commit is contained in:
parent
82ad0725c6
commit
d0249a6935
@ -17,6 +17,10 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ private int emptySectionBits;
|
+ private int emptySectionBits;
|
||||||
+
|
+
|
||||||
+ public PacketPlayOutMapChunk.ChunkMap getChunkMap() {
|
+ public PacketPlayOutMapChunk.ChunkMap getChunkMap() {
|
||||||
|
+ if (!world.paperSpigotConfig.cacheChunkMaps) {
|
||||||
|
+ return PacketPlayOutMapChunk.a(this, true, !world.worldProvider.o(), '\uffff');
|
||||||
|
+ }
|
||||||
|
+
|
||||||
+ boolean isDirty = false;
|
+ boolean isDirty = false;
|
||||||
+ for (int i = 0; i < sections.length; ++i) {
|
+ for (int i = 0; i < sections.length; ++i) {
|
||||||
+ ChunkSection section = sections[i];
|
+ ChunkSection section = sections[i];
|
||||||
@ -110,6 +114,21 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
|
|
||||||
this.a[j] = chunk.locX;
|
this.a[j] = chunk.locX;
|
||||||
this.b[j] = chunk.locZ;
|
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
|
1.9.5.msysgit.1
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user