Class GeyserWorldManager

java.lang.Object
org.geysermc.geyser.level.WorldManager
org.geysermc.geyser.level.GeyserWorldManager

public class GeyserWorldManager extends WorldManager
  • Constructor Details

    • GeyserWorldManager

      public GeyserWorldManager()
  • Method Details

    • getBlockAt

      public int getBlockAt(GeyserSession session, int x, int y, int z)
      Description copied from class: WorldManager
      Gets the Java block state at the specified location
      Specified by:
      getBlockAt in class WorldManager
      Parameters:
      session - the session
      x - the x coordinate to get the block at
      y - the y coordinate to get the block at
      z - the z coordinate to get the block at
      Returns:
      the block state at the specified location
    • getBlockAtAsync

      public CompletableFuture<Integer> getBlockAtAsync(GeyserSession session, int x, int y, int z)
      Overrides:
      getBlockAtAsync in class WorldManager
    • getBlocksAt

      public int[] getBlocksAt(GeyserSession session, org.geysermc.erosion.util.BlockPositionIterator iter)
      Overrides:
      getBlocksAt in class WorldManager
    • hasOwnChunkCache

      public boolean hasOwnChunkCache()
      Description copied from class: WorldManager
      Checks whether or not this world manager requires a separate chunk cache/has access to more block data than the chunk cache.

      Some world managers (e.g. Spigot) can provide access to block data outside of the chunk cache, and even with chunk caching disabled. This method provides a means to check if this manager has this capability.

      Specified by:
      hasOwnChunkCache in class WorldManager
      Returns:
      whether or not this world manager has access to more block data than the chunk cache
    • setGameRule

      public void setGameRule(GeyserSession session, String name, Object value)
      Description copied from class: WorldManager
      Updates a gamerule value on the Java server
      Overrides:
      setGameRule in class WorldManager
      Parameters:
      session - The session of the user that requested the change
      name - The gamerule to change
      value - The new value for the gamerule
    • getGameRuleBool

      public boolean getGameRuleBool(GeyserSession session, GameRule gameRule)
      Description copied from class: WorldManager
      Gets a gamerule value as a boolean
      Specified by:
      getGameRuleBool in class WorldManager
      Parameters:
      session - The session of the user that requested the value
      gameRule - The gamerule to fetch the value of
      Returns:
      The boolean representation of the value
    • getGameRuleInt

      public int getGameRuleInt(GeyserSession session, GameRule gameRule)
      Description copied from class: WorldManager
      Get a gamerule value as an integer
      Specified by:
      getGameRuleInt in class WorldManager
      Parameters:
      session - The session of the user that requested the value
      gameRule - The gamerule to fetch the value of
      Returns:
      The integer representation of the value
    • getDefaultGameMode

      public org.geysermc.mcprotocollib.protocol.data.game.entity.player.GameMode getDefaultGameMode(GeyserSession session)
      Description copied from class: WorldManager
      Get the default game mode of the server
      Specified by:
      getDefaultGameMode in class WorldManager
      Parameters:
      session - the player requesting the default game mode
      Returns:
      the default game mode of the server, or Survival if unknown.