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