Class DimensionUtils

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

public class DimensionUtils extends Object
  • Field Details

    • BEDROCK_FOG_HELL

      public static final String BEDROCK_FOG_HELL
      See Also:
    • OVERWORLD

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

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

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

    • DimensionUtils

      public DimensionUtils()
  • Method Details

    • switchDimension

      public static void switchDimension(GeyserSession session, int javaDimension)
    • setBedrockDimension

      public static void setBedrockDimension(GeyserSession session, int javaDimension)
    • javaToBedrock

      public static int javaToBedrock(BedrockDimension dimension)
    • 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

      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 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 player
      newDimension - the new dimension that the player will be transferred to
      Returns:
      the fake dimension to transfer to
    • isCustomBedrockNetherId

      public static boolean isCustomBedrockNetherId()