Package org.geysermc.geyser.util
Class DimensionUtils
java.lang.Object
org.geysermc.geyser.util.DimensionUtils
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final intString reference to vanilla Java nether dimension identifierstatic final intString reference to vanilla Java overworld dimension identifierstatic final intString reference to vanilla Java end dimension identifier -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidchangeBedrockNetherId(boolean isAboveNetherBedrockBuilding) The Nether dimension in Bedrock does not permit building above Y128 - the Bedrock above the dimension.static intgetTemporaryDimension(int currentDimension, int 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 booleanstatic intjavaToBedrock(int javaDimension) Map the Java edition dimension IDs to Bedrock editionstatic intjavaToBedrock(String javaDimension) Map the Java edition dimension IDs to Bedrock editionstatic intjavaToBedrock(BedrockDimension dimension) static voidsetBedrockDimension(GeyserSession session, int javaDimension) static voidswitchDimension(GeyserSession session, int javaDimension)
-
Field Details
-
BEDROCK_FOG_HELL
- See Also:
-
OVERWORLD
public static final int OVERWORLDString reference to vanilla Java overworld dimension identifier- See Also:
-
NETHER
public static final int NETHERString reference to vanilla Java nether dimension identifier- See Also:
-
THE_END
public static final int THE_ENDString reference to vanilla Java end dimension identifier- See Also:
-
-
Constructor Details
-
DimensionUtils
public DimensionUtils()
-
-
Method Details
-
switchDimension
-
setBedrockDimension
-
javaToBedrock
-
javaToBedrock
public static int javaToBedrock(int javaDimension) Map the Java edition dimension IDs to Bedrock edition- Parameters:
javaDimension- Dimension ID to convert- Returns:
- Converted Bedrock edition dimension ID
-
javaToBedrock
Map the Java edition dimension IDs to Bedrock edition- Parameters:
javaDimension- Dimension ID to convert- Returns:
- Converted Bedrock edition dimension ID
-
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
public static int getTemporaryDimension(int currentDimension, int newDimension) 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
-
isCustomBedrockNetherId
public static boolean isCustomBedrockNetherId()
-