Package org.geysermc.connector.utils
Class ChunkUtils
java.lang.Object
org.geysermc.connector.utils.ChunkUtils
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic byte[]static byte[]static intThe minimum height Bedrock Edition will accept.static int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidapplyDimensionHeight(GeyserSession session, com.github.steveice10.opennbt.tag.builtin.CompoundTag dimensionTag)Process the minimum and maximum heights for this dimension.static voidsendEmptyChunks(GeyserSession session, com.nukkitx.math.vector.Vector3i position, int radius, boolean forceUpdate)static ChunkUtils.ChunkDatatranslateToBedrock(GeyserSession session, com.github.steveice10.mc.protocol.data.game.chunk.Column column, int yOffset)static voidupdateBlock(GeyserSession session, int blockState, com.github.steveice10.mc.protocol.data.game.entity.metadata.Position position)Sends a block update to the Bedrock client.static voidupdateBlock(GeyserSession session, int blockState, com.nukkitx.math.vector.Vector3i position)Sends a block update to the Bedrock client.static voidupdateChunkPosition(GeyserSession session, com.nukkitx.math.vector.Vector3i position)
-
Field Details
-
MINIMUM_ACCEPTED_HEIGHT
public static final int MINIMUM_ACCEPTED_HEIGHTThe minimum height Bedrock Edition will accept.- See Also:
- Constant Field Values
-
MINIMUM_ACCEPTED_HEIGHT_OVERWORLD
public static final int MINIMUM_ACCEPTED_HEIGHT_OVERWORLD -
EMPTY_CHUNK_DATA
public static final byte[] EMPTY_CHUNK_DATA -
EMPTY_BIOME_DATA
public static final byte[] EMPTY_BIOME_DATA
-
-
Constructor Details
-
ChunkUtils
public ChunkUtils()
-
-
Method Details
-
translateToBedrock
public static ChunkUtils.ChunkData translateToBedrock(GeyserSession session, com.github.steveice10.mc.protocol.data.game.chunk.Column column, int yOffset) -
updateChunkPosition
public static void updateChunkPosition(GeyserSession session, com.nukkitx.math.vector.Vector3i position) -
updateBlock
public static void updateBlock(GeyserSession session, int blockState, com.github.steveice10.mc.protocol.data.game.entity.metadata.Position position)Sends a block update to the Bedrock client. If chunk caching is enabled and the platform is not Spigot, this also adds that block to the cache.- Parameters:
session- the Bedrock session to send/register the block toblockState- the Java block state of the blockposition- the position of the block
-
updateBlock
public static void updateBlock(GeyserSession session, int blockState, com.nukkitx.math.vector.Vector3i position)Sends a block update to the Bedrock client. If chunk caching is enabled and the platform is not Spigot, this also adds that block to the cache.- Parameters:
session- the Bedrock session to send/register the block toblockState- the Java block state of the blockposition- the position of the block
-
sendEmptyChunks
public static void sendEmptyChunks(GeyserSession session, com.nukkitx.math.vector.Vector3i position, int radius, boolean forceUpdate) -
applyDimensionHeight
public static void applyDimensionHeight(GeyserSession session, com.github.steveice10.opennbt.tag.builtin.CompoundTag dimensionTag)Process the minimum and maximum heights for this dimension. This must be done after the player has switched dimensions so we know what their dimension is
-