Class DimensionUtils

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

public class DimensionUtils extends Object
  • Field Details

  • Constructor Details

    • DimensionUtils

      public DimensionUtils()
  • Method Details

    • switchDimension

      public static void switchDimension(GeyserSession session, JavaDimension javaDimension)
    • switchDimension

      public static void switchDimension(GeyserSession session, JavaDimension javaDimension, int bedrockDimension)
    • fastSwitchDimension

      public static void fastSwitchDimension(GeyserSession session, int bedrockDimension)
      Switch dimensions without clearing internal logic.
    • setBedrockDimension

      public static void setBedrockDimension(GeyserSession session, int bedrockDimension)
    • 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
    • javaToBedrock

      public static int javaToBedrock(GeyserSession session)
      Gets the Bedrock dimension ID, with a safety check if a packet is created before the player is logged/spawned in.
    • getTemporaryDimension

      public static int getTemporaryDimension(int currentBedrockDimension, int newBedrockDimension)
      Gets the fake, temporary dimension we send clients to so we aren't switching to the same dimension without an additional dimension switch.
      Parameters:
      currentBedrockDimension - the current dimension of the player
      newBedrockDimension - the new dimension that the player will be transferred to
      Returns:
      the Bedrock fake dimension to transfer to