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 centerX, int centerZ, byte scale, boolean trackingPosition, boolean unlimitedTracking, boolean locked, ResourceKey<Level> dimension)
    • MapItemSavedData

      private MapItemSavedData(ResourceKey<Level> dimension, int centerX, int centerZ, byte scale, ByteBuffer colors, boolean trackingPosition, boolean unlimitedTracking, boolean locked, List<MapBanner> banners, List<MapFrame> frames)
  • Method Details

    • type

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

      public static MapItemSavedData createFresh(double originX, double originY, byte scale, boolean trackingPosition, boolean unlimitedTracking, ResourceKey<Level> dimension)
    • createForClient

      public static MapItemSavedData createForClient(byte scale, boolean isLocked, ResourceKey<Level> dimension)
    • locked

      public MapItemSavedData locked()
    • scaled

      public MapItemSavedData scaled()
    • mapMatcher

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

      public void tickCarriedBy(Player tickingPlayer, ItemStack itemStack)
    • hasMapInvisibilityItemEquipped

      private static boolean hasMapInvisibilityItemEquipped(Player player)
    • removeDecoration

      public void removeDecoration(String string)
    • addTargetDecoration

      public static void addTargetDecoration(ItemStack itemStack, BlockPos position, String key, Holder<MapDecorationType> decorationType)
    • addDecoration

      public void addDecoration(Holder<MapDecorationType> type, @Nullable LevelAccessor level, String key, double xPos, double zPos, double yRot, @Nullable Component name)
    • calculateDecorationLocationAndType

      private @Nullable MapItemSavedData.MapDecorationLocation calculateDecorationLocationAndType(Holder<MapDecorationType> type, @Nullable LevelAccessor level, double yRot, float xDeltaFromCenter, float yDeltaFromCenter)
    • playerDecorationTypeAndRotation

      private @Nullable com.mojang.datafixers.util.Pair<Holder<MapDecorationType>, Byte> playerDecorationTypeAndRotation(Holder<MapDecorationType> type, @Nullable LevelAccessor level, double yRot, float xDeltaFromCenter, float yDeltaFromCenter)
    • calculateRotation

      private byte calculateRotation(@Nullable LevelAccessor level, double yRot)
    • isInsideMap

      private static boolean isInsideMap(float xd, float yd)
    • decorationTypeForPlayerOutsideMap

      private @Nullable Holder<MapDecorationType> decorationTypeForPlayerOutsideMap(float xDeltaFromCenter, float yDeltaFromCenter)
    • clampMapCoordinate

      private static byte clampMapCoordinate(float deltaFromCenter)
    • getUpdatePacket

      public @Nullable Packet<?> getUpdatePacket(MapId id, Player player)
    • setColorsDirty

      private void setColorsDirty(int x, int y)
    • setDecorationsDirty

      private void setDecorationsDirty()
    • getHoldingPlayer

      public MapItemSavedData.HoldingPlayer getHoldingPlayer(Player player)
    • toggleBanner

      public boolean toggleBanner(LevelAccessor level, BlockPos pos)
    • checkBanners

      public void checkBanners(BlockGetter level, int x, int z)
    • getBanners

      public Collection<MapBanner> getBanners()
    • removedFromFrame

      public void removedFromFrame(BlockPos pos, int entityID)
    • updateColor

      public boolean updateColor(int x, int y, byte newColor)
    • setColor

      public void setColor(int x, int y, byte newColor)
    • isExplorationMap

      public boolean isExplorationMap()
    • addClientSideDecorations

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

      public Iterable<MapDecoration> getDecorations()
    • isTrackedCountOverLimit

      public boolean isTrackedCountOverLimit(int limit)
    • getFrameKey

      private static String getFrameKey(int id)