Skip to content

Commit

Permalink
port to 1.18.2
Browse files Browse the repository at this point in the history
  • Loading branch information
der-fruhling committed Aug 8, 2024
1 parent 4a6194c commit 141a908
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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"))
Expand All @@ -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);
}
}
}

0 comments on commit 141a908

Please sign in to comment.