Added warning to the DynamicChunk protected arrays

This commit is contained in:
themode 2020-09-02 23:54:19 +02:00
parent 89656fbf33
commit 181c2b2b1b

View File

@ -19,6 +19,8 @@ import java.util.concurrent.CopyOnWriteArraySet;
public class DynamicChunk extends Chunk {
// blocks id based on coordinate, see Chunk#getBlockIndex
// WARNING: those arrays are NOT thread-safe
// and modifying them can cause issue with block data, update, block entity and the cached chunk packet
protected final short[] blocksStateId = new short[CHUNK_SIZE_X * CHUNK_SIZE_Y * CHUNK_SIZE_Z];
protected final short[] customBlocksId = new short[CHUNK_SIZE_X * CHUNK_SIZE_Y * CHUNK_SIZE_Z];