LeviLamina
Loading...
Searching...
No Matches
LevelData.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/common/GameVersion.h"
7#include "mc/common/editor/WorldType.h"
8#include "mc/config/ChatRestrictionLevel.h"
9#include "mc/deps/core/sem_ver/SemVersion.h"
10#include "mc/deps/core/utility/pub_sub/Publisher.h"
11#include "mc/deps/core/utility/pub_sub/Subscription.h"
12#include "mc/deps/json/Value.h"
13#include "mc/deps/shared_types/legacy/Difficulty.h"
14#include "mc/network/GamePublishSetting.h"
15#include "mc/options/EducationEditionOffer.h"
16#include "mc/options/EducationEditionOfferValue.h"
17#include "mc/world/actor/player/Abilities.h"
18#include "mc/world/actor/player/PermissionsHandler.h"
19#include "mc/world/level/BlockPos.h"
20#include "mc/world/level/DaylightCycle.h"
21#include "mc/world/level/GameType.h"
22#include "mc/world/level/GeneratorType.h"
23#include "mc/world/level/NetherWorldType.h"
24#include "mc/world/level/SpawnSettings.h"
25#include "mc/world/level/Tick.h"
26#include "mc/world/level/WorldVersion.h"
27#include "mc/world/level/levelgen/flat/FlatWorldPresetID.h"
28#include "mc/world/level/storage/AdventureSettings.h"
29#include "mc/world/level/storage/CloudSaveLevelInfo.h"
30#include "mc/world/level/storage/ExperimentStorage.h"
31#include "mc/world/level/storage/GameRules.h"
32#include "mc/world/level/storage/StorageVersion.h"
33#include "mc/world/level/storage/WorldTemplateLevelData.h"
34
35// auto generated forward declare list
36// clang-format off
37class BaseGameVersion;
38class CompoundTag;
39class HashedString;
41class LevelSeed64;
42class LevelSettings;
44struct LevelDataValue;
45struct PackIdVersion;
46namespace Bedrock::PubSub::ThreadModel { struct SingleThreaded; }
47namespace RakNet { class BitStream; }
48// clang-format on
49
50class LevelData {
51public:
52 // member variables
53 // NOLINTBEGIN
54 ::ll::TypedStorage<1, 5, ::AdventureSettings> mAdventureSettings;
55 ::ll::TypedStorage<8, 144, ::WorldTemplateLevelData> mWorldTemplateLevelData;
56 ::ll::TypedStorage<8, 192, ::GameRules> mGameRules;
57 ::ll::TypedStorage<8, 72, ::ExperimentStorage> mExperiments;
58 ::ll::TypedStorage<4, 240, ::Abilities> mDefaultAbilities;
59 ::ll::TypedStorage<1, 2, ::PermissionsHandler> mDefaultPermissions;
60 ::ll::TypedStorage<8, 32, ::std::string> mLevelName;
61 ::ll::TypedStorage<4, 4, ::StorageVersion> mStorageVersion;
62 ::ll::TypedStorage<8, 56, ::GameVersion> mMinCompatibleClientVersion;
63 ::ll::TypedStorage<4, 4, int> mNetworkVersion;
64 ::ll::TypedStorage<8, 24, ::SemVersion> mInventoryVersion;
65 ::ll::TypedStorage<8, 8, ::Tick> mCurrentTick;
66 ::ll::TypedStorage<1, 1, bool> mHasSpawnPos;
67 ::ll::TypedStorage<4, 12, ::BlockPos> mLimitedWorldOrigin;
68 ::ll::TypedStorage<4, 4, int> mTime;
69 ::ll::TypedStorage<8, 8, int64> mLastSaved;
70 ::ll::TypedStorage<4, 4, uint> mServerTickRange;
71 ::ll::TypedStorage<4, 4, float> mRainLevel;
72 ::ll::TypedStorage<4, 4, int> mRainTime;
73 ::ll::TypedStorage<4, 4, float> mLightningLevel;
74 ::ll::TypedStorage<4, 4, int> mLightningTime;
75 ::ll::TypedStorage<4, 4, int> mNetherScale;
76 ::ll::TypedStorage<8, 56, ::GameVersion> mLastOpenedWithVersion;
77 ::ll::TypedStorage<4, 4, ::SharedTypes::Legacy::Difficulty> mGameDifficulty;
78 ::ll::TypedStorage<1, 1, bool> mForceGameType;
79 ::ll::TypedStorage<1, 1, bool> mIsHardcore;
80 ::ll::TypedStorage<1, 1, bool> mPlayerHasDied;
81 ::ll::TypedStorage<1, 1, bool> mSpawnMobs;
82 ::ll::TypedStorage<1, 1, bool> mAdventureModeOverridesEnabled;
83 ::ll::TypedStorage<8, 16, ::Json::Value> mFlatWorldOptions;
84 ::ll::TypedStorage<4, 4, uint> mWorldStartCount;
85 ::ll::TypedStorage<1, 1, bool> mAchievementsDisabled;
86 ::ll::TypedStorage<4, 4, ::Editor::WorldType> mEditorWorldType;
87 ::ll::TypedStorage<1, 1, bool> mIsCreatedInEditor;
88 ::ll::TypedStorage<1, 1, bool> mIsExportedFromEditor;
89 ::ll::TypedStorage<4, 4, ::EducationEditionOfferValue> mEducationEditionOffer;
90 ::ll::TypedStorage<8, 176, ::std::optional<::CloudSaveLevelInfo>> mCloudSaveInfo;
91 ::ll::TypedStorage<1, 1, bool> mEducationFeaturesEnabled;
92 ::ll::TypedStorage<1, 1, bool> mIsSingleUseWorld;
93 ::ll::TypedStorage<1, 1, bool> mConfirmedPlatformLockedContent;
94 ::ll::TypedStorage<1, 1, bool> mMultiplayerGameIntent;
95 ::ll::TypedStorage<1, 1, bool> mMultiplayerGame;
96 ::ll::TypedStorage<1, 1, bool> mLANBroadcastIntent;
97 ::ll::TypedStorage<1, 1, bool> mLANBroadcast;
98 ::ll::TypedStorage<4, 4, ::Social::GamePublishSetting> mXBLBroadcastIntent;
99 ::ll::TypedStorage<4, 4, ::Social::GamePublishSetting> mXBLBroadcastMode;
100 ::ll::TypedStorage<4, 4, ::Social::GamePublishSetting> mPlatformBroadcastIntent;
101 ::ll::TypedStorage<4, 4, ::Social::GamePublishSetting> mPlatformBroadcastMode;
102 ::ll::TypedStorage<1, 1, bool> mCheatsEnabled;
103 ::ll::TypedStorage<1, 1, bool> mCommandsEnabled;
104 ::ll::TypedStorage<1, 1, bool> mTexturePacksRequired;
105 ::ll::TypedStorage<1, 1, bool> mHasLockedBehaviorPack;
106 ::ll::TypedStorage<1, 1, bool> mHasLockedResourcePack;
107 ::ll::TypedStorage<1, 1, bool> mIsFromLockedTemplate;
108 ::ll::TypedStorage<1, 1, bool> mIsRandomSeedAllowed;
109 ::ll::TypedStorage<8, 32, ::std::string> mEducationProductId;
110 ::ll::TypedStorage<8, 32, ::std::string> mEducationCreatorId;
111 ::ll::TypedStorage<8, 32, ::std::string> mEducationCreatorWorldId;
112 ::ll::TypedStorage<8, 32, ::std::string> mEducationReferrerId;
113 ::ll::TypedStorage<1, 1, bool> mUseMsaGamertagsOnly;
114 ::ll::TypedStorage<1, 1, bool> mBonusChestEnabled;
115 ::ll::TypedStorage<1, 1, bool> mBonusChestSpawned;
116 ::ll::TypedStorage<1, 1, bool> mStartWithMapEnabled;
117 ::ll::TypedStorage<1, 1, bool> mMapsCenteredToOrigin;
118 ::ll::TypedStorage<1, 1, bool> mRequiresCopiedPackRemovalCheck;
119 ::ll::TypedStorage<1, 1, bool> mSpawnV1Villagers;
120 ::ll::TypedStorage<1, 1, bool> mPersonaDisabled;
121 ::ll::TypedStorage<1, 1, bool> mCustomSkinsDisabled;
122 ::ll::TypedStorage<1, 1, bool> mEmoteChatMuted;
123 ::ll::TypedStorage<1, 1, bool> mHasUncompleteWorldFileOnDisk;
124 ::ll::TypedStorage<1, 1, ::NetherWorldType> mNetherType;
125 ::ll::TypedStorage<8, 48, ::SpawnSettings> mSpawnSettings;
126 ::ll::TypedStorage<8, 64, ::std::unordered_map<::HashedString, ::LevelDataValue>> mValues;
127 ::ll::TypedStorage<8, 64, ::std::unordered_map<::HashedString, ::LevelDataValue>> mOverrides;
128 ::ll::TypedStorage<8, 32, ::std::string> mBiomeOverride;
129 ::ll::TypedStorage<4, 8, ::std::optional<::GeneratorType>> mDataDrivenGeneratorType;
130 ::ll::TypedStorage<1, 1, ::ChatRestrictionLevel> mChatRestrictionLevel;
131 ::ll::TypedStorage<
132 8,
133 8,
135 mIsHardcoreSubscribers;
136 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOnSaveLevelData;
137 ::ll::TypedStorage<8, 40, ::std::optional<::std::string>> mExperienceWorldId;
138 // NOLINTEND
139
140public:
141 // prevent constructor by default
142 LevelData& operator=(LevelData const&);
143 LevelData(LevelData const&);
144 LevelData();
145
146public:
147 // member functions
148 // NOLINTBEGIN
149 MCAPI LevelData(::LevelData&&);
150
151 MCAPI explicit LevelData(bool isEduMode);
152
153 MCAPI LevelData(
154 ::LevelSettings const& settings,
155 ::std::string const& levelName,
156 ::GeneratorType generatorVersion,
157 ::BlockPos const& defaultSpawn,
158 bool achievementsDisabled,
159 ::EducationEditionOffer eduOffer,
160 float rainLevel,
161 float lightningLevel
162 );
163
164 MCAPI void _determineMaxBaseGameVersion();
165
166 MCAPI_C void _resetDefaultAdvancedSettingsData(bool isTrial);
167
168 MCAPI_C void _resetDefaultScriptingCodingSettingsData();
169
170 MCAPI void _setValue(::HashedString const& key, ::LevelDataValue&& value);
171
172 MCAPI void _updateLimitedWorldOrigin(::BlockPos const& pos);
173
174 MCAPI bool achievementsWillBeDisabledOnLoad() const;
175
176 MCAPI_C void applyPolicyBasedSettings(bool hasBehaviourPack);
177
178 MCAPI ::std::optional<::SemVersion> checkServerAuthOptOutVersion() const;
179
180 MCAPI_C void clearCloudSaveInfo();
181
182 MCAPI bool cloudSaveForWorldIsEnabled() const;
183
184 MCAPI ::std::unique_ptr<::CompoundTag> createTag() const;
185
186 MCAPI ::BaseGameVersion const& getBaseGameVersion() const;
187
188 MCAPI_C ::CloudSaveLevelInfo& getCloudSaveInfo();
189
190 MCAPI ::CompoundTag const& getEduSharedUriResource() const;
191
192 MCAPI ::std::string const& getEducationOid() const;
193
194 MCAPI ::GameType getGameType() const;
195
196 MCAPI ::GeneratorType getGenerator() const;
197
198 MCAPI ::LevelSeed64 getSeed() const;
199
200 MCAPI void getTagData(::CompoundTag const& tag);
201
202 MCAPI ::WorldVersion getWorldVersion() const;
203
204 MCAPI_C bool isAlwaysDay() const;
205
206 MCAPI_C bool isEditionCompatible() const;
207
208 MCAPI_C ::Bedrock::PubSub::Subscription registerIsHardcoreListener(::std::function<void(bool)> callback) const;
209
210 MCAPI void registerWithLevelStorageManagerEvents(::ILevelStorageManagerConnector& levelStorageManagerConnector);
211
212 MCAPI_C void resetDefaultCheatSettingsData();
213
214 MCAPI_C void resetSettingsForRandomSeed();
215
216 MCAPI_C void resetToDefaultSettings();
217
218 MCAPI_C void setBaseGameVersion(::BaseGameVersion const& baseGameVersion);
219
220 MCAPI void setBiomeOverride(::std::string const& biomeName);
221
222 MCAPI void setDaylightCycle(::DaylightCycle daylightCycle);
223
224 MCAPI void setEduSharedUriResource(::EduSharedUriResource const& eduSharedUriResource);
225
226 MCAPI void setEducationEditionOffer(::EducationEditionOffer offer);
227
228 MCAPI void setEducationOid(::std::string const& educationOid);
229
230 MCAPI void setFlatWorldOptions(::Json::Value const& options);
231
232 MCAPI void setFlatWorldPreset(::FlatWorldPresetID preset);
233
234 MCAPI void setGameType(::GameType type);
235
236 MCAPI void setGenerator(::GeneratorType version);
237
238 MCAPI void setIsHardcore(bool value);
239
240 MCAPI void setLevelName(::std::string const& levelName);
241
242 MCAPI void setSeed(::LevelSeed64 seed);
243
244 MCAPI void setSpawnPos(::BlockPos const& spawn);
245
246 MCAPI_C void setSpawnSettings(::SpawnSettings const& settings);
247
248 MCAPI void setTagData(::CompoundTag& tag) const;
249
250 MCAPI_C void setWorldTemplateIdentity(::PackIdVersion const& packIdVersion);
251
252 MCAPI void setWorldVersion(::WorldVersion version);
253
254 MCAPI_C bool shouldAchievementsBeDisabled(bool isTrialMode, bool hasBehaviourPack) const;
255
256 MCAPI void v1_read(::RakNet::BitStream& bitStream, ::StorageVersion storageVersion);
257
258 MCAPI ~LevelData();
259 // NOLINTEND
260
261public:
262 // constructor thunks
263 // NOLINTBEGIN
264 MCAPI void* $ctor(::LevelData&&);
265
266 MCAPI void* $ctor(bool isEduMode);
267
268 MCAPI void* $ctor(
269 ::LevelSettings const& settings,
270 ::std::string const& levelName,
271 ::GeneratorType generatorVersion,
272 ::BlockPos const& defaultSpawn,
273 bool achievementsDisabled,
274 ::EducationEditionOffer eduOffer,
275 float rainLevel,
276 float lightningLevel
277 );
278 // NOLINTEND
279
280public:
281 // destructor thunk
282 // NOLINTBEGIN
283 MCAPI void $dtor();
284 // NOLINTEND
285};
Definition BaseGameVersion.h:8
Definition Publisher.h:8
Definition BlockPos.h:19
Definition CompoundTag.h:23
Definition HashedString.h:5
Definition ILevelStorageManagerConnector.h:13
Definition Value.h:16
Definition LevelSeed64.h:5
Definition LevelSettings.h:39
Definition BitStream.h:7
Definition EduSharedUriResource.h:10
Definition LevelDataValue.h:5
Definition PackIdVersion.h:10
Definition SpawnSettings.h:14