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