Class ChunkCache
java.lang.Object
ua.mcchickenstudio.opencreative.utils.world.cache.ChunkCache
ChunkCache
This class saves the state of the chunk in the cache so as not to overload the memory.- Author:
- Sasha Kireiko
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisChunkGenerated(@NotNull org.bukkit.World world, int x, int z) Checks whether chunk is generated.static voidload(@NotNull org.bukkit.World world, int x, int z) Saves chunk's hashcode into map.static voidpreLoad(@NotNull org.bukkit.World world, int x, int z) Preloads chunk and saves it's hashcode into map.static voidunload(@NotNull org.bukkit.World world, int x, int z) Marks chunk as unloaded.
-
Constructor Details
-
ChunkCache
public ChunkCache()
-
-
Method Details
-
isChunkGenerated
public static boolean isChunkGenerated(@NotNull @NotNull org.bukkit.World world, int x, int z) Checks whether chunk is generated.- Parameters:
world- world with chunk.x- x coordinate of chunk.z- z coordinate of chunk.- Returns:
- true - chunk is generated, false - not generated.
-
preLoad
public static void preLoad(@NotNull @NotNull org.bukkit.World world, int x, int z) Preloads chunk and saves it's hashcode into map.- Parameters:
world- world with chunk.x- x coordinate of chunk.z- z coordinate of chunk.
-
load
public static void load(@NotNull @NotNull org.bukkit.World world, int x, int z) Saves chunk's hashcode into map.- Parameters:
world- world with chunk.x- x coordinate of chunk.z- z coordinate of chunk.
-
unload
public static void unload(@NotNull @NotNull org.bukkit.World world, int x, int z) Marks chunk as unloaded.- Parameters:
world- world with chunk.x- x coordinate of chunk.z- z coordinate of chunk.
-