27 enum class GameRulesIndex :
int {
29 CommandBlockOutput = 0,
34 DoLimitedCrafting = 5,
48 DoNaturalRegeneration = 19,
50 SendCommandFeedback = 21,
51 MaxCommandChainLength = 22,
53 CommandBlocksEnabled = 24,
55 DoImmediateRespawn = 26,
56 ShowDeathMessages = 27,
57 FunctionCommandLimit = 28,
58 PlayerSpawnRadius = 29,
61 RespawnBlocksExplode = 32,
62 ShowBorderEffect = 33,
63 ShowRecipeMessages = 34,
64 PlayerSleepingPercentage = 35,
65 ProjectilesCanBreakBlocks = 36,
66 TntExplosionDropDecay = 37,
67 VanillaGameRuleCount = 38,
69 AllowDestructiveObjects = 39,
73 EduGameRuleCount = 43,
77 using GameRuleMap = ::std::vector<::GameRule>;
79 using WorldPolicyMap = ::std::map<::HashedString, ::GameRule>;
84 ::ll::TypedStorage<8, 24, ::std::vector<::GameRule>> mGameRules;
85 ::ll::TypedStorage<8, 16, ::std::map<::HashedString, ::GameRule>> mWorldPolicies;
91 mGameRuleChangePublisher;
97 virtual ~GameRules() ;
105 MCAPI GameRules(::GameRules
const& rhs);
107 MCAPI ::GameRule& _registerRule(::std::string
const& name,
::GameRuleId rule);
109 MCAPI
void _registerRules();
111 MCAPI ::std::unique_ptr<::GameRulesChangedPacket> _setGameRule(
113 ::std::variant<::cereal::NullType, bool, int, float> value,
114 ::GameRule::Type type,
116 bool* pValueValidated,
121 MCAPI ::std::unique_ptr<::GameRulesChangedPacket> createAllGameRulesPacket()
const;
125 MCAPI
bool getBool(
::GameRuleId ruleType,
bool defaultValue)
const;
131 MCAPI ::GameRule
const* getRule(
::GameRuleId rule)
const;
133 MCFOLD ::std::vector<::GameRule>
const& getRules()
const;
139 MCAPI ::GameRuleId nameToGameRuleIndex(::std::string
const& name)
const;
141 MCAPI ::GameRules& operator=(::GameRules
const& rhs);
144 MCAPI
bool operator==(::GameRules
const& rhs)
const;
147 MCFOLD ::Bedrock::PubSub::Subscription
148 registerOnGameRuleChangeCallback(::std::function<
void(::GameRules
const&,
::GameRuleId const&)> callback);
150 MCAPI
void setMarketplaceOverrides();
152 MCAPI ::std::unique_ptr<::GameRulesChangedPacket> setRule(
156 bool* pValueValidated,
161 MCAPI ::std::unique_ptr<::GameRulesChangedPacket> setRule(
165 bool* pValueValidated,
170 MCAPI ::std::unique_ptr<::GameRulesChangedPacket> setRule(
174 bool* pValueValidated,
185 MCAPI static ::std::map<::GameRuleId, ::GameRule>
const& _getMarketplaceGameRulesDefaultMap();
191 MCAPI
static int const& DEFAULT_RANDOMTICKSPEED();
193 MCAPI
static int const& MAX_FUNCTIONCOMMANDLIMIT();
195 MCAPI
static uint
const& MAX_PLAYER_SPAWN_RADIUS();
197 MCAPI
static int const& MAX_RANDOMTICKSPEED();
199 MCAPI
static uint
const& MIN_PLAYER_SPAWN_RADIUS();
201 MCAPI static ::std::string
const& WORLD_POLICY_TAG_NAME();
209 MCAPI
void* $ctor(::GameRules
const& rhs);