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 ::GameRuleId nameToGameRuleIndex(::std::string
const& name)
const;
133 MCAPI ::GameRules& operator=(::GameRules
const& rhs);
136 MCAPI
bool operator==(::GameRules
const& rhs)
const;
138 MCAPI ::Bedrock::PubSub::Subscription
139 registerOnGameRuleChangeCallback(::std::function<
void(::GameRules
const&,
::GameRuleId const&)> callback);
142 MCAPI
void setMarketplaceOverrides();
144 MCAPI ::std::unique_ptr<::GameRulesChangedPacket> setRule(
148 bool* pValueValidated,
153 MCAPI ::std::unique_ptr<::GameRulesChangedPacket> setRule(
157 bool* pValueValidated,
168 MCAPI static ::std::map<::GameRuleId, ::GameRule>
const& _getMarketplaceGameRulesDefaultMap();
174 MCAPI static ::std::string
const& WORLD_POLICY_TAG_NAME();
182 MCAPI
void* $ctor(::GameRules
const& rhs);