Class MapItemSavedData
java.lang.Object
net.minecraft.world.level.saveddata.SavedData
net.minecraft.world.level.saveddata.maps.MapItemSavedData
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassstatic final recordNested classes/interfaces inherited from class net.minecraft.world.level.saveddata.SavedData
SavedData.Factory<T extends SavedData> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<MapItemSavedData.HoldingPlayer> private final Map<Player, MapItemSavedData.HoldingPlayer> final intfinal intbyte[](package private) final Map<String, MapDecoration> final ResourceKey<Level> private static final Stringprivate static final intfinal booleanprivate static final org.slf4j.Loggerprivate static final intstatic final intfinal bytestatic final intprivate intprivate final booleanprivate final boolean -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateMapItemSavedData(int x, int z, byte scale, boolean trackingPosition, boolean unlimitedTracking, boolean locked, ResourceKey<Level> dimension) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddClientSideDecorations(List<MapDecoration> decorations) voidaddDecoration(Holder<MapDecorationType> decorationType, LevelAccessor level, String id, double x, double z, double yRot, Component displayName) static voidaddTargetDecoration(ItemStack stack, BlockPos pos, String type, Holder<MapDecorationType> mapDecorationType) voidcheckBanners(BlockGetter reader, int x, int z) static MapItemSavedDatacreateForClient(byte scale, boolean locked, ResourceKey<Level> dimension) static MapItemSavedDatacreateFresh(double x, double z, byte scale, boolean trackingPosition, boolean unlimitedTracking, ResourceKey<Level> dimension) static SavedData.Factory<MapItemSavedData> factory()private static StringgetFrameKey(int entityId) getHoldingPlayer(Player player) Packet<?> getUpdatePacket(MapId mapId, Player player) booleanbooleanisTrackedCountOverLimit(int trackedCount) static MapItemSavedDataload(CompoundTag tag, HolderLookup.Provider levelRegistry) locked()mapMatcher(ItemStack stack) voidremoveDecoration(String identifier) voidremovedFromFrame(BlockPos pos, int entityId) save(CompoundTag tag, HolderLookup.Provider registries) scaled()voidsetColor(int x, int z, byte color) private voidsetColorsDirty(int x, int z) private voidvoidtickCarriedBy(Player player, ItemStack mapStack) Adds the player passed to the list of visible players and checks to see which players are visiblebooleantoggleBanner(LevelAccessor accessor, BlockPos pos) booleanupdateColor(int x, int z, byte color)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
MAP_SIZE
private static final int MAP_SIZE- See Also:
-
HALF_MAP_SIZE
private static final int HALF_MAP_SIZE- See Also:
-
MAX_SCALE
public static final int MAX_SCALE- See Also:
-
TRACKED_DECORATION_LIMIT
public static final int TRACKED_DECORATION_LIMIT- See Also:
-
FRAME_PREFIX
- See Also:
-
centerX
public final int centerX -
centerZ
public final int centerZ -
dimension
-
trackingPosition
private final boolean trackingPosition -
unlimitedTracking
private final boolean unlimitedTracking -
scale
public final byte scale -
colors
public byte[] colors -
locked
public final boolean locked -
carriedBy
-
carriedByPlayers
-
bannerMarkers
-
decorations
-
frameMarkers
-
trackedDecorationCount
private int trackedDecorationCount
-
-
Constructor Details
-
MapItemSavedData
private MapItemSavedData(int x, int z, byte scale, boolean trackingPosition, boolean unlimitedTracking, boolean locked, ResourceKey<Level> dimension)
-
-
Method Details
-
factory
-
createFresh
public static MapItemSavedData createFresh(double x, double z, byte scale, boolean trackingPosition, boolean unlimitedTracking, ResourceKey<Level> dimension) -
createForClient
public static MapItemSavedData createForClient(byte scale, boolean locked, ResourceKey<Level> dimension) -
load
-
save
-
locked
-
scaled
-
mapMatcher
-
tickCarriedBy
Adds the player passed to the list of visible players and checks to see which players are visible -
removeDecoration
-
addTargetDecoration
public static void addTargetDecoration(ItemStack stack, BlockPos pos, String type, Holder<MapDecorationType> mapDecorationType) -
addDecoration
public void addDecoration(Holder<MapDecorationType> decorationType, @Nullable LevelAccessor level, String id, double x, double z, double yRot, @Nullable Component displayName) -
getUpdatePacket
-
setColorsDirty
private void setColorsDirty(int x, int z) -
setDecorationsDirty
private void setDecorationsDirty() -
getHoldingPlayer
-
toggleBanner
-
checkBanners
-
getBanners
-
removedFromFrame
-
updateColor
public boolean updateColor(int x, int z, byte color) -
setColor
public void setColor(int x, int z, byte color) -
isExplorationMap
public boolean isExplorationMap() -
addClientSideDecorations
-
getDecorations
-
isTrackedCountOverLimit
public boolean isTrackedCountOverLimit(int trackedCount) -
getFrameKey
-