Package etithespirit.orimod.server.world
Class ChunkKeepAlive
java.lang.Object
etithespirit.orimod.server.world.ChunkKeepAlive
A utility class to manage the state of chunks being kept alive or not.
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isChunkKeptAlive
(net.minecraft.server.level.ServerLevel world, net.minecraft.core.BlockPos pos) Checks if the chunk containing the givenBlockPos
is forced to be alive.static boolean
isChunkKeptAlive
(net.minecraft.server.level.ServerLevel world, net.minecraft.world.level.ChunkPos pos) Checks if the chunk at the givenChunkPos
is forced to be alive.static void
setChunkKeptAlive
(net.minecraft.server.level.ServerLevel world, net.minecraft.core.BlockPos reservedPos, boolean alive) Tells the server level that the chunk containing the givenBlockPos
should be kept alive.
-
Method Details
-
isChunkKeptAlive
public static boolean isChunkKeptAlive(net.minecraft.server.level.ServerLevel world, net.minecraft.core.BlockPos pos) Checks if the chunk containing the givenBlockPos
is forced to be alive.- Parameters:
world
- The world to check in.pos
- The position to check in.- Returns:
- True if the chunk is being kept alive, false if not.
-
isChunkKeptAlive
public static boolean isChunkKeptAlive(net.minecraft.server.level.ServerLevel world, net.minecraft.world.level.ChunkPos pos) Checks if the chunk at the givenChunkPos
is forced to be alive.- Parameters:
world
- The world to check in.pos
- The position to check in.- Returns:
- True if the chunk is being kept alive, false if not.
-
setChunkKeptAlive
public static void setChunkKeptAlive(net.minecraft.server.level.ServerLevel world, net.minecraft.core.BlockPos reservedPos, boolean alive) Tells the server level that the chunk containing the givenBlockPos
should be kept alive.- Parameters:
world
- The world to modify.reservedPos
- The position to modify, which should correspond to a block entity that needs to keep a chunk alive.alive
- Whether or not to keep the chunk alive.
-