Class DimensionUtils

java.lang.Object
org.geysermc.geyser.util.DimensionUtils

public class DimensionUtils extends Object
  • Field Details

    • OVERWORLD

      public static final String OVERWORLD
      String reference to vanilla Java overworld dimension identifier
      See Also:
      Constant Field Values
    • NETHER

      public static final String NETHER
      String reference to vanilla Java nether dimension identifier
      See Also:
      Constant Field Values
    • THE_END

      public static final String THE_END
      String reference to vanilla Java end dimension identifier
      See Also:
      Constant Field Values
  • Constructor Details

    • DimensionUtils

      public DimensionUtils()
  • Method Details

    • switchDimension

      public static void switchDimension(GeyserSession session, String javaDimension)
    • javaToBedrock

      public static int javaToBedrock(String javaDimension)
      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 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.
      Parameters:
      currentDimension - the current dimension of the player
      newDimension - the new dimension that the player will be transferred to
      Returns:
      the fake dimension to transfer to
    • isCustomBedrockNetherId

      public static boolean isCustomBedrockNetherId()