Package journeymap.api.v2.client.util
Class UIState
java.lang.Object
journeymap.api.v2.client.util.UIState
Provides the current state of a Map UI in JourneyMap.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal booleanWhether the UI is active or not.final net.minecraft.world.phys.AABBThe area of blocks displayed in the UI.final doubleThe width in pixels of a single block in the UI's map at the current zoom level.final IntegerFor underground/cave/nether/end maps, the vertical slice (chunk y) displayed.final net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> The dimension displayed in the UI.final Rectangle2D.DoubleThe screen area (pixels) used by the UI.static final intMax Zoom Out for fullscreen 2 pixels per region.final net.minecraft.core.BlockPosThe block position at the center of the UI.final Context.MapTypeThe current map type of the UI.static final intMaz Zoom out for the minimap.final Context.UIThe UI to which this state applies.final intThe current zoom level of the UI.static final intMax Zoom In value. -
Constructor Summary
ConstructorsConstructorDescriptionUIState(Context.UI ui, boolean active, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension, int zoom, Context.MapType mapType, net.minecraft.core.BlockPos mapCenter, Integer chunkY, net.minecraft.world.phys.AABB blockBounds, Rectangle2D.Double displayBounds) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleaninthashCode()static UIStatenewInactive(Context.UI ui, net.minecraft.client.Minecraft minecraft) Convenience factory method to create an inactive UIState.static UIStatenewInactive(UIState priorState) Convenience factory method to create an inactive UIState.toString()
-
Field Details
-
ZOOM_IN_MAX
public static final int ZOOM_IN_MAXMax Zoom In value.- See Also:
-
FULLSCREEN_ZOOM_MIN
public static final int FULLSCREEN_ZOOM_MINMax Zoom Out for fullscreen 2 pixels per region.- See Also:
-
MINIMAP_ZOOM_MIN
public static final int MINIMAP_ZOOM_MINMaz Zoom out for the minimap.- See Also:
-
ui
The UI to which this state applies. -
active
public final boolean activeWhether the UI is active or not. If false, other values reflect the state of the display when it was last used. -
dimension
public final net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimensionThe dimension displayed in the UI. If active==false and the display has never been used, this will default to 0. -
zoom
public final int zoomThe current zoom level of the UI. If active==false and the display has never been used, this will default to 0. -
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 net.minecraft.core.BlockPos mapCenterThe 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
For underground/cave/nether/end maps, the vertical slice (chunk y) displayed. -
blockBounds
public final net.minecraft.world.phys.AABB blockBoundsThe area of blocks displayed in the UI. If active==false, this will be null. -
displayBounds
The screen area (pixels) used by the UI. If active==false, this will be null. -
blockSize
public final double blockSizeThe 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, net.minecraft.resources.ResourceKey<net.minecraft.world.level.Level> dimension, int zoom, @Nullable Context.MapType mapType, @Nullable net.minecraft.core.BlockPos mapCenter, @Nullable Integer chunkY, @Nullable net.minecraft.world.phys.AABB blockBounds, @Nullable Rectangle2D.Double displayBounds) Constructor.- Parameters:
ui- The UI which has been updated.active- Whether the UI is activedimension- 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
Convenience factory method to create an inactive UIState.- Parameters:
ui- the ui- Returns:
- a UIState
-
newInactive
Convenience factory method to create an inactive UIState.- Parameters:
priorState- the prior UIState- Returns:
- a UIState
-
equals
-
hashCode
public int hashCode() -
toString
-