LeviLamina
Loading...
Searching...
No Matches
GameRules.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/string/HashedString.h"
7#include "mc/deps/core/utility/EnableNonOwnerReferences.h"
8#include "mc/deps/core/utility/pub_sub/Publisher.h"
9#include "mc/world/level/storage/GameRule.h"
10
11// auto generated forward declare list
12// clang-format off
13class GameRule;
16struct GameRuleId;
17namespace Bedrock::PubSub::ThreadModel { struct MultiThreaded; }
18namespace cereal { struct NullType; }
19// clang-format on
20
21class GameRules : public ::Bedrock::EnableNonOwnerReferences {
22public:
23 // GameRules inner types define
24 enum class GameRulesIndex : int {
25 InvalidGameRule = -1,
26 CommandBlockOutput = 0,
27 DoDaylightCycle = 1,
28 DoEntityDrops = 2,
29 DoFireTick = 3,
30 RecipesUnlock = 4,
31 DoLimitedCrafting = 5,
32 DoMobLoot = 6,
33 DoMobSpawning = 7,
34 DoTileDrops = 8,
35 DoWeatherCycle = 9,
36 DrowningDamage = 10,
37 FallDamage = 11,
38 FireDamage = 12,
39 KeepInventory = 13,
40 MobGriefing = 14,
41 Pvp = 15,
42 ShowCoordinates = 16,
43 PlayerWaypoints = 17,
44 LocatorBarDeprecated = 18,
45 ShowDaysPlayed = 19,
46 DoNaturalRegeneration = 20,
47 DoTntExplode = 21,
48 SendCommandFeedback = 22,
49 MaxCommandChainLength = 23,
50 DoInsomnia = 24,
51 CommandBlocksEnabled = 25,
52 RandomTickSpeed = 26,
53 DoImmediateRespawn = 27,
54 ShowDeathMessages = 28,
55 FunctionCommandLimit = 29,
56 PlayerSpawnRadius = 30,
57 ShowTags = 31,
58 FreezeDamage = 32,
59 RespawnBlocksExplode = 33,
60 ShowBorderEffect = 34,
61 ShowRecipeMessages = 35,
62 PlayerSleepingPercentage = 36,
63 ProjectilesCanBreakBlocks = 37,
64 TntExplosionDropDecay = 38,
65 VanillaGameRuleCount = 39,
66 GlobalMute = 39,
67 AllowDestructiveObjects = 40,
68 AllowMobs = 41,
69 CodeBuilder = 42,
70 EduCloudSave = 43,
71 EduGameRuleCount = 44,
72 GameRuleCount = 44,
73 };
74
75 using GameRuleMap = ::std::vector<::GameRule>;
76
77 using WorldPolicyMap = ::std::map<::HashedString, ::GameRule>;
78
79public:
80 // member variables
81 // NOLINTBEGIN
82 ::ll::TypedStorage<8, 24, ::std::vector<::GameRule>> mGameRules;
83 ::ll::TypedStorage<8, 16, ::std::map<::HashedString, ::GameRule>> mWorldPolicies;
84 ::ll::TypedStorage<
85 8,
86 128,
87 ::Bedrock::PubSub::
88 Publisher<void(::GameRules const&, ::GameRuleId const&), ::Bedrock::PubSub::ThreadModel::MultiThreaded, 0>>
89 mGameRuleChangePublisher;
90 // NOLINTEND
91
92public:
93 // virtual functions
94 // NOLINTBEGIN
95 virtual ~GameRules() /*override*/;
96 // NOLINTEND
97
98public:
99 // member functions
100 // NOLINTBEGIN
101 MCAPI GameRules();
102
103 MCAPI GameRules(::GameRules&& rhs);
104
105 MCAPI GameRules(::GameRules const& rhs);
106
107 MCAPI void _registerRules();
108
109 MCAPI ::std::unique_ptr<::GameRulesChangedPacket> _setGameRule(
110 ::GameRule* gameRule,
111 ::std::variant<::cereal::NullType, bool, int, float> value,
112 ::GameRule::Type type,
113 bool returnPacket,
114 bool* pValueValidated,
115 bool* pValueChanged,
116 ::GameRule::ValidationError* errorOutput
117 );
118
119 MCAPI ::std::unique_ptr<::GameRulesChangedPacket> createAllGameRulesPacket() const;
120
121 MCAPI void deserializeRules(::GameRulesChangedPacketData const& ruleData);
122
123 MCAPI bool getBool(::GameRuleId ruleType, bool defaultValue) const;
124
125 MCAPI ::GameRules& operator=(::GameRules&& rhs);
126
127 MCAPI ::GameRules& operator=(::GameRules const& rhs);
128
129#ifdef LL_PLAT_C
130 MCAPI bool operator==(::GameRules const& rhs) const;
131#endif
132
133 MCAPI void setMarketplaceOverrides();
134 // NOLINTEND
135
136public:
137 // static variables
138 // NOLINTBEGIN
139 MCAPI static ::std::string const& WORLD_POLICY_TAG_NAME();
140 // NOLINTEND
141
142public:
143 // constructor thunks
144 // NOLINTBEGIN
145 MCAPI void* $ctor();
146
147 MCAPI void* $ctor(::GameRules&& rhs);
148
149 MCAPI void* $ctor(::GameRules const& rhs);
150 // NOLINTEND
151
152public:
153 // destructor thunk
154 // NOLINTBEGIN
155 MCAPI void $dtor();
156 // NOLINTEND
157
158public:
159 // vftables
160 // NOLINTBEGIN
161 MCNAPI static void** $vftable();
162 // NOLINTEND
163};
Definition EnableNonOwnerReferences.h:7
Definition GameRule.h:29
Definition GameRule.h:14
Definition GameRulesChangedPacketData.h:10
Definition GameRulesChangedPacket.h:19
static MCAPI void ** $vftable()
Definition GameRuleId.h:8
Definition NullType.h:7