Class UIState

java.lang.Object
journeymap.api.v2.client.util.UIState

public final class UIState extends Object
Provides the current state of a Map UI in JourneyMap.
  • Field Details

    • ZOOM_IN_MAX

      public static final int ZOOM_IN_MAX
      Max Zoom In value.
      See Also:
    • FULLSCREEN_ZOOM_MIN

      public static final int FULLSCREEN_ZOOM_MIN
      Max Zoom Out for fullscreen 2 pixels per region.
      See Also:
    • MINIMAP_ZOOM_MIN

      public static final int MINIMAP_ZOOM_MIN
      Maz Zoom out for the minimap.
      See Also:
    • ui

      public final Context.UI ui
      The UI to which this state applies.
    • active

      public final boolean active
      Whether the UI is active or not. If false, other values reflect the state of the display when it was last used.
    • dimension

      public final int dimension
      The dimension displayed in the UI. If active==false and the display has never been used, this will default to 0.
    • zoom

      public final int zoom
      The current zoom level of the UI. If active==false and the display has never been used, this will default to 0.
    • mapType

      public final Context.MapType mapType
      The current map type of the UI. If active==false and the display has never been used, this will default to Context.MapType.Day.
    • mapCenter

      public final BlockPos mapCenter
      The block position at the center of the UI. If active==false and the display has never been used, this will default to the world spawnpoint.
    • chunkY

      public final Integer chunkY
      For underground/cave/nether/end maps, the vertical slice (chunk y) displayed.
    • blockBounds

      public final net.minecraft.util.AxisAlignedBB blockBounds
      The area of blocks displayed in the UI. If active==false, this will be null.
    • displayBounds

      public final Rectangle2D.Double displayBounds
      The screen area (pixels) used by the UI. If active==false, this will be null.
    • blockSize

      public final double blockSize
      The width in pixels of a single block in the UI's map at the current zoom level.
  • Constructor Details

    • UIState

      public UIState(Context.UI ui, boolean active, int dimension, int zoom, @Nullable Context.MapType mapType, @Nullable BlockPos mapCenter, @Nullable Integer chunkY, @Nullable net.minecraft.util.AxisAlignedBB blockBounds, @Nullable Rectangle2D.Double displayBounds)
      Constructor.
      Parameters:
      ui - The UI which has been updated.
      active - Whether the UI is active
      dimension - The current dimension shown in the UI.
      zoom - The current zoom level of the UI.
      mapType - The current map type of the UI.
      mapCenter - The block position at the center of the UI.
      blockBounds - The area of blocks displayed in the UI.
  • Method Details

    • newInactive

      public static UIState newInactive(Context.UI ui, net.minecraft.client.Minecraft minecraft)
      Convenience factory method to create an inactive UIState.
      Parameters:
      ui - the ui
      Returns:
      a UIState
    • newInactive

      public static UIState newInactive(UIState priorState)
      Convenience factory method to create an inactive UIState.
      Parameters:
      priorState - the prior UIState
      Returns:
      a UIState
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object