mirror of
https://github.com/architectury/architectury-api.git
synced 2026-03-28 03:56:59 -05:00
Add javadocs
This commit is contained in:
@@ -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<GameRules.BooleanValue> 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<GameRules.BooleanValue> createBooleanRule(boolean defaultValue, BiConsumer<MinecraftServer, GameRules.BooleanValue> 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<GameRules.IntegerValue> 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<GameRules.IntegerValue> createIntRule(int defaultValue, BiConsumer<MinecraftServer, GameRules.IntegerValue> changedCallback) {
|
||||
throw new AssertionError();
|
||||
|
||||
@@ -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 <T> the type of the rule value
|
||||
* @return a key for the registered rule
|
||||
*/
|
||||
@ExpectPlatform
|
||||
public static <T extends GameRules.Value<T>> GameRules.Key<T> register(String name, GameRules.Category category, GameRules.Type<T> type) {
|
||||
throw new AssertionError();
|
||||
|
||||
Reference in New Issue
Block a user