Class ChunkKeepAlive

java.lang.Object
etithespirit.orimod.server.world.ChunkKeepAlive

public final class ChunkKeepAlive extends Object
A utility class to manage the state of chunks being kept alive or not.
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    isChunkKeptAlive(net.minecraft.server.level.ServerLevel world, net.minecraft.core.BlockPos pos)
    Checks if the chunk containing the given BlockPos 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 given ChunkPos 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 given BlockPos should be kept alive.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • isChunkKeptAlive

      public static boolean isChunkKeptAlive(net.minecraft.server.level.ServerLevel world, net.minecraft.core.BlockPos pos)
      Checks if the chunk containing the given BlockPos 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 given ChunkPos 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 given BlockPos 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.