Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
ClientLevel.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/client/multiplayer/BeforeLevelForLevelHoldingOwnership.h"
7#include "mc/deps/core/utility/NonOwnerPointer.h"
8#include "mc/deps/core/utility/UniqueOwnerPointer.h"
9#include "mc/deps/core/utility/pub_sub/Subscription.h"
10#include "mc/deps/game_refs/OwnerPtr.h"
11#include "mc/world/level/Level.h"
12#include "mc/world/level/PlayerSleepManager.h"
13
15
16// auto generated forward declare list
17// clang-format off
18class Actor;
21class BlockSource;
22class CameraRegistry;
23class ChunkSource;
26class EntityContext;
27class EntitySystems;
28class Experiments;
30class LevelChunk;
31class LevelSettings;
32class MapDataManager;
36class SubChunkManager;
37class SubChunkPacket;
39class TickTimeManager;
43class WeakEntityRef;
44struct ActorUniqueID;
47struct Tick;
48namespace GameModeExt { struct MessengerFactory; }
49namespace ServerInitialization { class IServerInitializer; }
50// clang-format on
51
53public:
54 // ClientLevel inner types define
55 using ActorIdMap = ::std::map<int, ::Actor*>;
56
57 using ActorSet = ::std::set<::Actor*>;
58
59public:
60 // member variables
61 // NOLINTBEGIN
62 ::ll::TypedStorage<8, 16, ::gsl::not_null<::Bedrock::UniqueOwnerPointer<::TrustedSkinHelper>>> mTrustedSkinHelper;
63 ::ll::TypedStorage<8, 8, ::ResourcePackManager&> mClientResourcePackManager;
64 ::ll::TypedStorage<8, 8, ::gsl::not_null<::std::unique_ptr<::CameraRegistry>>> mCameraRegistry;
65 ::ll::TypedStorage<8, 8, ::gsl::not_null<::std::unique_ptr<::EntitySystems>>> mCameraSystems;
66 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::VolumeEntityManagerClient>> mVolumeEntityManager;
67 ::ll::TypedStorage<8, 16, ::gsl::not_null<::OwnerPtr<::TickTimeManagerClient>>> mTickTimeManager;
68 ::ll::TypedStorage<8, 16, ::gsl::not_null<::Bedrock::UniqueOwnerPointer<::SubChunkManager>>> mSubChunkManager;
69 ::ll::TypedStorage<8, 16, ::Bedrock::PubSub::Subscription> mOnSubChunkLoaded;
70 ::ll::TypedStorage<8, 16, ::gsl::not_null<::Bedrock::UniqueOwnerPointer<::DisplayActorManager>>>
71 mDisplayActorManager;
72 ::ll::TypedStorage<8, 40, ::PlayerSleepManager> mPlayerSleepManager;
73 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ArmorTrimIconGenerator>> mArmorTrimIconGenerator;
74 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ArmorTrimUnloader>> mArmorTrimUnloader;
75 ::ll::TypedStorage<8, 16, ::gsl::not_null<::Bedrock::UniqueOwnerPointer<::MapDataManager>>> mMapDataManager;
76 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::ClientSubChunkLighter>> mClientSubChunkLighter;
77 // NOLINTEND
78
79public:
80 // prevent constructor by default
81 ClientLevel& operator=(ClientLevel const&);
82 ClientLevel(ClientLevel const&);
83 ClientLevel();
84
85public:
86 // virtual functions
87 // NOLINTBEGIN
88 virtual ~ClientLevel() /*override*/ = default;
89
90 virtual bool initialize(
91 ::std::string const& levelName,
92 ::LevelSettings const& levelSettings,
93 ::Experiments const& experiments,
94 ::std::string const* levelId,
95 ::std::optional<::std::reference_wrapper<
96 ::std::unordered_map<::std::string, ::std::unique_ptr<::BiomeJsonDocumentGlueResolvedBiomeData>>>>
97 biomeIdToResolvedData,
98 ::ServerInitialization::IServerInitializer*
99 ) /*override*/;
100
101 virtual ::Tick const getCurrentServerTick() const /*override*/;
102
103 virtual void startLeaveGame() /*override*/;
104
105 virtual ::ResourcePackManager* getClientResourcePackManager() const /*override*/;
106
107 virtual ::Actor* addEntity(::BlockSource& region, ::OwnerPtr<::EntityContext> entity) /*override*/;
108
109 virtual ::OwnerPtr<::EntityContext> removeActorFromWorldAndTakeEntity(::WeakEntityRef entityRef) /*override*/;
110
111 virtual ::OwnerPtr<::EntityContext> takeEntity(::WeakEntityRef entityRef, ::LevelChunk& lc) /*override*/;
112
113 virtual ::Actor* addDisplayEntity(::BlockSource& region, ::OwnerPtr<::EntityContext> entity) /*override*/;
114
115 virtual void removeDisplayEntity(::WeakEntityRef entity) /*override*/;
116
117 virtual ::Bedrock::NonOwnerPointer<::DisplayActorManager> getDisplayActorManager() /*override*/;
118
119 virtual ::PlayerSleepManager const& getPlayerSleepManager() const /*override*/;
120
121 virtual ::PlayerSleepManager& getPlayerSleepManager() /*override*/;
122
123 virtual void notifySubChunkRequestManager(::SubChunkPacket const& packet) /*override*/;
124
125 virtual ::SubChunkRequestManager* getSubChunkRequestManager() /*override*/;
126
127 virtual void onSubChunkLoaded(
128 ::ChunkSource& source,
129 ::LevelChunk& lc,
130 short absoluteSubChunkIndex,
131 bool subChunkVisibilityChanged
132 ) /*override*/;
133
134 virtual ::Bedrock::NonOwnerPointer<::SubChunkManager> getSubChunkManager() /*override*/;
135
136 virtual bool canUseSkin(
137 ::SerializedSkinRef const& skin,
138 ::NetworkIdentifier const& networkIdentifier,
139 ::ActorUniqueID const& playerId
140 ) const /*override*/;
141
142 virtual ::Bedrock::NonOwnerPointer<::TrustedSkinHelper const> getTrustedSkinHelper() const /*override*/;
143
144 virtual ::ClientLevel* asClientLevel() /*override*/;
145
146 virtual ::Bedrock::NonOwnerPointer<::CameraRegistry const> getCameraRegistry() const /*override*/;
147
148 virtual ::Bedrock::NonOwnerPointer<::CameraRegistry> getCameraRegistry() /*override*/;
149
150 virtual ::Bedrock::NonOwnerPointer<::EntitySystems> getCameraSystems() /*override*/;
151
152 virtual ::ArmorTrimUnloader* getArmorTrimUnloader() /*override*/;
153
154 virtual ::Bedrock::NotNullNonOwnerPtr<::MapDataManager> getMapDataManager() /*override*/;
155
156 virtual ::GameModeExt::MessengerFactory createMessengerFactory() const /*override*/;
157
158 virtual void subChunkTickAndSendRequests() /*override*/;
159
160 virtual ::std::weak_ptr<::ISubChunkLighter> getSubChunkLighter() const /*override*/;
161
162 virtual ::TickTimeManager const& _getTickTimeManager() const /*override*/;
163
164 virtual ::TickTimeManager& _getTickTimeManager() /*override*/;
165
166 virtual ::MapDataManager& _getMapDataManager() /*override*/;
167
168 virtual void _subTick() /*override*/;
169 // NOLINTEND
170
171public:
172 // member functions
173 // NOLINTBEGIN
174 MCNAPI explicit ClientLevel(::ClientLevelArguments&& args);
175
176 MCAPI void _onSubChunkLoaded(
177 ::ChunkSource& source,
178 ::LevelChunk& lc,
179 short absoluteSubChunkIndex,
180 bool subChunkVisibilityChanged
181 );
182
185 LLAPI void addSubChunkPacketHandler(::std::shared_ptr<::SubChunkPacketHandler> handler);
186
187 MCNAPI void cameraTick();
188 // NOLINTEND
189
190public:
191 // constructor thunks
192 // NOLINTBEGIN
193 MCNAPI void* $ctor(::ClientLevelArguments&& args);
194 // NOLINTEND
195
196public:
197 // virtual function thunks
198 // NOLINTBEGIN
199 MCNAPI bool $initialize(
200 ::std::string const& levelName,
201 ::LevelSettings const& levelSettings,
202 ::Experiments const& experiments,
203 ::std::string const* levelId,
204 ::std::optional<::std::reference_wrapper<
205 ::std::unordered_map<::std::string, ::std::unique_ptr<::BiomeJsonDocumentGlueResolvedBiomeData>>>>
206 biomeIdToResolvedData,
207 ::ServerInitialization::IServerInitializer*
208 );
209
210 MCNAPI ::Tick const $getCurrentServerTick() const;
211
212 MCAPI void $startLeaveGame();
213
215
216 MCNAPI ::Actor* $addEntity(::BlockSource& region, ::OwnerPtr<::EntityContext> entity);
217
219
221
222 MCNAPI ::Actor* $addDisplayEntity(::BlockSource& region, ::OwnerPtr<::EntityContext> entity);
223
224 MCNAPI void $removeDisplayEntity(::WeakEntityRef entity);
225
226 MCNAPI ::Bedrock::NonOwnerPointer<::DisplayActorManager> $getDisplayActorManager();
227
229
231
232 MCNAPI void $notifySubChunkRequestManager(::SubChunkPacket const& packet);
233
235
236 MCAPI void $onSubChunkLoaded(
237 ::ChunkSource& source,
238 ::LevelChunk& lc,
239 short absoluteSubChunkIndex,
240 bool subChunkVisibilityChanged
241 );
242
243 MCNAPI ::Bedrock::NonOwnerPointer<::SubChunkManager> $getSubChunkManager();
244
245 MCNAPI bool $canUseSkin(
246 ::SerializedSkinRef const& skin,
247 ::NetworkIdentifier const& networkIdentifier,
248 ::ActorUniqueID const& playerId
249 ) const;
250
251 MCNAPI ::Bedrock::NonOwnerPointer<::TrustedSkinHelper const> $getTrustedSkinHelper() const;
252
253 MCNAPI ::ClientLevel* $asClientLevel();
254
255 MCNAPI ::Bedrock::NonOwnerPointer<::CameraRegistry const> $getCameraRegistry() const;
256
257 MCNAPI ::Bedrock::NonOwnerPointer<::CameraRegistry> $getCameraRegistry();
258
259 MCNAPI ::Bedrock::NonOwnerPointer<::EntitySystems> $getCameraSystems();
260
262
263 MCNAPI ::Bedrock::NotNullNonOwnerPtr<::MapDataManager> $getMapDataManager();
264
265 MCNAPI ::GameModeExt::MessengerFactory $createMessengerFactory() const;
266
268
269 MCNAPI ::std::weak_ptr<::ISubChunkLighter> $getSubChunkLighter() const;
270
271 MCNAPI ::TickTimeManager const& $_getTickTimeManager() const;
272
274
276
277 MCAPI void $_subTick();
278 // NOLINTEND
279};
Definition Actor.h:116
Definition ArmorTrimIconGenerator.h:5
Definition ArmorTrimUnloader.h:5
Definition BeforeLevelForLevelHoldingOwnership.h:5
Definition BlockSource.h:72
Definition CameraRegistry.h:5
Definition ChunkSource.h:37
Definition ClientLevel.h:5
MCAPI::MapDataManager & $_getMapDataManager()
MCAPI void * $ctor(::ClientLevelArguments &&args)
LLAPI void addSubChunkPacketHandler(::std::shared_ptr<::SubChunkPacketHandler > handler)
Restored: inlined in the game, so it is reimplemented here. The insert manager is what actually owns ...
MCAPI ::OwnerPtr<::EntityContext > $takeEntity(::WeakEntityRef entityRef, ::LevelChunk &lc)
MCAPI::ResourcePackManager * $getClientResourcePackManager() const
MCAPI::Tick const $getCurrentServerTick() const
MCAPI::SubChunkRequestManager * $getSubChunkRequestManager()
MCAPI ::Bedrock::NonOwnerPointer<::EntitySystems > $getCameraSystems()
MCAPI::GameModeExt::MessengerFactory $createMessengerFactory() const
MCAPI void $removeDisplayEntity(::WeakEntityRef entity)
MCAPI bool $initialize(::std::string const &levelName, ::LevelSettings const &levelSettings, ::Experiments const &experiments, ::std::string const *levelId, ::std::optional<::std::reference_wrapper< ::std::unordered_map<::std::string, ::std::unique_ptr<::BiomeJsonDocumentGlueResolvedBiomeData > > > > biomeIdToResolvedData, ::ServerInitialization::IServerInitializer *)
MCAPI ::Bedrock::NonOwnerPointer<::DisplayActorManager > $getDisplayActorManager()
MCAPI void $subChunkTickAndSendRequests()
MCAPI::ArmorTrimUnloader * $getArmorTrimUnloader()
MCAPI void cameraTick()
MCAPI ::OwnerPtr<::EntityContext > $removeActorFromWorldAndTakeEntity(::WeakEntityRef entityRef)
MCAPI::PlayerSleepManager const & $getPlayerSleepManager() const
MCAPI ::Bedrock::NonOwnerPointer<::CameraRegistry const > $getCameraRegistry() const
MCAPI::Actor * $addDisplayEntity(::BlockSource &region, ::OwnerPtr<::EntityContext > entity)
MCAPI ::Bedrock::NonOwnerPointer<::TrustedSkinHelper const > $getTrustedSkinHelper() const
MCAPI::TickTimeManager const & $_getTickTimeManager() const
MCAPI::ClientLevel * $asClientLevel()
MCAPI ::std::weak_ptr<::ISubChunkLighter > $getSubChunkLighter() const
MCAPI::Actor * $addEntity(::BlockSource &region, ::OwnerPtr<::EntityContext > entity)
MCAPI ::Bedrock::NonOwnerPointer<::SubChunkManager > $getSubChunkManager()
MCAPI ::Bedrock::NotNullNonOwnerPtr<::MapDataManager > $getMapDataManager()
MCAPI void $notifySubChunkRequestManager(::SubChunkPacket const &packet)
MCAPI bool $canUseSkin(::SerializedSkinRef const &skin, ::NetworkIdentifier const &networkIdentifier, ::ActorUniqueID const &playerId) const
Definition ClientSubChunkLighter.h:5
Definition DisplayActorManager.h:21
Definition EntityContext.h:15
Definition EntitySystems.h:26
Definition Experiments.h:14
Definition ISubChunkLighter.h:16
Definition LevelChunk.h:76
Definition LevelSettings.h:39
Definition Level.h:255
Definition MapDataManager.h:24
Definition NetworkIdentifier.h:10
Definition OwnerPtr.h:7
Definition PlayerSleepManager.h:9
Definition ResourcePackManager.h:29
Definition SerializedSkinRef.h:26
Definition IServerInitializer.h:21
Definition SubChunkManager.h:5
Definition SubChunkPacketHandler.h:5
Definition SubChunkPacket.h:19
Definition SubChunkRequestManager.h:5
Definition TickTimeManagerClient.h:17
Definition TickTimeManager.h:16
Definition TrustedSkinHelper.h:5
Definition VolumeEntityManagerClient.h:5
Definition WeakEntityRef.h:14
STL namespace.
Definition ActorUniqueID.h:5
Definition BiomeJsonDocumentGlueResolvedBiomeData.h:11
Definition ClientLevelArguments.h:5
Definition MessengerFactory.h:13
Definition Tick.h:5