Fix reobf mappings regression in GameRules.Type (#12437)

The recent commit 121a7bf4eb added
the interface FeatureElement to the GameRules.Type class to expose the
stored feature flags of gamerules.
This however messed with the reobf mappings spigot uses, as the now
overridden method requiredFeatures needs to be mapped to the same
obfuscated name as FeatureElement#requiredFeatures.

To avoid having this in the mappings patch, the commit removes the
inheritance again and instead exposes a wrapper method.
This commit is contained in:
Bjarne Koll
2025-04-14 17:05:01 +02:00
committed by GitHub
parent 7d5695d774
commit de410d13ef
2 changed files with 16 additions and 7 deletions

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");
}