LeviLamina
Loading...
Searching...
No Matches
MapItemSavedData.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/utility/buffer_span.h"
7#include "mc/legacy/ActorUniqueID.h"
8#include "mc/world/level/BlockPos.h"
9#include "mc/world/level/dimension/DimensionType.h"
10#include "mc/world/level/saveddata/maps/MapDecoration.h"
11#include "mc/world/level/saveddata/maps/MapItemTrackedActor.h"
12
13// auto generated forward declare list
14// clang-format off
15class AABB;
16class Actor;
17class BlockSource;
18class CompoundTag;
19class ItemStack;
20class Level;
21class LevelStorage;
22class MapDecoration;
24class Packet;
25class Player;
26class SpinLockImpl;
27class Vec3;
29namespace mce { class Color; }
30// clang-format on
31
32class MapItemSavedData {
33public:
34 // MapItemSavedData inner types declare
35 // clang-format off
36 struct ChunkBounds;
39 // clang-format on
40
41 // MapItemSavedData inner types define
42 struct ChunkBounds {
43 public:
44 // member variables
45 // NOLINTBEGIN
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;
50 // NOLINTEND
51 };
52
54 public:
55 // member variables
56 // NOLINTBEGIN
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;
61 // NOLINTEND
62 };
63
65 public:
66 // member variables
67 // NOLINTBEGIN
68 ::ll::TypedStorage<1, 1, ::MapDecoration::Type> type;
69 ::ll::TypedStorage<4, 4, int> rotation;
70 // NOLINTEND
71 };
72
73 using DecorationCollection =
74 ::std::vector<::std::pair<::MapItemTrackedActor::UniqueId, ::std::shared_ptr<::MapDecoration>>>;
75
76public:
77 // member variables
78 // NOLINTBEGIN
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;
94 ::ll::TypedStorage<
95 8,
96 24,
97 ::std::vector<::std::pair<::MapItemTrackedActor::UniqueId, ::std::shared_ptr<::MapDecoration>>>>
98 mDecorations;
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;
103 // NOLINTEND
104
105public:
106 // prevent constructor by default
107 MapItemSavedData();
108
109public:
110 // member functions
111 // NOLINTBEGIN
112 MCAPI MapItemSavedData(::ActorUniqueID mapId, bool isDLCworld);
113
114 MCAPI void _addDecoration(
115 ::MapDecoration::Type type,
117 ::Vec3 const& position,
118 ::std::string const& label,
119 ::mce::Color const& color
120 );
121
122 MCAPI ::std::shared_ptr<::MapItemTrackedActor> _addTrackedMapEntity(
124 ::BlockSource& region,
125 ::MapDecoration::Type decorationType
126 );
127
128 MCAPI void _deserializeData(::CompoundTag const& tag);
129
130 MCAPI void _removeDecoration(::MapItemTrackedActor::UniqueId const& id);
131
132 MCAPI void _removeTrackedMapEntity(::MapItemTrackedActor::UniqueId const& key);
133
134 MCAPI bool
135 _updateTrackedEntityDecoration(::BlockSource& region, ::std::shared_ptr<::MapItemTrackedActor> trackedActor);
136
137 MCAPI void _updateTrackedEntityDecorations(::BlockSource& region);
138
139 MCAPI void copyMapData(::MapItemSavedData const& map);
140
141 MCAPI ::std::unique_ptr<::Packet> getFullDataPacket() const;
142
143 MCAPI ::std::shared_ptr<::MapItemTrackedActor> getTrackedMapEntity(::Actor& entity);
144
145 MCAPI ::std::unique_ptr<::Packet> getUpdatePacket(::Level&, ::BlockPos const& pos) const;
146
147 MCAPI ::std::unique_ptr<::Packet> getUpdatePacket(::ItemStack const&, ::Level&, ::Actor& entity) const;
148
149 MCAPI bool isPlayerHoldingMap(::Player& player);
150
151#ifdef LL_PLAT_C
152 MCAPI void replaceDecorations(
153 ::std::vector<::std::shared_ptr<::MapDecoration>> decorations,
154 ::std::vector<::MapItemTrackedActor::UniqueId> const& uniqueIds
155 );
156#endif
157
158 MCAPI void save(::LevelStorage& storage);
159
160 MCAPI void serialize(::CompoundTag& tag) const;
161
162 MCAPI void setMapSection(::buffer_span<uint> src, ::MapItemSavedData::ChunkBounds bb);
163
164 MCAPI void setOrigin(
165 ::Vec3 origin,
166 int mapScale,
167 ::DimensionType dimension,
168 bool isLegacyLevel,
169 bool isCentered,
170 ::BlockPos const& worldCenter
171 );
172
173 MCAPI void tickByBlock(::BlockPos const& pos, ::BlockSource& region);
174
175 MCAPI void tickCarriedBy(::Actor& player, ::CompoundTag const* item);
176
177 MCAPI ~MapItemSavedData();
178 // NOLINTEND
179
180public:
181 // static functions
182 // NOLINTBEGIN
183#ifdef LL_PLAT_C
184 MCAPI static ::AABB getMapWorldBounds(::BlockPos const& mapOrigin, int blocksPerTexel, int offset);
185#endif
186
187 MCAPI static ::std::string getSerializationKey(::ActorUniqueID id);
188 // NOLINTEND
189
190public:
191 // constructor thunks
192 // NOLINTBEGIN
193 MCAPI void* $ctor(::ActorUniqueID mapId, bool isDLCworld);
194 // NOLINTEND
195
196public:
197 // destructor thunk
198 // NOLINTBEGIN
199 MCAPI void $dtor();
200 // NOLINTEND
201};
Definition AABB.h:18
Definition Actor.h:113
Definition BlockPos.h:17
Definition BlockSource.h:71
Definition CompoundTag.h:18
Definition ItemStack.h:26
Definition LevelStorage.h:25
Definition Level.h:254
Definition MapDecoration.h:8
Definition MapItemTrackedActor.h:18
Definition Packet.h:29
Definition Player.h:129
Definition SpinLockImpl.h:5
Definition Vec3.h:10
Definition buffer_span.h:6
Definition Color.h:13
Definition ActorUniqueID.h:5
Definition ClientTerrainPixel.h:5
Definition DimensionType.h:5
Definition MapItemSavedData.h:42
Definition MapItemSavedData.h:53
Definition MapItemSavedData.h:64
Definition MapItemTrackedActor.h:32