LeviLamina
Loading...
Searching...
No Matches
Minecraft.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/common/SubClientId.h"
7#include "mc/deps/core/utility/NonOwnerPointer.h"
8#include "mc/deps/core/utility/pub_sub/Publisher.h"
9#include "mc/deps/ecs/gamerefs_entity/IEntityRegistryOwner.h"
10#include "mc/deps/game_refs/OwnerPtr.h"
11#include "mc/deps/game_refs/StackRefResult.h"
12#include "mc/network/ClientOrServerNetworkSystemRef.h"
13#include "mc/network/connection/DisconnectFailReason.h"
14
15// auto generated forward declare list
16// clang-format off
17class AllowList;
19class EntityContext;
20class EntityRegistry;
21class EntitySystems;
22class Experiments;
23class GameCallbacks;
25class GameSession;
28class IMinecraftApp;
30class ITickingSystem;
31class Level;
37class PacketSender;
38class PermissionsFile;
41class Scheduler;
43class ServerMetrics;
48class Timer;
51struct PackIdVersion;
53namespace Bedrock::PubSub::ThreadModel { struct SingleThreaded; }
54namespace Core { class FilePathManager; }
55namespace mce { class UUID; }
56// clang-format on
57
59public:
60 // member variables
61 // NOLINTBEGIN
62 ::ll::TypedStorage<8, 8, ::GameCallbacks&> mGameCallbacks;
63 ::ll::TypedStorage<8, 8, ::IMinecraftEventing&> mEventing;
64 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ResourcePackManager>> mResourceLoader;
65 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::StructureManager>> mStructureManager;
66 ::ll::TypedStorage<8, 16, ::std::shared_ptr<::GameModuleServer>> mGameModuleServer;
67 ::ll::TypedStorage<8, 8, ::AllowList&> mAllowList;
68 ::ll::TypedStorage<8, 8, ::PermissionsFile*> mPermissionsFile;
69 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::PrivateKeyManager>> mServerKeys;
70 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::MinecraftServiceKeyManager>> mMinecraftServiceKeys;
71 ::ll::TypedStorage<8, 32, ::std::string const> mSaveGamePath;
72 ::ll::TypedStorage<8, 24, ::Bedrock::NotNullNonOwnerPtr<::Core::FilePathManager>> mFilePathManager;
73 ::ll::TypedStorage<8, 8, ::ServerMetrics*> mServerMetrics;
74 ::ll::TypedStorage<1, 1, bool> mCorruptionDetected;
75 ::ll::TypedStorage<1, 1, bool> mFireOnLevelCorrupt;
76 ::ll::TypedStorage<8, 8, double> mFrameDuration;
77 ::ll::TypedStorage<8, 8, double> mLastFrameStart;
78 ::ll::TypedStorage<8, 8, ::std::chrono::seconds> mMaxPlayerIdleTime;
79 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::DefaultCommandsContextProvider>> mDefaultCommandsContextProvider;
80 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::MinecraftCommands>> mCommands;
81 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::GameSession>> mGameSession;
82 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::GameTestLevelListener>> mGameTestLevelListener;
83 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::MinecraftGameTest>> mGameTest;
84 ::ll::TypedStorage<8, 8, ::Timer&> mSimTimer;
85 ::ll::TypedStorage<8, 8, ::Timer&> mRealTimer;
86 ::ll::TypedStorage<8, 16, ::ClientOrServerNetworkSystemRef> mNetwork;
87 ::ll::TypedStorage<8, 8, ::PacketSender&> mPacketSender;
88 ::ll::TypedStorage<8, 8, ::IMinecraftApp&> mApp;
89 ::ll::TypedStorage<1, 1, ::SubClientId> mClientSubId;
90 ::ll::TypedStorage<8, 16, ::OwnerPtr<::EntityRegistry>> mEntityRegistry;
91 ::ll::TypedStorage<8, 8, ::std::unique_ptr<::ITickingSystem>> mAddMovementTickForCatchup;
92 ::ll::TypedStorage<
93 8,
94 8,
95 ::std::unique_ptr<
97 mLevelSubscribers;
98 // NOLINTEND
99
100public:
101 // prevent constructor by default
102 Minecraft& operator=(Minecraft const&);
103 Minecraft(Minecraft const&);
104 Minecraft();
105
106public:
107 // virtual functions
108 // NOLINTBEGIN
109 // vIndex: 0
110 virtual ~Minecraft() /*override*/;
111
112 // vIndex: 3
113 virtual void setSimTimePause(bool pause);
114
115 // vIndex: 4
116 virtual void setSimTimeScale(float scale);
117
118 // vIndex: 5
119 virtual bool getSimPaused() const;
120
121 // vIndex: 6
122 virtual bool isOnlineClient() const;
123
124 // vIndex: 2
125 virtual ::StackRefResult<::EntityRegistry> getEntityRegistry() /*override*/;
126
127 // vIndex: 1
128 virtual ::StackRefResult<::EntityRegistry const> getEntityRegistry() const /*override*/;
129 // NOLINTEND
130
131public:
132 // member functions
133 // NOLINTBEGIN
134 MCAPI Minecraft(
135 ::IMinecraftApp& app,
136 ::GameCallbacks& gameCallbacks,
137 ::AllowList& allowList,
138 ::PermissionsFile* permissionsFile,
139 ::Bedrock::NotNullNonOwnerPtr<::Core::FilePathManager> const& filePathManager,
140 ::std::chrono::seconds maxPlayerIdleTime,
141 ::IMinecraftEventing& eventing,
143 ::PacketSender& packetSender,
144 ::SubClientId clientSubId,
145 ::Timer& simTimer,
146 ::Timer& realTimer,
147 ::Bedrock::NotNullNonOwnerPtr<::IContentTierManager const> const& contentTierManager,
148 ::ServerMetrics* serverMetrics
149 );
150
151 MCAPI void _tryCatchupMovementTicks();
152
153 MCAPI void activateAllowList();
154
155 MCAPI void configureGameTest(::Level& level, ::Experiments const& experiments);
156
157 MCAPI void disconnectClient(::NetworkIdentifier const& id, ::Connection::DisconnectFailReason disconnectReason);
158
159 MCAPI ::Level* getLevel() const;
160
161 MCAPI ::Bedrock::NonOwnerPointer<::ServerNetworkHandler> getServerNetworkHandler();
162
163 MCAPI ::ServerNetworkSystem& getServerNetworkSystem();
164
165 MCAPI ::Bedrock::NotNullNonOwnerPtr<::StructureManager> getStructureManager();
166
167 MCAPI bool hostMultiplayer(
168 ::std::string const& serverName,
169 ::std::pair<::std::unique_ptr<::Level>, ::OwnerPtr<::EntityContext>> levelEntity,
170 ::mce::UUID const& localPlayerId,
171 ::std::unique_ptr<::NetEventCallback> clientNetworkHandler,
172 int maxChunkRadius,
173 bool shouldAnnounce,
174 ::ConnectionDefinition const& connectionDefinition,
175 ::std::unordered_map<::PackIdVersion, ::std::string> const& packIdToContentKey,
176 ::Scheduler& scheduler,
177 ::TextFilteringProcessor* textFilteringProcessor,
178 ::NetworkServerConfig const& packetHandlerConfig,
179 ::std::shared_ptr<::ScriptPackSettingsCache> packSettingsCache,
180 ::ServerNetworkHandlerDependencies&& serverNetworkOptions
181 );
182
183 MCAPI void init();
184
185 MCAPI void initCommands();
186
187 MCAPI void setupServerCommands(::std::string const& networkCommands, ::std::string const& networkTestCommands);
188
189 MCAPI void startLeaveGame(bool stopNetwork);
190
191 MCAPI void tickSimtime(int nTick, int maxTick);
192
193 MCAPI bool update();
194 // NOLINTEND
195
196public:
197 // static functions
198 // NOLINTBEGIN
199 MCAPI static void _tryCatchupMovementTicks(
200 ::EntitySystems& entitySystems,
201 ::EntityRegistry& registry,
202 ::std::unique_ptr<::ITickingSystem>& addMovementTickForCatchup
203 );
204 // NOLINTEND
205
206public:
207 // constructor thunks
208 // NOLINTBEGIN
209 MCAPI void* $ctor(
210 ::IMinecraftApp& app,
211 ::GameCallbacks& gameCallbacks,
212 ::AllowList& allowList,
213 ::PermissionsFile* permissionsFile,
214 ::Bedrock::NotNullNonOwnerPtr<::Core::FilePathManager> const& filePathManager,
215 ::std::chrono::seconds maxPlayerIdleTime,
216 ::IMinecraftEventing& eventing,
218 ::PacketSender& packetSender,
219 ::SubClientId clientSubId,
220 ::Timer& simTimer,
221 ::Timer& realTimer,
222 ::Bedrock::NotNullNonOwnerPtr<::IContentTierManager const> const& contentTierManager,
223 ::ServerMetrics* serverMetrics
224 );
225 // NOLINTEND
226
227public:
228 // destructor thunk
229 // NOLINTBEGIN
230 MCAPI void $dtor();
231 // NOLINTEND
232
233public:
234 // virtual function thunks
235 // NOLINTBEGIN
236 MCAPI void $setSimTimePause(bool pause);
237
238 MCAPI void $setSimTimeScale(float scale);
239
240 MCAPI bool $getSimPaused() const;
241
242 MCAPI bool $isOnlineClient() const;
243
244 MCFOLD ::StackRefResult<::EntityRegistry> $getEntityRegistry();
245
246 MCFOLD ::StackRefResult<::EntityRegistry const> $getEntityRegistry() const;
247 // NOLINTEND
248
249public:
250 // vftables
251 // NOLINTBEGIN
252 MCNAPI static void** $vftable();
253 // NOLINTEND
254};
Definition AllowList.h:14
Definition Publisher.h:8
Definition ClientOrServerNetworkSystemRef.h:15
Definition DefaultCommandsContextProvider.h:16
Definition EntityContext.h:16
Definition EntityRegistry.h:10
Definition EntitySystems.h:24
Definition Experiments.h:14
Definition GameCallbacks.h:5
Definition GameModuleServer.h:27
Definition GameSession.h:21
Definition GameTestLevelListener.h:15
Definition IContentTierManager.h:13
Definition IEntityRegistryOwner.h:14
Definition IMinecraftApp.h:17
Definition IMinecraftEventing.h:149
Definition ITickingSystem.h:15
Definition Level.h:247
Definition MinecraftCommands.h:33
Definition MinecraftGameTest.h:21
Definition MinecraftServiceKeyManager.h:17
Definition Minecraft.h:58
static MCAPI void ** $vftable()
Definition NetEventCallback.h:244
Definition NetworkIdentifier.h:10
Definition OwnerPtr.h:7
Definition PacketSender.h:17
Definition PermissionsFile.h:17
Definition PrivateKeyManager.h:9
Definition ResourcePackManager.h:24
Definition Scheduler.h:13
Definition ScriptPackSettingsCache.h:17
Definition ServerMetrics.h:10
Definition ServerNetworkHandler.h:168
Definition ServerNetworkSystem.h:31
Definition StructureManager.h:43
Definition TextFilteringProcessor.h:18
Definition Timer.h:5
Definition UUID.h:7
Definition ConnectionDefinition.h:5
Definition NetworkServerConfig.h:9
Definition PackIdVersion.h:10
Definition ServerNetworkHandlerDependencies.h:5