mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-09 18:08:37 +01:00
Improve DynamicChunk cloning
This commit is contained in:
parent
e2a94d40ae
commit
5185a3efa6
@ -47,15 +47,15 @@ public class DynamicChunk extends Chunk {
|
|||||||
|
|
||||||
// Used to get all blocks with data (no null)
|
// Used to get all blocks with data (no null)
|
||||||
// Key is still chunk coordinates (see #getBlockIndex)
|
// Key is still chunk coordinates (see #getBlockIndex)
|
||||||
protected final Int2ObjectMap<Data> blocksData = new Int2ObjectOpenHashMap<>();
|
protected final Int2ObjectOpenHashMap<Data> blocksData = new Int2ObjectOpenHashMap<>();
|
||||||
|
|
||||||
// Contains CustomBlocks' block index which are updatable
|
// Contains CustomBlocks' block index which are updatable
|
||||||
protected final IntSet updatableBlocks = new IntOpenHashSet();
|
protected final IntOpenHashSet updatableBlocks = new IntOpenHashSet();
|
||||||
// (block index)/(last update in ms)
|
// (block index)/(last update in ms)
|
||||||
protected final Int2LongMap updatableBlocksLastUpdate = new Int2LongOpenHashMap();
|
protected final Int2LongMap updatableBlocksLastUpdate = new Int2LongOpenHashMap();
|
||||||
|
|
||||||
// Block entities
|
// Block entities
|
||||||
protected final IntSet blockEntities = new IntOpenHashSet();
|
protected final IntOpenHashSet blockEntities = new IntOpenHashSet();
|
||||||
|
|
||||||
private long lastChangeTime;
|
private long lastChangeTime;
|
||||||
|
|
||||||
@ -389,8 +389,8 @@ public class DynamicChunk extends Chunk {
|
|||||||
fullDataPacket.chunkZ = chunkZ;
|
fullDataPacket.chunkZ = chunkZ;
|
||||||
fullDataPacket.paletteStorage = blockPalette.clone();
|
fullDataPacket.paletteStorage = blockPalette.clone();
|
||||||
fullDataPacket.customBlockPaletteStorage = customBlockPalette.clone();
|
fullDataPacket.customBlockPaletteStorage = customBlockPalette.clone();
|
||||||
fullDataPacket.blockEntities = new IntOpenHashSet(blockEntities);
|
fullDataPacket.blockEntities = blockEntities.clone();
|
||||||
fullDataPacket.blocksData = new Int2ObjectOpenHashMap<>(blocksData);
|
fullDataPacket.blocksData = blocksData.clone();
|
||||||
return fullDataPacket;
|
return fullDataPacket;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user