Package org.geysermc.geyser.util
Class DimensionUtils
java.lang.Object
org.geysermc.geyser.util.DimensionUtils
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
changeBedrockNetherId(boolean isAboveNetherBedrockBuilding)
The Nether dimension in Bedrock does not permit building above Y128 - the Bedrock above the dimension.static String
getNewDimension(com.github.steveice10.opennbt.tag.builtin.CompoundTag dimensionTag)
Determines the new dimension based on theCompoundTag
sent by either theClientboundLoginPacket
orClientboundRespawnPacket
.static String
getTemporaryDimension(String currentDimension, String newDimension)
Gets the fake, temporary dimension we send clients to so we aren't switching to the same dimension without an additional dimension switch.static int
javaToBedrock(String javaDimension)
Map the Java edition dimension IDs to Bedrock editionstatic void
switchDimension(GeyserSession session, String javaDimension)
-
Field Details
-
OVERWORLD
String reference to vanilla Java overworld dimension identifier- See Also:
- Constant Field Values
-
NETHER
String reference to vanilla Java nether dimension identifier- See Also:
- Constant Field Values
-
THE_END
String reference to vanilla Java end dimension identifier- See Also:
- Constant Field Values
-
-
Constructor Details
-
DimensionUtils
public DimensionUtils()
-
-
Method Details
-
switchDimension
-
javaToBedrock
Map the Java edition dimension IDs to Bedrock edition- Parameters:
javaDimension
- Dimension ID to convert- Returns:
- Converted Bedrock edition dimension ID
-
getNewDimension
public static String getNewDimension(com.github.steveice10.opennbt.tag.builtin.CompoundTag dimensionTag)Determines the new dimension based on theCompoundTag
sent by either theClientboundLoginPacket
orClientboundRespawnPacket
.- Parameters:
dimensionTag
- the packet's dimension tag.- Returns:
- the dimension identifier.
-
changeBedrockNetherId
public static void changeBedrockNetherId(boolean isAboveNetherBedrockBuilding)The Nether dimension in Bedrock does not permit building above Y128 - the Bedrock above the dimension. This workaround sets the Nether as the End dimension to ignore this limit.- Parameters:
isAboveNetherBedrockBuilding
- true if we should apply The End workaround
-
getTemporaryDimension
Gets the fake, temporary dimension we send clients to so we aren't switching to the same dimension without an additional dimension switch.- Parameters:
currentDimension
- the current dimension of the playernewDimension
- the new dimension that the player will be transferred to- Returns:
- the fake dimension to transfer to
-