Class MapState

java.lang.Object
net.minecraft.world.PersistentState
net.minecraft.item.map.MapState

public class MapState extends PersistentState
Mappings:
Namespace Name
official egb
intermediary net/minecraft/class_22
named net/minecraft/item/map/MapState
  • Field Details

    • LOGGER

      private static final Logger LOGGER
      Mappings:
      Namespace Name Mixin selector
      official i Legb;i:Lorg/slf4j/Logger;
      intermediary field_25019 Lnet/minecraft/class_22;field_25019:Lorg/slf4j/Logger;
      named LOGGER Lnet/minecraft/item/map/MapState;LOGGER:Lorg/slf4j/Logger;
    • field_31832

      private static final int field_31832
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official j Legb;j:I
      intermediary field_31832 Lnet/minecraft/class_22;field_31832:I
      named field_31832 Lnet/minecraft/item/map/MapState;field_31832:I
    • field_31833

      private static final int field_31833
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official k Legb;k:I
      intermediary field_31833 Lnet/minecraft/class_22;field_31833:I
      named field_31833 Lnet/minecraft/item/map/MapState;field_31833:I
    • MAX_SCALE

      public static final int MAX_SCALE
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official a Legb;a:I
      intermediary field_31831 Lnet/minecraft/class_22;field_31831:I
      named MAX_SCALE Lnet/minecraft/item/map/MapState;MAX_SCALE:I
    • MAX_ICONS

      public static final int MAX_ICONS
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official b Legb;b:I
      intermediary field_33991 Lnet/minecraft/class_22;field_33991:I
      named MAX_ICONS Lnet/minecraft/item/map/MapState;MAX_ICONS:I
    • centerX

      public final int centerX
      The scaled center coordinate of the map state on the X axis.

      Always 0 for the client.

      Mappings:
      Namespace Name Mixin selector
      official c Legb;c:I
      intermediary field_116 Lnet/minecraft/class_22;field_116:I
      named centerX Lnet/minecraft/item/map/MapState;centerX:I
    • centerZ

      public final int centerZ
      The scaled center coordinate of the map state on the Z axis.

      Always 0 for the client.

      Mappings:
      Namespace Name Mixin selector
      official d Legb;d:I
      intermediary field_115 Lnet/minecraft/class_22;field_115:I
      named centerZ Lnet/minecraft/item/map/MapState;centerZ:I
    • dimension

      public final RegistryKey<World> dimension
      Mappings:
      Namespace Name Mixin selector
      official e Legb;e:Lahf;
      intermediary field_118 Lnet/minecraft/class_22;field_118:Lnet/minecraft/class_5321;
      named dimension Lnet/minecraft/item/map/MapState;dimension:Lnet/minecraft/registry/RegistryKey;
    • showIcons

      private final boolean showIcons
      Mappings:
      Namespace Name Mixin selector
      official l Legb;l:Z
      intermediary field_114 Lnet/minecraft/class_22;field_114:Z
      named showIcons Lnet/minecraft/item/map/MapState;showIcons:Z
    • unlimitedTracking

      private final boolean unlimitedTracking
      Mappings:
      Namespace Name Mixin selector
      official m Legb;m:Z
      intermediary field_113 Lnet/minecraft/class_22;field_113:Z
      named unlimitedTracking Lnet/minecraft/item/map/MapState;unlimitedTracking:Z
    • scale

      public final byte scale
      Mappings:
      Namespace Name Mixin selector
      official f Legb;f:B
      intermediary field_119 Lnet/minecraft/class_22;field_119:B
      named scale Lnet/minecraft/item/map/MapState;scale:B
    • colors

      public byte[] colors
      Mappings:
      Namespace Name Mixin selector
      official g Legb;g:[B
      intermediary field_122 Lnet/minecraft/class_22;field_122:[B
      named colors Lnet/minecraft/item/map/MapState;colors:[B
    • locked

      public final boolean locked
      Mappings:
      Namespace Name Mixin selector
      official h Legb;h:Z
      intermediary field_17403 Lnet/minecraft/class_22;field_17403:Z
      named locked Lnet/minecraft/item/map/MapState;locked:Z
    • updateTrackers

      private final List<MapState.PlayerUpdateTracker> updateTrackers
      Mappings:
      Namespace Name Mixin selector
      official n Legb;n:Ljava/util/List;
      intermediary field_112 Lnet/minecraft/class_22;field_112:Ljava/util/List;
      named updateTrackers Lnet/minecraft/item/map/MapState;updateTrackers:Ljava/util/List;
    • updateTrackersByPlayer

      private final Map<PlayerEntity,MapState.PlayerUpdateTracker> updateTrackersByPlayer
      Mappings:
      Namespace Name Mixin selector
      official o Legb;o:Ljava/util/Map;
      intermediary field_120 Lnet/minecraft/class_22;field_120:Ljava/util/Map;
      named updateTrackersByPlayer Lnet/minecraft/item/map/MapState;updateTrackersByPlayer:Ljava/util/Map;
    • banners

      private final Map<String,MapBannerMarker> banners
      The banner markers to track in world.

      Empty for the client.

      Mappings:
      Namespace Name Mixin selector
      official p Legb;p:Ljava/util/Map;
      intermediary field_123 Lnet/minecraft/class_22;field_123:Ljava/util/Map;
      named banners Lnet/minecraft/item/map/MapState;banners:Ljava/util/Map;
    • icons

      final Map<String,MapIcon> icons
      Mappings:
      Namespace Name Mixin selector
      official q Legb;q:Ljava/util/Map;
      intermediary field_117 Lnet/minecraft/class_22;field_117:Ljava/util/Map;
      named icons Lnet/minecraft/item/map/MapState;icons:Ljava/util/Map;
    • frames

      private final Map<String,MapFrameMarker> frames
      Mappings:
      Namespace Name Mixin selector
      official r Legb;r:Ljava/util/Map;
      intermediary field_121 Lnet/minecraft/class_22;field_121:Ljava/util/Map;
      named frames Lnet/minecraft/item/map/MapState;frames:Ljava/util/Map;
    • iconCount

      private int iconCount
      Mappings:
      Namespace Name Mixin selector
      official s Legb;s:I
      intermediary field_33992 Lnet/minecraft/class_22;field_33992:I
      named iconCount Lnet/minecraft/item/map/MapState;iconCount:I
  • Constructor Details

    • MapState

      private MapState(int centerX, int centerZ, byte scale, boolean showIcons, boolean unlimitedTracking, boolean locked, RegistryKey<World> dimension)
      Mappings:
      Namespace Name Mixin selector
      official <init> Legb;<init>(IIBZZZLahf;)V
      intermediary <init> Lnet/minecraft/class_22;<init>(IIBZZZLnet/minecraft/class_5321;)V
      named <init> Lnet/minecraft/item/map/MapState;<init>(IIBZZZLnet/minecraft/registry/RegistryKey;)V
  • Method Details

    • getPersistentStateType

      public static PersistentState.Type<MapState> getPersistentStateType()
      Mappings:
      Namespace Name Mixin selector
      official a Legb;a()Lefw$a;
      intermediary method_52611 Lnet/minecraft/class_22;method_52611()Lnet/minecraft/class_18$class_8645;
      named getPersistentStateType Lnet/minecraft/item/map/MapState;getPersistentStateType()Lnet/minecraft/world/PersistentState$Type;
    • of

      public static MapState of(double centerX, double centerZ, byte scale, boolean showIcons, boolean unlimitedTracking, RegistryKey<World> dimension)
      Creates a new map state instance.
      Parameters:
      centerX - the absolute center X-coordinate
      centerZ - the absolute center Z-coordinate
      Mappings:
      Namespace Name Mixin selector
      official a Legb;a(DDBZZLahf;)Legb;
      intermediary method_32363 Lnet/minecraft/class_22;method_32363(DDBZZLnet/minecraft/class_5321;)Lnet/minecraft/class_22;
      named of Lnet/minecraft/item/map/MapState;of(DDBZZLnet/minecraft/registry/RegistryKey;)Lnet/minecraft/item/map/MapState;
    • of

      public static MapState of(byte scale, boolean locked, RegistryKey<World> dimension)
      Creates a new map state instance for the client.

      The client is not aware of the coordinates of the map state so its center coordinates will always be (0, 0).

      Mappings:
      Namespace Name Mixin selector
      official a Legb;a(BZLahf;)Legb;
      intermediary method_32362 Lnet/minecraft/class_22;method_32362(BZLnet/minecraft/class_5321;)Lnet/minecraft/class_22;
      named of Lnet/minecraft/item/map/MapState;of(BZLnet/minecraft/registry/RegistryKey;)Lnet/minecraft/item/map/MapState;
    • fromNbt

      public static MapState fromNbt(NbtCompound nbt)
      Mappings:
      Namespace Name Mixin selector
      official b Legb;b(Lsn;)Legb;
      intermediary method_32371 Lnet/minecraft/class_22;method_32371(Lnet/minecraft/class_2487;)Lnet/minecraft/class_22;
      named fromNbt Lnet/minecraft/item/map/MapState;fromNbt(Lnet/minecraft/nbt/NbtCompound;)Lnet/minecraft/item/map/MapState;
    • writeNbt

      public NbtCompound writeNbt(NbtCompound nbt)
      Specified by:
      writeNbt in class PersistentState
      Mappings:
      Namespace Name Mixin selector
      official a Lefw;a(Lsn;)Lsn;
      intermediary method_75 Lnet/minecraft/class_18;method_75(Lnet/minecraft/class_2487;)Lnet/minecraft/class_2487;
      named writeNbt Lnet/minecraft/world/PersistentState;writeNbt(Lnet/minecraft/nbt/NbtCompound;)Lnet/minecraft/nbt/NbtCompound;
    • copy

      public MapState copy()
      Mappings:
      Namespace Name Mixin selector
      official b Legb;b()Legb;
      intermediary method_32361 Lnet/minecraft/class_22;method_32361()Lnet/minecraft/class_22;
      named copy Lnet/minecraft/item/map/MapState;copy()Lnet/minecraft/item/map/MapState;
    • zoomOut

      public MapState zoomOut(int zoomOutScale)
      Creates a new map state which is a zoomed out version of the current one.

      The scale of the new map state is currentScale + zoomOutScale and clamped between 0 and 4.

      The colors are not copied, neither are the icons.

      Parameters:
      zoomOutScale - the amount to add to the scale of the map
      Mappings:
      Namespace Name Mixin selector
      official a Legb;a(I)Legb;
      intermediary method_32364 Lnet/minecraft/class_22;method_32364(I)Lnet/minecraft/class_22;
      named zoomOut Lnet/minecraft/item/map/MapState;zoomOut(I)Lnet/minecraft/item/map/MapState;
    • update

      public void update(PlayerEntity player, ItemStack stack)
      Mappings:
      Namespace Name Mixin selector
      official a Legb;a(Lcfi;Lcmy;)V
      intermediary method_102 Lnet/minecraft/class_22;method_102(Lnet/minecraft/class_1657;Lnet/minecraft/class_1799;)V
      named update Lnet/minecraft/item/map/MapState;update(Lnet/minecraft/entity/player/PlayerEntity;Lnet/minecraft/item/ItemStack;)V
    • removeIcon

      private void removeIcon(String id)
      Mappings:
      Namespace Name Mixin selector
      official a Legb;a(Ljava/lang/String;)V
      intermediary method_32368 Lnet/minecraft/class_22;method_32368(Ljava/lang/String;)V
      named removeIcon Lnet/minecraft/item/map/MapState;removeIcon(Ljava/lang/String;)V
    • addDecorationsNbt

      public static void addDecorationsNbt(ItemStack stack, BlockPos pos, String id, MapIcon.Type type)
      Mappings:
      Namespace Name Mixin selector
      official a Legb;a(Lcmy;Lhx;Ljava/lang/String;Lefy$a;)V
      intermediary method_110 Lnet/minecraft/class_22;method_110(Lnet/minecraft/class_1799;Lnet/minecraft/class_2338;Ljava/lang/String;Lnet/minecraft/class_20$class_21;)V
      named addDecorationsNbt Lnet/minecraft/item/map/MapState;addDecorationsNbt(Lnet/minecraft/item/ItemStack;Lnet/minecraft/util/math/BlockPos;Ljava/lang/String;Lnet/minecraft/item/map/MapIcon$Type;)V
    • addIcon

      private void addIcon(MapIcon.Type type, @Nullable @Nullable WorldAccess world, String key, double x, double z, double rotation, @Nullable @Nullable Text text)
      Mappings:
      Namespace Name Mixin selector
      official a Legb;a(Lefy$a;Lctq;Ljava/lang/String;DDDLvf;)V
      intermediary method_107 Lnet/minecraft/class_22;method_107(Lnet/minecraft/class_20$class_21;Lnet/minecraft/class_1936;Ljava/lang/String;DDDLnet/minecraft/class_2561;)V
      named addIcon Lnet/minecraft/item/map/MapState;addIcon(Lnet/minecraft/item/map/MapIcon$Type;Lnet/minecraft/world/WorldAccess;Ljava/lang/String;DDDLnet/minecraft/text/Text;)V
    • getPlayerMarkerPacket

      @Nullable public @Nullable Packet<?> getPlayerMarkerPacket(int id, PlayerEntity player)
      Mappings:
      Namespace Name Mixin selector
      official a Legb;a(ILcfi;)Lxf;
      intermediary method_100 Lnet/minecraft/class_22;method_100(ILnet/minecraft/class_1657;)Lnet/minecraft/class_2596;
      named getPlayerMarkerPacket Lnet/minecraft/item/map/MapState;getPlayerMarkerPacket(ILnet/minecraft/entity/player/PlayerEntity;)Lnet/minecraft/network/packet/Packet;
    • markDirty

      private void markDirty(int x, int z)
      Mappings:
      Namespace Name Mixin selector
      official a Legb;a(II)V
      intermediary method_103 Lnet/minecraft/class_22;method_103(II)V
      named markDirty Lnet/minecraft/item/map/MapState;markDirty(II)V
    • markIconsDirty

      private void markIconsDirty()
      Mappings:
      Namespace Name Mixin selector
      official h Legb;h()V
      intermediary method_32374 Lnet/minecraft/class_22;method_32374()V
      named markIconsDirty Lnet/minecraft/item/map/MapState;markIconsDirty()V
    • getPlayerSyncData

      public MapState.PlayerUpdateTracker getPlayerSyncData(PlayerEntity player)
      Mappings:
      Namespace Name Mixin selector
      official a Legb;a(Lcfi;)Legb$a;
      intermediary method_101 Lnet/minecraft/class_22;method_101(Lnet/minecraft/class_1657;)Lnet/minecraft/class_22$class_23;
      named getPlayerSyncData Lnet/minecraft/item/map/MapState;getPlayerSyncData(Lnet/minecraft/entity/player/PlayerEntity;)Lnet/minecraft/item/map/MapState$PlayerUpdateTracker;
    • addBanner

      public boolean addBanner(WorldAccess world, BlockPos pos)
      Mappings:
      Namespace Name Mixin selector
      official a Legb;a(Lctq;Lhx;)Z
      intermediary method_108 Lnet/minecraft/class_22;method_108(Lnet/minecraft/class_1936;Lnet/minecraft/class_2338;)Z
      named addBanner Lnet/minecraft/item/map/MapState;addBanner(Lnet/minecraft/world/WorldAccess;Lnet/minecraft/util/math/BlockPos;)Z
    • removeBanner

      public void removeBanner(BlockView world, int x, int z)
      Mappings:
      Namespace Name Mixin selector
      official a Legb;a(Lcsv;II)V
      intermediary method_109 Lnet/minecraft/class_22;method_109(Lnet/minecraft/class_1922;II)V
      named removeBanner Lnet/minecraft/item/map/MapState;removeBanner(Lnet/minecraft/world/BlockView;II)V
    • getBanners

      public Collection<MapBannerMarker> getBanners()
      Mappings:
      Namespace Name Mixin selector
      official e Legb;e()Ljava/util/Collection;
      intermediary method_35503 Lnet/minecraft/class_22;method_35503()Ljava/util/Collection;
      named getBanners Lnet/minecraft/item/map/MapState;getBanners()Ljava/util/Collection;
    • removeFrame

      public void removeFrame(BlockPos pos, int id)
      Mappings:
      Namespace Name Mixin selector
      official a Legb;a(Lhx;I)V
      intermediary method_104 Lnet/minecraft/class_22;method_104(Lnet/minecraft/class_2338;I)V
      named removeFrame Lnet/minecraft/item/map/MapState;removeFrame(Lnet/minecraft/util/math/BlockPos;I)V
    • putColor

      public boolean putColor(int x, int z, byte color)
      Sets the color at the specified coordinates if the current color is different.
      Returns:
      true if the color has been updated, else false
      Mappings:
      Namespace Name Mixin selector
      official a Legb;a(IIB)Z
      intermediary method_32365 Lnet/minecraft/class_22;method_32365(IIB)Z
      named putColor Lnet/minecraft/item/map/MapState;putColor(IIB)Z
    • setColor

      public void setColor(int x, int z, byte color)
      Mappings:
      Namespace Name Mixin selector
      official b Legb;b(IIB)V
      intermediary method_32370 Lnet/minecraft/class_22;method_32370(IIB)V
      named setColor Lnet/minecraft/item/map/MapState;setColor(IIB)V
    • hasMonumentIcon

      public boolean hasMonumentIcon()
      Mappings:
      Namespace Name Mixin selector
      official f Legb;f()Z
      intermediary method_32372 Lnet/minecraft/class_22;method_32372()Z
      named hasMonumentIcon Lnet/minecraft/item/map/MapState;hasMonumentIcon()Z
    • replaceIcons

      public void replaceIcons(List<MapIcon> icons)
      Mappings:
      Namespace Name Mixin selector
      official a Legb;a(Ljava/util/List;)V
      intermediary method_32369 Lnet/minecraft/class_22;method_32369(Ljava/util/List;)V
      named replaceIcons Lnet/minecraft/item/map/MapState;replaceIcons(Ljava/util/List;)V
    • getIcons

      public Iterable<MapIcon> getIcons()
      Mappings:
      Namespace Name Mixin selector
      official g Legb;g()Ljava/lang/Iterable;
      intermediary method_32373 Lnet/minecraft/class_22;method_32373()Ljava/lang/Iterable;
      named getIcons Lnet/minecraft/item/map/MapState;getIcons()Ljava/lang/Iterable;
    • iconCountNotLessThan

      public boolean iconCountNotLessThan(int iconCount)
      Mappings:
      Namespace Name Mixin selector
      official b Legb;b(I)Z
      intermediary method_37343 Lnet/minecraft/class_22;method_37343(I)Z
      named iconCountNotLessThan Lnet/minecraft/item/map/MapState;iconCountNotLessThan(I)Z