From 141a908b63e039063101fa847a2ced5266799278 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?der=5Ffr=C3=BChling?= Date: Thu, 8 Aug 2024 15:11:40 -0700 Subject: [PATCH] port to 1.18.2 --- .../minecraft/create/trainperspective/ModConfig.java | 4 ++-- .../create/trainperspective/mixin/LocalPlayerMixin.java | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/src/main/java/net/derfruhling/minecraft/create/trainperspective/ModConfig.java b/common/src/main/java/net/derfruhling/minecraft/create/trainperspective/ModConfig.java index 426632f..6652327 100644 --- a/common/src/main/java/net/derfruhling/minecraft/create/trainperspective/ModConfig.java +++ b/common/src/main/java/net/derfruhling/minecraft/create/trainperspective/ModConfig.java @@ -218,10 +218,10 @@ public static Screen createConfigScreen(Screen parent) { debug.add(entryBuilder .startBooleanToggle( - Component.translatable("option.create_train_perspective.debug.value_scales"), + new TranslatableComponent("option.create_train_perspective.debug.value_scales"), INSTANCE.dbgShowValueScales) .setSaveConsumer(value -> INSTANCE.dbgShowValueScales = value) - .setTooltip(Component.translatable("option.create_train_perspective.debug.value_scales.tooltip")) + .setTooltip(new TranslatableComponent("option.create_train_perspective.debug.value_scales.tooltip")) .setDefaultValue(false) .build()); diff --git a/common/src/main/java/net/derfruhling/minecraft/create/trainperspective/mixin/LocalPlayerMixin.java b/common/src/main/java/net/derfruhling/minecraft/create/trainperspective/mixin/LocalPlayerMixin.java index a770387..6cf1698 100644 --- a/common/src/main/java/net/derfruhling/minecraft/create/trainperspective/mixin/LocalPlayerMixin.java +++ b/common/src/main/java/net/derfruhling/minecraft/create/trainperspective/mixin/LocalPlayerMixin.java @@ -36,7 +36,7 @@ import net.minecraft.client.player.AbstractClientPlayer; import net.minecraft.client.player.LocalPlayer; import net.minecraft.network.chat.Component; -import net.minecraft.world.entity.player.ProfilePublicKey; +import net.minecraft.network.chat.TextComponent; import org.jetbrains.annotations.Nullable; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; @@ -53,8 +53,8 @@ public abstract class LocalPlayerMixin extends AbstractClientPlayer { @Shadow public abstract void displayClientMessage(Component arg, boolean bl); - public LocalPlayerMixin(ClientLevel clientLevel, GameProfile gameProfile, @Nullable ProfilePublicKey profilePublicKey) { - super(clientLevel, gameProfile, profilePublicKey); + public LocalPlayerMixin(ClientLevel clientLevel, GameProfile gameProfile) { + super(clientLevel, gameProfile); } @WrapOperation(method = "getViewYRot", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/player/LocalPlayer;isPassenger()Z")) @@ -68,7 +68,7 @@ public void tickDebugFeatures(CallbackInfo ci) { var persp = (Perspective) this; if(ModConfig.INSTANCE.dbgShowValueScales) { - this.displayClientMessage(Component.literal(persp.getValueScale() + ", " + persp.getPrevValueScale()), true); + this.displayClientMessage(new TextComponent(persp.getValueScale() + ", " + persp.getPrevValueScale()), true); } } }