Package org.geysermc.geyser.level
Class GeyserWorldManager
java.lang.Object
org.geysermc.geyser.level.WorldManager
org.geysermc.geyser.level.GeyserWorldManager
-
Field Summary
Fields inherited from class org.geysermc.geyser.level.WorldManager
RAW_TRANSFORMER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetBlockAt(GeyserSession session, int x, int y, int z) Gets the Java block state at the specified locationgetBlockAtAsync(GeyserSession session, int x, int y, int z) int[]getBlocksAt(GeyserSession session, org.geysermc.erosion.util.BlockPositionIterator iter) org.geysermc.mcprotocollib.protocol.data.game.entity.player.GameModegetDefaultGameMode(GeyserSession session) Get the default game mode of the serverbooleangetGameRuleBool(GeyserSession session, GameRule gameRule) Gets a gamerule value as a booleanintgetGameRuleInt(GeyserSession session, GameRule gameRule) Get a gamerule value as an integer@NonNull CompletableFuture<@Nullable org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponents>getPickItemComponents(GeyserSession session, int x, int y, int z, boolean addNbtData) Used for pick block, so we don't need to cache more data than necessary.booleanChecks whether or not this world manager requires a separate chunk cache/has access to more block data than the chunk cache.booleanhasPermission(GeyserSession session, String permission) Checks if the given session's player has a permissionvoidsetGameRule(GeyserSession session, String name, Object value) Updates a gamerule value on the Java serverMethods inherited from class org.geysermc.geyser.level.WorldManager
blockAt, blockAt, getBiomeIdentifiers, getBlockAt, getBlockAtAsync, setDefaultGameMode, setDifficulty, setPlayerGameMode
-
Constructor Details
-
GeyserWorldManager
public GeyserWorldManager()
-
-
Method Details
-
getBlockAt
Description copied from class:WorldManagerGets the Java block state at the specified location- Specified by:
getBlockAtin classWorldManager- Parameters:
session- the sessionx- the x coordinate to get the block aty- the y coordinate to get the block atz- the z coordinate to get the block at- Returns:
- the block state at the specified location
-
getBlockAtAsync
- Overrides:
getBlockAtAsyncin classWorldManager
-
getBlocksAt
public int[] getBlocksAt(GeyserSession session, org.geysermc.erosion.util.BlockPositionIterator iter) - Overrides:
getBlocksAtin classWorldManager
-
hasOwnChunkCache
public boolean hasOwnChunkCache()Description copied from class:WorldManagerChecks 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:
hasOwnChunkCachein classWorldManager- Returns:
- whether or not this world manager has access to more block data than the chunk cache
-
setGameRule
Description copied from class:WorldManagerUpdates a gamerule value on the Java server- Overrides:
setGameRulein classWorldManager- Parameters:
session- The session of the user that requested the changename- The gamerule to changevalue- The new value for the gamerule
-
getGameRuleBool
Description copied from class:WorldManagerGets a gamerule value as a boolean- Specified by:
getGameRuleBoolin classWorldManager- Parameters:
session- The session of the user that requested the valuegameRule- The gamerule to fetch the value of- Returns:
- The boolean representation of the value
-
getGameRuleInt
Description copied from class:WorldManagerGet a gamerule value as an integer- Specified by:
getGameRuleIntin classWorldManager- Parameters:
session- The session of the user that requested the valuegameRule- 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:WorldManagerGet the default game mode of the server- Specified by:
getDefaultGameModein classWorldManager- Parameters:
session- the player requesting the default game mode- Returns:
- the default game mode of the server, or Survival if unknown.
-
hasPermission
Description copied from class:WorldManagerChecks if the given session's player has a permission- Specified by:
hasPermissionin classWorldManager- Parameters:
session- The session of the player to check the permission ofpermission- The permission node to check- Returns:
- True if the player has the requested permission, false if not
-
getPickItemComponents
public @NonNull CompletableFuture<@Nullable org.geysermc.mcprotocollib.protocol.data.game.item.component.DataComponents> getPickItemComponents(GeyserSession session, int x, int y, int z, boolean addNbtData) Description copied from class:WorldManagerUsed for pick block, so we don't need to cache more data than necessary.- Overrides:
getPickItemComponentsin classWorldManager- Returns:
- expected NBT for this item.
-