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/AutomaticID.h"
7#include "mc/deps/core/utility/buffer_span.h"
8#include "mc/legacy/ActorUniqueID.h"
9#include "mc/world/level/BlockPos.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 Actor;
16class BlockSource;
17class CompoundTag;
18class Dimension;
19class ItemStack;
20class Level;
21class LevelStorage;
22class MapDecoration;
24class Packet;
25class Player;
26class Random;
27class SpinLockImpl;
28class Vec3;
30namespace mce { class Color; }
31// clang-format on
32
34public:
35 // MapItemSavedData inner types declare
36 // clang-format off
37 struct ChunkBounds;
40 // clang-format on
41
42 // MapItemSavedData inner types define
43 struct ChunkBounds {
44 public:
45 // member variables
46 // NOLINTBEGIN
47 ::ll::TypedStorage<4, 4, uint> x0;
48 ::ll::TypedStorage<4, 4, uint> z0;
49 ::ll::TypedStorage<4, 4, uint> x1;
50 ::ll::TypedStorage<4, 4, uint> z1;
51 // NOLINTEND
52 };
53
54 using DecorationCollection =
55 ::std::vector<::std::pair<::MapItemTrackedActor::UniqueId, ::std::shared_ptr<::MapDecoration>>>;
56
58 public:
59 // member variables
60 // NOLINTBEGIN
61 ::ll::TypedStorage<1, 1, ::MapDecoration::Type> type;
62 ::ll::TypedStorage<4, 4, int> rotation;
63 // NOLINTEND
64 };
65
67 public:
68 // member variables
69 // NOLINTBEGIN
70 ::ll::TypedStorage<1, 1, ::MapDecoration::Type> type;
71 ::ll::TypedStorage<4, 4, int> x;
72 ::ll::TypedStorage<4, 4, int> y;
73 ::ll::TypedStorage<4, 4, int> rot;
74 // NOLINTEND
75 };
76
77public:
78 // member variables
79 // NOLINTBEGIN
80 ::ll::TypedStorage<8, 8, uint64> mUpdateInterval;
81 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mMapId;
82 ::ll::TypedStorage<8, 8, ::ActorUniqueID> mParentMapId;
83 ::ll::TypedStorage<1, 1, bool> mIsFullyExplored;
84 ::ll::TypedStorage<1, 1, bool> mPreviewIncomplete;
85 ::ll::TypedStorage<4, 12, ::BlockPos> mOrigin;
86 ::ll::TypedStorage<4, 4, ::DimensionType> mDimension;
87 ::ll::TypedStorage<1, 1, char> mScale;
88 ::ll::TypedStorage<8, 24, ::std::vector<uint>> mPixels;
89 ::ll::TypedStorage<8, 24, ::std::vector<::ClientTerrainPixel>> mClientPixels;
90 ::ll::TypedStorage<8, 24, ::std::vector<::std::shared_ptr<::MapItemTrackedActor>>> mTrackedEntities;
91 ::ll::TypedStorage<1, 1, bool> mUnlimitedTracking;
92 ::ll::TypedStorage<1, 1, bool> mDirtyForSave;
93 ::ll::TypedStorage<1, 1, bool> mDirtyPixelData;
94 ::ll::TypedStorage<1, 1, bool> mLocked;
95 ::ll::TypedStorage<
96 8,
97 24,
98 ::std::vector<::std::pair<::MapItemTrackedActor::UniqueId, ::std::shared_ptr<::MapDecoration>>>>
99 mDecorations;
100 ::ll::TypedStorage<1, 1, bool> mHasDirtyClientPixels;
101 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::SpinLockImpl>> mClientSamplingLock;
102 ::ll::TypedStorage<1, 1, bool> mNeedsResampling;
103 ::ll::TypedStorage<1, 1, bool> mIsDLCWorld;
104 // NOLINTEND
105
106public:
107 // prevent constructor by default
109
110public:
111 // member functions
112 // NOLINTBEGIN
113 MCAPI MapItemSavedData(::ActorUniqueID mapId, bool isDLCworld);
114
115 MCAPI void _addDecoration(
116 ::MapDecoration::Type type,
118 ::Vec3 const& position,
119 ::std::string const& label,
120 ::mce::Color const& color
121 );
122
123 MCAPI ::std::shared_ptr<::MapItemTrackedActor> _addTrackedMapEntity(
125 ::BlockSource& region,
126 ::MapDecoration::Type decorationType
127 );
128
129 MCAPI ::MapItemSavedData::MapDecorationContext _calculateDecorationLocationAndType(
130 ::MapDecoration::Type type,
131 float yRot,
132 int xDeltaFromCenter,
133 int yDeltaFromCenter,
134 ::MapItemTrackedActor::UniqueId const& uniqueId
135 ) const;
136
137 MCAPI schar _calculateRotation(
138 float yRot,
139 ::MapDecoration::Type type,
140 ::MapItemTrackedActor::UniqueId const& uniqueId,
141 ::Random& rng
142 ) const;
143
144 MCAPI void _deserializeData(::CompoundTag const& tag);
145
146 MCAPI bool _isPlayerHoldingMap(::Player& player);
147
148 MCAPI void _removeDecoration(::MapItemTrackedActor::UniqueId const& id);
149
150 MCAPI void _removeTrackedMapEntity(::MapItemTrackedActor::UniqueId const& key);
151
152 MCAPI bool
153 _updateTrackedEntityDecoration(::BlockSource& region, ::std::shared_ptr<::MapItemTrackedActor> trackedActor);
154
155 MCAPI void _updateTrackedEntityDecorations(::BlockSource& region);
156
157 MCAPI void _updateTrackedPlayerDecorations(
158 ::BlockSource& region,
159 ::Player& player,
160 ::Vec3& decorationPos,
161 ::std::string& decorationLabel,
162 ::mce::Color& decorationColor,
163 ::DimensionType dimensionID,
164 ::MapDecoration::Type& type
165 );
166
167 MCAPI ::std::shared_ptr<::MapItemTrackedActor>
168 addTrackedMapEntity(::Actor& entity, ::MapDecoration::Type decorationType);
169
170 MCAPI void checkNeedsResampling();
171
172 MCAPI ::std::unique_ptr<::Packet> getFullDataPacket() const;
173
174 MCAPI ::std::unique_ptr<::Packet> getUpdatePacket(::Level&, ::BlockPos const& pos) const;
175
176 MCAPI ::std::unique_ptr<::Packet> getUpdatePacket(::ItemStack const&, ::Level&, ::Actor& entity) const;
177
178 MCAPI void save(::LevelStorage& storage);
179
180 MCAPI void serialize(::CompoundTag& tag) const;
181
182 MCAPI void setMapSection(::buffer_span<uint> src, ::MapItemSavedData::ChunkBounds bb);
183
184 MCAPI void setOrigin(
185 ::Vec3 origin,
186 int mapScale,
187 ::DimensionType dimension,
188 bool isLegacyLevel,
189 bool isCentered,
190 ::BlockPos const& worldCenter
191 );
192
193 MCAPI void tickByBlock(::BlockPos const& pos, ::BlockSource& region);
194
195 MCAPI void tickCarriedBy(::Actor& player, ::CompoundTag const* item);
196 // NOLINTEND
197
198public:
199 // static functions
200 // NOLINTBEGIN
201 MCAPI static ::std::string getSerializationKey(::ActorUniqueID id);
202 // NOLINTEND
203
204public:
205 // constructor thunks
206 // NOLINTBEGIN
207 MCAPI void* $ctor(::ActorUniqueID mapId, bool isDLCworld);
208 // NOLINTEND
209};
Definition Actor.h:103
Definition AutomaticID.h:6
Definition BlockPos.h:18
Definition BlockSource.h:67
Definition CompoundTag.h:13
Definition Dimension.h:83
Definition ItemStack.h:25
Definition LevelStorage.h:25
Definition Level.h:238
Definition MapDecoration.h:8
Definition MapItemSavedData.h:33
Definition MapItemTrackedActor.h:20
Definition Packet.h:26
Definition Player.h:119
Definition Random.h:11
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 MapItemSavedData.h:43
Definition MapItemSavedData.h:66
Definition MapItemSavedData.h:57
Definition MapItemTrackedActor.h:34
Definition serialize.h:11