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