From f1d046753cdffacb0af4e8908519563c4a6deb18 Mon Sep 17 00:00:00 2001 From: themode Date: Sun, 15 Nov 2020 08:33:03 +0100 Subject: [PATCH] Added info about chunk potential memory leak --- src/main/java/net/minestom/server/instance/Chunk.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minestom/server/instance/Chunk.java b/src/main/java/net/minestom/server/instance/Chunk.java index 623e096f1..17785c491 100644 --- a/src/main/java/net/minestom/server/instance/Chunk.java +++ b/src/main/java/net/minestom/server/instance/Chunk.java @@ -41,7 +41,11 @@ import java.util.concurrent.CopyOnWriteArraySet; * Chunks can be serialized using {@link #getSerializedData()} and deserialized back with {@link #readChunk(BinaryReader, ChunkCallback)}, * allowing you to implement your own storage solution if needed. *

- * You can create your own implementation of this class by extending it and create the objects in {@link InstanceContainer#setChunkSupplier(ChunkSupplier)}. + * You can create your own implementation of this class by extending it + * and create the objects in {@link InstanceContainer#setChunkSupplier(ChunkSupplier)}. + *

+ * You generally want to avoid storing references of this object as this could lead to a huge memory leak, + * you should store the chunk coordinates instead. */ public abstract class Chunk implements Viewable, DataContainer {