mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-14 01:04:24 +00:00
Add missing AT lines to allow registering custom game rule boolean/integer types (#9489)
This commit is contained in:
3 files changed
+38
No files matched your search
@@ -280,6 +280,10 @@ public net.minecraft.world.item.crafting.Ingredient$TagValue
|
||||
public net.minecraft.world.item.crafting.Ingredient$TagValue <init>(Lnet/minecraft/tags/TagKey;)V # constructor
|
||||
public net.minecraft.world.item.crafting.Ingredient$Value
|
||||
public net.minecraft.world.level.GameRules m_46189_(Ljava/lang/String;Lnet/minecraft/world/level/GameRules$Category;Lnet/minecraft/world/level/GameRules$Type;)Lnet/minecraft/world/level/GameRules$Key; # register
|
||||
public net.minecraft.world.level.GameRules$BooleanValue m_46252_(ZLjava/util/function/BiConsumer;)Lnet/minecraft/world/level/GameRules$Type; # create
|
||||
public net.minecraft.world.level.GameRules$BooleanValue m_46250_(Z)Lnet/minecraft/world/level/GameRules$Type; # create
|
||||
public net.minecraft.world.level.GameRules$IntegerValue m_46294_(ILjava/util/function/BiConsumer;)Lnet/minecraft/world/level/GameRules$Type; # create
|
||||
public net.minecraft.world.level.GameRules$IntegerValue m_46312_(I)Lnet/minecraft/world/level/GameRules$Type; # create
|
||||
public net.minecraft.world.level.Level f_46437_ # oRainLevel
|
||||
public net.minecraft.world.level.Level f_46438_ # rainLevel
|
||||
public net.minecraft.world.level.Level f_46439_ # oThunderLevel
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (c) Forge Development LLC and contributors
|
||||
* SPDX-License-Identifier: LGPL-2.1-only
|
||||
*/
|
||||
|
||||
package net.minecraftforge.debug;
|
||||
|
||||
import net.minecraft.world.level.GameRules;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
|
||||
/**
|
||||
* Simple test to ensure custom game rules can be registered correctly and used in game.
|
||||
* <p>
|
||||
* To test these game rules use the following commands.
|
||||
* <br>If the game rules are registered correctly, they should show up as auto-completion values and be able to be changed to valid values based on their types.
|
||||
* <br>These game rules should also show up and be editable under the {@code Edit Game Rules} screen, when creating a new world.
|
||||
* <br>{@code Create new world > More (tab) > Game Rules > Misc}
|
||||
* <ul>
|
||||
* <li><pre>{@code /gamerule custom_game_rule_test:custom_boolean_game_rule <true|false>}</pre></li>
|
||||
* Should be able to be set to either {@code true} or {@code false} (Defaulting to {@code true}).
|
||||
*
|
||||
* <li><pre>{@code /gamerule custom_game_rule_test:custom_integer_game_rule <some integer>}</pre></li>
|
||||
* Should be able to be set to any integer value (Defaulting to {@code 1337}).
|
||||
* </ul>
|
||||
*/
|
||||
@Mod(CustomGameRuleTest.TEST_ID)
|
||||
public class CustomGameRuleTest
|
||||
{
|
||||
public static final String TEST_ID = "custom_game_rule_test";
|
||||
public static final GameRules.Key<GameRules.BooleanValue> CUSTOM_BOOLEAN_GAME_RULE = GameRules.register("%s:custom_boolean_game_rule".formatted(TEST_ID), GameRules.Category.MISC, GameRules.BooleanValue.create(true));
|
||||
public static final GameRules.Key<GameRules.IntegerValue> CUSTOM_INTEGER_GAME_RULE = GameRules.register("%s:custom_integer_game_rule".formatted(TEST_ID), GameRules.Category.MISC, GameRules.IntegerValue.create(1337));
|
||||
}
|
||||
@@ -28,6 +28,8 @@ modId="mdk_datagen"
|
||||
modId="crash_callable_test"
|
||||
[[mods]]
|
||||
modId="deferred_work_queue_test"
|
||||
[[mods]]
|
||||
modId="custom_game_rule_test"
|
||||
|
||||
# LEGACY TEST CASES
|
||||
###### The mods below are from the old test framework and need to be yeeted later again.
|
||||
|
||||
Reference in new issue
Block a user