Update patches to latest 1.21.4 #1

Merged
Chaoscaot merged 242 commits from update/1.21.4 into main 2025-04-23 22:27:11 +02:00
2284 changed files with 57456 additions and 51864 deletions
Showing only changes of commit de410d13ef - Show all commits

View File

@ -225,12 +225,8 @@
final String id;
private final GameRules.Category category;
@@ -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
@@ -575,7 +_,7 @@
public static class Type<T extends GameRules.Value<T>> {
final Supplier<ArgumentType<?>> argument;
private final Function<GameRules.Type<T>, T> constructor;
- final BiConsumer<MinecraftServer, T> callback;
@ -247,6 +243,19 @@
GameRules.VisitorCaller<T> visitorCaller,
Class<T> valueClass,
FeatureFlagSet requiredFeatures
@@ -611,6 +_,12 @@
public FeatureFlagSet requiredFeatures() {
return this.requiredFeatures;
}
+ // Paper start - expose FeatureElement wrapper for GameRules.Type.
+ // Chosen over simply adding this to the inheritance to avoid reobf issues with spigot...
+ public net.minecraft.world.flag.FeatureElement asFeatureElement() {
+ return net.minecraft.world.level.GameRules.Type.this::requiredFeatures;
+ }
+ // Paper end - expose FeatureElement wrapper for GameRules.Type.
}
public abstract static class Value<T extends GameRules.Value<T>> {
@@ -620,16 +_,16 @@
this.type = type;
}

View File

@ -52,7 +52,7 @@ public class PaperFeatureFlagProviderImpl implements FeatureFlagProvider {
} else if (dependant instanceof final PotionType potionType) {
return CraftPotionType.bukkitToMinecraft(potionType);
} else if (dependant instanceof final GameRule<?> gameRule) {
return getGameRuleType(gameRule.getName());
return getGameRuleType(gameRule.getName()).asFeatureElement();
} else {
throw new IllegalArgumentException(dependant + " is not a valid feature dependant");
}