mirror of
https://github.com/FabricMC/fabric.git
synced 2025-04-21 03:10:54 -04:00
Fix crashes outside of dev
This commit is contained in:
parent
ccb37cc4c4
commit
deaf48319c
2 changed files with 2 additions and 2 deletions
fabric-game-rule-api-v1/src/main/java/net/fabricmc/fabric/mixin/gamerule/client
|
@ -42,7 +42,7 @@ public abstract class RuleListWidgetMixin extends net.minecraft.client.gui.widge
|
|||
super(client, width, height, top, bottom, itemHeight);
|
||||
}
|
||||
|
||||
@Inject(method = "<init>(Lnet/minecraft/world/GameRules;)V", at = @At("TAIL"))
|
||||
@Inject(method = "<init>(Lnet/minecraft/client/gui/screen/world/EditGameRulesScreen;Lnet/minecraft/world/GameRules;)V", at = @At("TAIL"))
|
||||
private void initializeFabricGameruleCategories(EditGameRulesScreen screen, GameRules gameRules, CallbackInfo ci) {
|
||||
this.fabricCategories.forEach((category, widgetList) -> {
|
||||
this.addEntry(screen.new RuleCategoryWidget(category.getName()));
|
||||
|
|
|
@ -62,7 +62,7 @@ public abstract class RuleListWidgetVisitorMixin implements GameRules.Visitor, F
|
|||
/**
|
||||
* @reason We need to display an enum rule's default value as translated.
|
||||
*/
|
||||
@Redirect(at = @At(value = "INVOKE", target = "Lnet/minecraft/world/GameRules$Rule;serialize()Ljava/lang/String;"), method = "createRuleWidget")
|
||||
@Redirect(at = @At(value = "INVOKE", target = "Lnet/minecraft/world/GameRules$Rule;serialize()Ljava/lang/String;"), method = "net/minecraft/client/gui/screen/world/EditGameRulesScreen$RuleListWidget$1.createRuleWidget(Lnet/minecraft/world/GameRules$Key;Lnet/minecraft/client/gui/screen/world/EditGameRulesScreen$RuleWidgetFactory;)V")
|
||||
private <T extends GameRules.Rule<T>> String displayProperEnumName(GameRules.Rule<T> rule, GameRules.Key<T> key, EditGameRulesScreen.RuleWidgetFactory<T> widgetFactory) {
|
||||
if (rule instanceof EnumRule) {
|
||||
String translationKey = key.getTranslationKey() + "." + ((EnumRule<?>) rule).get().name().toLowerCase(Locale.ROOT);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue