Class MapItemSavedData

java.lang.Object
net.minecraft.world.level.saveddata.SavedData
net.minecraft.world.level.saveddata.maps.MapItemSavedData

public class MapItemSavedData extends SavedData
  • Field Details

  • Constructor Details

    • MapItemSavedData

      private MapItemSavedData(int pX, int pZ, byte pScale, boolean pTrackingPosition, boolean pUnlimitedTracking, boolean pLocked, ResourceKey<Level> pDimension)
    • MapItemSavedData

      private MapItemSavedData(ResourceKey<Level> p_401030_, int p_401084_, int p_401048_, byte p_401197_, ByteBuffer p_401348_, boolean p_401353_, boolean p_401003_, boolean p_401306_, List<MapBanner> p_401007_, List<MapFrame> p_401318_)
  • Method Details

    • type

      public static SavedDataType<MapItemSavedData> type(MapId pMapId)
    • createFresh

      public static MapItemSavedData createFresh(double pX, double pZ, byte pScale, boolean pTrackingPosition, boolean pUnlimitedTracking, ResourceKey<Level> pDimension)
    • createForClient

      public static MapItemSavedData createForClient(byte pScale, boolean pLocked, ResourceKey<Level> pDimension)
    • locked

      public MapItemSavedData locked()
    • scaled

      public MapItemSavedData scaled()
    • mapMatcher

      private static Predicate<ItemStack> mapMatcher(ItemStack pStack)
    • tickCarriedBy

      public void tickCarriedBy(Player pPlayer, ItemStack pMapStack)
      Adds the player passed to the list of visible players and checks to see which players are visible
    • hasMapInvisibilityItemEquipped

      private static boolean hasMapInvisibilityItemEquipped(Player pPlayer)
    • removeDecoration

      public void removeDecoration(String pIdentifier)
    • addTargetDecoration

      public static void addTargetDecoration(ItemStack pStack, BlockPos pPos, String pType, Holder<MapDecorationType> pMapDecorationType)
    • addDecoration

      public void addDecoration(Holder<MapDecorationType> pDecorationType, @Nullable LevelAccessor pLevel, String pId, double pX, double pZ, double pYRot, @Nullable Component pDisplayName)
    • calculateDecorationLocationAndType

      @Nullable private MapItemSavedData.MapDecorationLocation calculateDecorationLocationAndType(Holder<MapDecorationType> pDecorationType, @Nullable LevelAccessor pLevel, double pYRot, float pX, float pZ)
    • playerDecorationTypeAndRotation

      @Nullable private com.mojang.datafixers.util.Pair<Holder<MapDecorationType>,Byte> playerDecorationTypeAndRotation(Holder<MapDecorationType> p_360887_, @Nullable LevelAccessor p_362947_, double p_365360_, float p_361112_, float p_361088_)
    • calculateRotation

      private byte calculateRotation(@Nullable LevelAccessor pLevel, double pYRot)
    • isInsideMap

      private static boolean isInsideMap(float pX, float pZ)
    • decorationTypeForPlayerOutsideMap

      @Nullable private Holder<MapDecorationType> decorationTypeForPlayerOutsideMap(float pX, float pZ)
    • clampMapCoordinate

      private static byte clampMapCoordinate(float pCoord)
    • getUpdatePacket

      @Nullable public Packet<?> getUpdatePacket(MapId pMapId, Player pPlayer)
    • setColorsDirty

      private void setColorsDirty(int pX, int pZ)
    • setDecorationsDirty

      private void setDecorationsDirty()
    • getHoldingPlayer

      public MapItemSavedData.HoldingPlayer getHoldingPlayer(Player pPlayer)
    • toggleBanner

      public boolean toggleBanner(LevelAccessor pAccessor, BlockPos pPos)
    • checkBanners

      public void checkBanners(BlockGetter pReader, int pX, int pZ)
    • getBanners

      public Collection<MapBanner> getBanners()
    • removedFromFrame

      public void removedFromFrame(BlockPos pPos, int pEntityId)
    • updateColor

      public boolean updateColor(int pX, int pZ, byte pColor)
    • setColor

      public void setColor(int pX, int pZ, byte pColor)
    • isExplorationMap

      public boolean isExplorationMap()
    • addClientSideDecorations

      public void addClientSideDecorations(List<MapDecoration> pDecorations)
    • getDecorations

      public Iterable<MapDecoration> getDecorations()
    • isTrackedCountOverLimit

      public boolean isTrackedCountOverLimit(int pTrackedCount)
    • getFrameKey

      private static String getFrameKey(int pEntityId)