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);
135 MCAPI_C ::Bedrock::PubSub::Subscription
136 registerOnGameRuleChangeCallback(::std::function<
void(::GameRules
const&,
::GameRuleId const&)> callback);
138 MCAPI
void setMarketplaceOverrides();
140 MCAPI ::std::unique_ptr<::GameRulesChangedPacket> setRule(
144 bool* pValueValidated,
149 MCAPI ::std::unique_ptr<::GameRulesChangedPacket> setRule(
153 bool* pValueValidated,
164 MCAPI static ::std::map<::GameRuleId, ::GameRule>
const& _getMarketplaceGameRulesDefaultMap();
170 MCAPI_C
static int const& DEFAULT_RANDOMTICKSPEED();
172 MCAPI
static int const& MAX_FUNCTIONCOMMANDLIMIT();
174 MCAPI_C
static uint
const& MAX_PLAYER_SPAWN_RADIUS();
176 MCAPI_C
static int const& MAX_RANDOMTICKSPEED();
178 MCAPI_C
static uint
const& MIN_PLAYER_SPAWN_RADIUS();
180 MCAPI static ::std::string
const& WORLD_POLICY_TAG_NAME();
188 MCAPI
void* $ctor(::GameRules
const& rhs);