diff --git a/common/src/main/java/me/shedaniel/architectury/registry/GameRuleFactory.java b/common/src/main/java/me/shedaniel/architectury/registry/GameRuleFactory.java index a51fdc85..8efef201 100644 --- a/common/src/main/java/me/shedaniel/architectury/registry/GameRuleFactory.java +++ b/common/src/main/java/me/shedaniel/architectury/registry/GameRuleFactory.java @@ -31,21 +31,47 @@ import java.util.function.BiConsumer; public final class GameRuleFactory { private GameRuleFactory() {} + /** + * Creates a boolean rule type. + * + * @param defaultValue the rule's default value + * @return the created type + */ @ExpectPlatform public static GameRules.Type createBooleanRule(boolean defaultValue) { throw new AssertionError(); } + /** + * Creates a boolean rule type. + * + * @param defaultValue the rule's default value + * @param changedCallback a callback that is called when the rule's value is changed + * @return the created type + */ @ExpectPlatform public static GameRules.Type createBooleanRule(boolean defaultValue, BiConsumer changedCallback) { throw new AssertionError(); } + /** + * Creates an integer rule type. + * + * @param defaultValue the rule's default value + * @return the created type + */ @ExpectPlatform public static GameRules.Type createIntRule(int defaultValue) { throw new AssertionError(); } + /** + * Creates an integer rule type. + * + * @param defaultValue the rule's default value + * @param changedCallback a callback that is called when the rule's value is changed + * @return the created type + */ @ExpectPlatform public static GameRules.Type createIntRule(int defaultValue, BiConsumer changedCallback) { throw new AssertionError(); diff --git a/common/src/main/java/me/shedaniel/architectury/registry/GameRuleRegistry.java b/common/src/main/java/me/shedaniel/architectury/registry/GameRuleRegistry.java index f85744ea..bae13668 100644 --- a/common/src/main/java/me/shedaniel/architectury/registry/GameRuleRegistry.java +++ b/common/src/main/java/me/shedaniel/architectury/registry/GameRuleRegistry.java @@ -28,6 +28,15 @@ import net.minecraft.world.level.GameRules; public final class GameRuleRegistry { private GameRuleRegistry() {} + /** + * Registers a game rule. + * + * @param name the rule's name + * @param category the rule category + * @param type the type of the rule + * @param the type of the rule value + * @return a key for the registered rule + */ @ExpectPlatform public static > GameRules.Key register(String name, GameRules.Category category, GameRules.Type type) { throw new AssertionError();