Revert "Updated Upstream (Bukkit/CraftBukkit/Spigot)"
This reverts commit d833a4aeef.
This commit is contained in:
@@ -1014,7 +1014,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
chunksection.getBlocks().a(nbttagcompound2.getList("Palette", 10), nbttagcompound2.getLongArray("BlockStates"));
|
||||
chunksection.recalcBlockCounts();
|
||||
@@ -0,0 +0,0 @@ public class ChunkRegionLoader {
|
||||
// CraftBukkit end
|
||||
loadEntities(nbttagcompound1, chunk);
|
||||
});
|
||||
} else {
|
||||
- ProtoChunk protochunk = new ProtoChunk(chunkcoordintpair, chunkconverter, achunksection, protochunkticklist, protochunkticklist1);
|
||||
|
||||
@@ -2688,9 +2688,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
|
||||
- for (int i = -1; i < 17; ++i) {
|
||||
+ for (int i = -1; i < 17; ++i) { // Paper - conflict on loop parameter change
|
||||
int finalI = i; // CraftBukkit - decompile errors
|
||||
int finalI = i;
|
||||
ChunkSection chunksection = (ChunkSection) Arrays.stream(achunksection).filter((chunksection1) -> {
|
||||
return chunksection1 != null && chunksection1.getYPosition() >> 4 == finalI; // CraftBukkit - decompile errors
|
||||
return chunksection1 != null && chunksection1.getYPosition() >> 4 == finalI;
|
||||
}).findFirst().orElse(Chunk.a);
|
||||
- NibbleArray nibblearray = lightenginethreaded.a(EnumSkyBlock.BLOCK).a(SectionPosition.a(chunkcoordintpair, i));
|
||||
- NibbleArray nibblearray1 = lightenginethreaded.a(EnumSkyBlock.SKY).a(SectionPosition.a(chunkcoordintpair, i));
|
||||
|
||||
@@ -25,15 +25,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
|
||||
- object = new Chunk(worldserver.getMinecraftWorld(), chunkcoordintpair, biomestorage, chunkconverter, (TickList) object1, (TickList) object2, j, achunksection, (chunk) -> {
|
||||
- loadEntities(nbttagcompound1, chunk);
|
||||
- // CraftBukkit start - load chunk persistent data from nbt
|
||||
- NBTTagCompound persistentBase = nbttagcompound1.getCompound("BukkitValues");
|
||||
- if (persistentBase != null) {
|
||||
- chunk.persistentDataContainer.putAll(nbttagcompound1);
|
||||
- }
|
||||
- // CraftBukkit end
|
||||
- });
|
||||
+ object = new Chunk(worldserver.getMinecraftWorld(), chunkcoordintpair, biomestorage, chunkconverter, (TickList) object1, (TickList) object2, j, achunksection, // Paper start - fix massive nbt memory leak due to lambda. move lambda into a container method to not leak scope. Only clone needed NBT keys.
|
||||
+ createLoadEntitiesConsumer(new SafeNBTCopy(nbttagcompound1, "TileEntities", "Entities", "BukkitValues")) // Paper - move CB Chunk PDC into here
|
||||
+ createLoadEntitiesConsumer(new SafeNBTCopy(nbttagcompound1, "TileEntities", "Entities"))
|
||||
+ );// Paper end
|
||||
} else {
|
||||
ProtoChunk protochunk = new ProtoChunk(chunkcoordintpair, chunkconverter, achunksection, protochunkticklist, protochunkticklist1, worldserver); // Paper - Anti-Xray - Add parameter
|
||||
@@ -70,15 +64,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
+ }
|
||||
+ }
|
||||
+ private static java.util.function.Consumer<Chunk> createLoadEntitiesConsumer(NBTTagCompound nbt) {
|
||||
+ return (chunk) -> {
|
||||
+ loadEntities(nbt, chunk);
|
||||
+ // CraftBukkit start - load chunk persistent data from nbt
|
||||
+ NBTTagCompound persistentBase = nbt.getCompound("BukkitValues");
|
||||
+ if (persistentBase != null) {
|
||||
+ chunk.persistentDataContainer.putAll(nbt);
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+ };
|
||||
+ return (chunk) -> loadEntities(nbt, chunk);
|
||||
+ }
|
||||
+ // Paper end
|
||||
|
||||
|
||||
@@ -2442,7 +2442,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
HeightMap.Type[] aheightmap_type = HeightMap.Type.values();
|
||||
int j = aheightmap_type.length;
|
||||
@@ -0,0 +0,0 @@ public class Chunk implements IChunkAccess {
|
||||
public final org.bukkit.craftbukkit.persistence.CraftPersistentDataContainer persistentDataContainer = new org.bukkit.craftbukkit.persistence.CraftPersistentDataContainer(DATA_TYPE_REGISTRY);
|
||||
public boolean needsDecoration;
|
||||
// CraftBukkit end
|
||||
|
||||
+ // Paper start
|
||||
|
||||
Reference in New Issue
Block a user