From 46973f56db1fdc15941c750c7ebb17c6a9b89ce3 Mon Sep 17 00:00:00 2001 From: fayer3 Date: Sun, 15 Sep 2024 02:51:22 +0200 Subject: [PATCH] 1.18.2 fixes --- .../modmenu/mixin/ModMenuEventHandlerVRMixin.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/common/src/main/java/org/vivecraft/mod_compat_vr/modmenu/mixin/ModMenuEventHandlerVRMixin.java b/common/src/main/java/org/vivecraft/mod_compat_vr/modmenu/mixin/ModMenuEventHandlerVRMixin.java index 890755ce8..5dbdd0a81 100644 --- a/common/src/main/java/org/vivecraft/mod_compat_vr/modmenu/mixin/ModMenuEventHandlerVRMixin.java +++ b/common/src/main/java/org/vivecraft/mod_compat_vr/modmenu/mixin/ModMenuEventHandlerVRMixin.java @@ -3,7 +3,7 @@ import net.minecraft.client.gui.components.Button; import net.minecraft.client.gui.components.events.GuiEventListener; import net.minecraft.client.gui.screens.Screen; -import net.minecraft.network.chat.contents.TranslatableContents; +import net.minecraft.network.chat.TranslatableComponent; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Pseudo; import org.spongepowered.asm.mixin.injection.At; @@ -23,13 +23,13 @@ public abstract class ModMenuEventHandlerVRMixin { Button reportBugsButton = null; for (GuiEventListener guiEventListener : screen.children()) { if (guiEventListener instanceof Button button) { - if (button.getMessage().getContents() instanceof TranslatableContents contents + if (button.getMessage() instanceof TranslatableComponent contents && "modmenu.title".equals(contents.getKey())) { modmenuButton = button; - } else if (button.getMessage().getContents() instanceof TranslatableContents contents + } else if (button.getMessage() instanceof TranslatableComponent contents && "vivecraft.gui.commands".equals(contents.getKey())) { commandsButton = button; - } else if (button.getMessage().getContents() instanceof TranslatableContents contents + } else if (button.getMessage() instanceof TranslatableComponent contents && "menu.reportBugs".equals(contents.getKey())) { reportBugsButton = button; }