Make GameRule a FeatureDependant (#12429)

This commit is contained in:
DerEchtePilz
2025-04-14 13:21:14 +02:00
committed by GitHub
parent 91bfb6fb7e
commit 121a7bf4eb
4 changed files with 25 additions and 8 deletions

View File

@@ -14,7 +14,7 @@
+
public static final int DEFAULT_RANDOM_TICK_SPEED = 3;
static final Logger LOGGER = LogUtils.getLogger();
private static final Map<GameRules.Key<?>, GameRules.Type<?>> GAME_RULE_TYPES = Maps.newTreeMap(Comparator.comparing(entry -> entry.id));
public static final Map<GameRules.Key<?>, GameRules.Type<?>> GAME_RULE_TYPES = Maps.newTreeMap(Comparator.comparing(entry -> entry.id));
@@ -86,10 +_,10 @@
"sendCommandFeedback", GameRules.Category.CHAT, GameRules.BooleanValue.create(true)
);
@@ -225,8 +225,12 @@
final String id;
private final GameRules.Category category;
@@ -575,7 +_,7 @@
public static class Type<T extends GameRules.Value<T>> {
@@ -572,10 +_,10 @@
}
}
- public static class Type<T extends GameRules.Value<T>> {
+ public static class Type<T extends GameRules.Value<T>> implements net.minecraft.world.flag.FeatureElement { // Paper - FeatureDependant for GameRule
final Supplier<ArgumentType<?>> argument;
private final Function<GameRules.Type<T>, T> constructor;
- final BiConsumer<MinecraftServer, T> callback;