32class MapItemSavedData {
46 ::ll::TypedStorage<4, 4, uint> x0;
47 ::ll::TypedStorage<4, 4, uint> z0;
48 ::ll::TypedStorage<4, 4, uint> x1;
49 ::ll::TypedStorage<4, 4, uint> z1;
57 ::ll::TypedStorage<1, 1, ::MapDecoration::Type> type;
58 ::ll::TypedStorage<4, 4, int> x;
59 ::ll::TypedStorage<4, 4, int> y;
60 ::ll::TypedStorage<4, 4, int> rot;
68 ::ll::TypedStorage<1, 1, ::MapDecoration::Type> type;
69 ::ll::TypedStorage<4, 4, int> rotation;
73 using DecorationCollection =
74 ::std::vector<::std::pair<::MapItemTrackedActor::UniqueId, ::std::shared_ptr<::MapDecoration>>>;
79 ::ll::TypedStorage<8, 8, uint64> mUpdateInterval;
80 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mMapId;
81 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mParentMapId;
82 ::ll::TypedStorage<1, 1, bool> mIsFullyExplored;
83 ::ll::TypedStorage<1, 1, bool> mPreviewIncomplete;
84 ::ll::TypedStorage<4, 12, ::BlockPos> mOrigin;
85 ::ll::TypedStorage<4, 4, ::DimensionType> mDimension;
86 ::ll::TypedStorage<1, 1, schar> mScale;
87 ::ll::TypedStorage<8, 24, ::std::vector<uint>> mPixels;
88 ::ll::TypedStorage<8, 24, ::std::vector<::ClientTerrainPixel>> mClientPixels;
89 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::MapItemTrackedActor>>> mTrackedEntities;
90 ::ll::TypedStorage<1, 1, bool> mUnlimitedTracking;
91 ::ll::TypedStorage<1, 1, bool> mDirtyForSave;
92 ::ll::TypedStorage<1, 1, bool> mDirtyPixelData;
93 ::ll::TypedStorage<1, 1, bool> mLocked;
97 ::std::vector<::std::pair<::MapItemTrackedActor::UniqueId, ::std::shared_ptr<::MapDecoration>>>>
99 ::ll::TypedStorage<1, 1, bool> mHasDirtyClientPixels;
100 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::SpinLockImpl>> mClientSamplingLock;
101 ::ll::TypedStorage<1, 1, bool> mNeedsResampling;
102 ::ll::TypedStorage<1, 1, bool> mIsDLCWorld;
114 MCAPI
void _addDecoration(
115 ::MapDecoration::Type type,
118 ::std::string
const& label,
122 MCAPI ::std::shared_ptr<::MapItemTrackedActor> _addTrackedMapEntity(
125 ::MapDecoration::Type decorationType
128 MCAPI ::MapItemSavedData::MapDecorationContext _calculateDecorationLocationAndType(
129 ::MapDecoration::Type type,
131 int xDeltaFromCenter,
132 int yDeltaFromCenter,
136 MCAPI ::MapItemSavedData::MapDecorationTypeAndRotation _calculatePlayerDecorationTypeAndRotation(
137 ::MapDecoration::Type type,
139 int xDeltaFromCenter,
140 int yDeltaFromCenter,
144 MCAPI
void _clampOriginWithinLimitedWorld(
::BlockPos& origin,
::Vec3 const& worldCenter,
int scaledMapSize)
const;
148 MCAPI
bool _isPlayerHoldingMap(
::Player& player);
155 _updateTrackedEntityDecoration(
::BlockSource& region, ::std::shared_ptr<::MapItemTrackedActor> trackedActor);
157 MCAPI
void _updateTrackedEntityDecorations(
::BlockSource& region);
159 MCAPI
void _updateTrackedPlayerDecorations(
163 ::std::string& decorationLabel,
166 ::MapDecoration::Type& type
174 MCAPI ::std::shared_ptr<::MapItemTrackedActor>
175 addTrackedMapEntity(
::Actor& entity, ::MapDecoration::Type decorationType);
177 MCAPI ::std::shared_ptr<::MapItemTrackedActor>
180 MCFOLD
bool areClientPixelsDirty()
const;
182 MCAPI
void checkNeedsResampling();
184 MCAPI
void copyMapData(::MapItemSavedData
const& map);
188 MCAPI
void enableUnlimitedTracking();
190 MCFOLD ::std::vector<::ClientTerrainPixel>& getClientPixels();
192 MCAPI ::SpinLockImpl* getClientSamplingLock();
194 MCAPI ::std::unique_ptr<::Packet> getFullDataPacket()
const;
196 MCFOLD ::ActorUniqueID getMapId()
const;
198 MCFOLD ::ActorUniqueID getParentMapId()
const;
200 MCAPI ::buffer_span<uint> getPixels()
const;
202 MCAPI ::std::shared_ptr<::MapItemTrackedActor> getTrackedMapEntity(
::Actor& entity);
204 MCAPI ::std::unique_ptr<::Packet> getUpdatePacket(
::Level&,
::BlockPos const& pos)
const;
208 MCAPI
bool hasParentMap()
const;
210 MCAPI
bool isAdjacent(::MapItemSavedData
const& other,
int dir)
const;
214 MCAPI
bool isFullyExplored()
const;
216 MCAPI
bool isLocked()
const;
219 MCFOLD
bool isPixelDataDirty()
const;
222 MCAPI
bool needsResampling()
const;
224 MCAPI
void removeTrackedMapEntity(
::BlockPos const& position);
227 MCAPI
void replaceDecorations(
228 ::std::vector<::std::shared_ptr<::MapDecoration>> decorations,
229 ::std::vector<::MapItemTrackedActor::UniqueId>
const& uniqueIds
232 MCAPI
void replacePixels(
::buffer_span<uint> mapPixels, uint startX, uint startY, uint width, uint height);
239 MCFOLD
void setClientPixelsDirty(
bool isDirty);
245 MCAPI
void setDirtyForSaveAndPixelData();
247 MCAPI
void setLocked();
251 MCAPI
void setOrigin(
260 MCAPI
bool setPixel(uint color, uint x, uint y);
263 MCAPI
void setPixelDataClean();
266 MCAPI
void setScale(
int mapScale);
268 MCAPI
void setScaleAndParentMapId(
int mapScale,
::ActorUniqueID parentMapId);
276 MCAPI ~MapItemSavedData();
283 MCAPI static ::AABB getMapWorldBounds(
::BlockPos const& mapOrigin,
int blocksPerTexel,
int offset);