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