Class MapItemSavedData
java.lang.Object
net.minecraft.world.level.saveddata.SavedData
net.minecraft.world.level.saveddata.maps.MapItemSavedData
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
(package private) static final record
static final record
Nested classes/interfaces inherited from class net.minecraft.world.level.saveddata.SavedData
SavedData.Context
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List
<MapItemSavedData.HoldingPlayer> private final Map
<Player, MapItemSavedData.HoldingPlayer> final int
final int
static final com.mojang.serialization.Codec
<MapItemSavedData> byte[]
(package private) final Map
<String, MapDecoration> final ResourceKey
<Level> private static final String
private static final int
final boolean
private static final org.slf4j.Logger
private static final int
static final int
final byte
static final int
private int
private final boolean
private final boolean
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
MapItemSavedData
(int pX, int pZ, byte pScale, boolean pTrackingPosition, boolean pUnlimitedTracking, boolean pLocked, ResourceKey<Level> pDimension) 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 Summary
Modifier and TypeMethodDescriptionvoid
addClientSideDecorations
(List<MapDecoration> pDecorations) void
addDecoration
(Holder<MapDecorationType> pDecorationType, LevelAccessor pLevel, String pId, double pX, double pZ, double pYRot, Component pDisplayName) static void
addTargetDecoration
(ItemStack pStack, BlockPos pPos, String pType, Holder<MapDecorationType> pMapDecorationType) calculateDecorationLocationAndType
(Holder<MapDecorationType> pDecorationType, LevelAccessor pLevel, double pYRot, float pX, float pZ) private byte
calculateRotation
(LevelAccessor pLevel, double pYRot) void
checkBanners
(BlockGetter pReader, int pX, int pZ) private static byte
clampMapCoordinate
(float pCoord) static MapItemSavedData
createForClient
(byte pScale, boolean pLocked, ResourceKey<Level> pDimension) static MapItemSavedData
createFresh
(double pX, double pZ, byte pScale, boolean pTrackingPosition, boolean pUnlimitedTracking, ResourceKey<Level> pDimension) private Holder
<MapDecorationType> decorationTypeForPlayerOutsideMap
(float pX, float pZ) private static String
getFrameKey
(int pEntityId) getHoldingPlayer
(Player pPlayer) Packet
<?> getUpdatePacket
(MapId pMapId, Player pPlayer) private static boolean
hasMapInvisibilityItemEquipped
(Player pPlayer) boolean
private static boolean
isInsideMap
(float pX, float pZ) boolean
isTrackedCountOverLimit
(int pTrackedCount) locked()
mapMatcher
(ItemStack pStack) private com.mojang.datafixers.util.Pair
<Holder<MapDecorationType>, Byte> playerDecorationTypeAndRotation
(Holder<MapDecorationType> p_360887_, LevelAccessor p_362947_, double p_365360_, float p_361112_, float p_361088_) void
removeDecoration
(String pIdentifier) void
removedFromFrame
(BlockPos pPos, int pEntityId) scaled()
void
setColor
(int pX, int pZ, byte pColor) private void
setColorsDirty
(int pX, int pZ) private void
void
tickCarriedBy
(Player pPlayer, ItemStack pMapStack) Adds the player passed to the list of visible players and checks to see which players are visibleboolean
toggleBanner
(LevelAccessor pAccessor, BlockPos pPos) static SavedDataType
<MapItemSavedData> boolean
updateColor
(int pX, int pZ, byte pColor)
-
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:
-
CODEC
-
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 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
-
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
-
scaled
-
mapMatcher
-
tickCarriedBy
Adds the player passed to the list of visible players and checks to see which players are visible -
hasMapInvisibilityItemEquipped
-
removeDecoration
-
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
-
isInsideMap
private static boolean isInsideMap(float pX, float pZ) -
decorationTypeForPlayerOutsideMap
-
clampMapCoordinate
private static byte clampMapCoordinate(float pCoord) -
getUpdatePacket
-
setColorsDirty
private void setColorsDirty(int pX, int pZ) -
setDecorationsDirty
private void setDecorationsDirty() -
getHoldingPlayer
-
toggleBanner
-
checkBanners
-
getBanners
-
removedFromFrame
-
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
-
getDecorations
-
isTrackedCountOverLimit
public boolean isTrackedCountOverLimit(int pTrackedCount) -
getFrameKey
-