From cd293c781f2745c95e4e283a84e518983f18f13f Mon Sep 17 00:00:00 2001 From: FlorianMichael <60033407+FlorianMichael@users.noreply.github.com> Date: Tue, 2 Jan 2024 17:01:21 +0100 Subject: [PATCH] Fixed compile errors --- .../viaforge/gui/GuiProtocolSelector.java | 13 ++++++------- .../viaforge/gui/GuiProtocolSelector.java | 13 ++++++------- .../viaforge/gui/GuiProtocolSelector.java | 13 ++++++------- .../viaforge/gui/GuiProtocolSelector.java | 14 ++++++-------- 4 files changed, 24 insertions(+), 29 deletions(-) diff --git a/viaforge-mc117/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java b/viaforge-mc117/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java index 65efee2..a6f9698 100644 --- a/viaforge-mc117/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java +++ b/viaforge-mc117/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java @@ -22,7 +22,7 @@ import com.mojang.blaze3d.vertex.PoseStack; import com.viaversion.viaversion.api.Via; import com.viaversion.viaversion.util.DumpUtil; import de.florianmichael.viaforge.common.ViaForgeCommon; -import net.lenni0451.mcstructs.core.TextFormatting; +import net.minecraft.ChatFormatting; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.components.Button; import net.minecraft.client.gui.components.ObjectSelectionList; @@ -31,7 +31,6 @@ import net.minecraft.network.chat.Component; import net.minecraft.network.chat.TextComponent; import net.raphimc.vialoader.util.VersionEnum; import org.lwjgl.glfw.GLFW; -import org.lwjgl.opengl.GL11; import java.util.UUID; import java.util.concurrent.ExecutionException; @@ -73,9 +72,9 @@ public class GuiProtocolSelector extends Screen { addRenderableWidget(new Button(width - 105, 5, 100, 20, new TextComponent("Create dump"), b -> { try { minecraft.keyboardHandler.setClipboard(DumpUtil.postDump(UUID.randomUUID()).get()); - setStatus(TextFormatting.GREEN + "Dump created and copied to clipboard"); + setStatus(ChatFormatting.GREEN + "Dump created and copied to clipboard"); } catch (InterruptedException | ExecutionException e) { - setStatus(TextFormatting.RED + "Failed to create dump: " + e.getMessage()); + setStatus(ChatFormatting.RED + "Failed to create dump: " + e.getMessage()); } })); addRenderableWidget(new Button(width - 105, height - 25, 100, 20, new TextComponent("Reload configs"), b -> Via.getManager().getConfigurationProvider().reloadConfigs())); @@ -110,7 +109,7 @@ public class GuiProtocolSelector extends Screen { matrices.pushPose(); matrices.scale(2.0F, 2.0F, 2.0F); - drawCenteredString(matrices, font, TextFormatting.GOLD + "ViaForge", width / 4, 3, 16777215); + drawCenteredString(matrices, font, ChatFormatting.GOLD + "ViaForge", width / 4, 3, 16777215); matrices.popPose(); drawCenteredString(matrices, font, "https://github.com/ViaVersion/ViaForge", width / 2, (font.lineHeight + 2) * 2 + 3, -1); @@ -152,9 +151,9 @@ public class GuiProtocolSelector extends Screen { String color; if (targetVersion == versionEnum) { - color = GuiProtocolSelector.this.simple ? TextFormatting.GOLD.toString() : TextFormatting.GREEN.toString(); + color = GuiProtocolSelector.this.simple ? ChatFormatting.GOLD.toString() : ChatFormatting.GREEN.toString(); } else { - color = GuiProtocolSelector.this.simple ? TextFormatting.WHITE.toString() : TextFormatting.DARK_RED.toString(); + color = GuiProtocolSelector.this.simple ? ChatFormatting.WHITE.toString() : ChatFormatting.DARK_RED.toString(); } drawCenteredString(matrices, Minecraft.getInstance().font, color + versionEnum.getName(), width / 2, y, -1); diff --git a/viaforge-mc118/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java b/viaforge-mc118/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java index 6675e56..6bded86 100644 --- a/viaforge-mc118/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java +++ b/viaforge-mc118/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java @@ -22,7 +22,7 @@ import com.mojang.blaze3d.vertex.PoseStack; import com.viaversion.viaversion.api.Via; import com.viaversion.viaversion.util.DumpUtil; import de.florianmichael.viaforge.common.ViaForgeCommon; -import net.lenni0451.mcstructs.core.TextFormatting; +import net.minecraft.ChatFormatting; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.components.Button; import net.minecraft.client.gui.components.ObjectSelectionList; @@ -31,7 +31,6 @@ import net.minecraft.network.chat.Component; import net.minecraft.network.chat.TextComponent; import net.raphimc.vialoader.util.VersionEnum; import org.lwjgl.glfw.GLFW; -import org.lwjgl.opengl.GL11; import java.util.UUID; import java.util.concurrent.ExecutionException; @@ -73,9 +72,9 @@ public class GuiProtocolSelector extends Screen { addRenderableWidget(new Button(width - 105, 5, 100, 20, new TextComponent("Create dump"), b -> { try { minecraft.keyboardHandler.setClipboard(DumpUtil.postDump(UUID.randomUUID()).get()); - setStatus(TextFormatting.GREEN + "Dump created and copied to clipboard"); + setStatus(ChatFormatting.GREEN + "Dump created and copied to clipboard"); } catch (InterruptedException | ExecutionException e) { - setStatus(TextFormatting.RED + "Failed to create dump: " + e.getMessage()); + setStatus(ChatFormatting.RED + "Failed to create dump: " + e.getMessage()); } })); addRenderableWidget(new Button(width - 105, height - 25, 100, 20, new TextComponent("Reload configs"), b -> Via.getManager().getConfigurationProvider().reloadConfigs())); @@ -110,7 +109,7 @@ public class GuiProtocolSelector extends Screen { matrices.pushPose(); matrices.scale(2.0F, 2.0F, 2.0F); - drawCenteredString(matrices, font, TextFormatting.GOLD + "ViaForge", width / 4, 3, 16777215); + drawCenteredString(matrices, font, ChatFormatting.GOLD + "ViaForge", width / 4, 3, 16777215); matrices.popPose(); drawCenteredString(matrices, font, "https://github.com/ViaVersion/ViaForge", width / 2, (font.lineHeight + 2) * 2 + 3, -1); @@ -152,9 +151,9 @@ public class GuiProtocolSelector extends Screen { String color; if (targetVersion == versionEnum) { - color = GuiProtocolSelector.this.simple ? TextFormatting.GOLD.toString() : TextFormatting.GREEN.toString(); + color = GuiProtocolSelector.this.simple ? ChatFormatting.GOLD.toString() : ChatFormatting.GREEN.toString(); } else { - color = GuiProtocolSelector.this.simple ? TextFormatting.WHITE.toString() : TextFormatting.DARK_RED.toString(); + color = GuiProtocolSelector.this.simple ? ChatFormatting.WHITE.toString() : ChatFormatting.DARK_RED.toString(); } drawCenteredString(matrices, Minecraft.getInstance().font, color + versionEnum.getName(), width / 2, y, -1); diff --git a/viaforge-mc119/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java b/viaforge-mc119/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java index 494d0b7..3ca5f8f 100644 --- a/viaforge-mc119/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java +++ b/viaforge-mc119/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java @@ -22,7 +22,7 @@ import com.mojang.blaze3d.vertex.PoseStack; import com.viaversion.viaversion.api.Via; import com.viaversion.viaversion.util.DumpUtil; import de.florianmichael.viaforge.common.ViaForgeCommon; -import net.lenni0451.mcstructs.core.TextFormatting; +import net.minecraft.ChatFormatting; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.components.Button; import net.minecraft.client.gui.components.ObjectSelectionList; @@ -30,7 +30,6 @@ import net.minecraft.client.gui.screens.Screen; import net.minecraft.network.chat.Component; import net.raphimc.vialoader.util.VersionEnum; import org.lwjgl.glfw.GLFW; -import org.lwjgl.opengl.GL11; import java.util.UUID; import java.util.concurrent.ExecutionException; @@ -72,9 +71,9 @@ public class GuiProtocolSelector extends Screen { addRenderableWidget(Button.builder(Component.literal("Create dump"), b -> { try { minecraft.keyboardHandler.setClipboard(DumpUtil.postDump(UUID.randomUUID()).get()); - setStatus(TextFormatting.GREEN + "Dump created and copied to clipboard"); + setStatus(ChatFormatting.GREEN + "Dump created and copied to clipboard"); } catch (InterruptedException | ExecutionException e) { - setStatus(TextFormatting.RED + "Failed to create dump: " + e.getMessage()); + setStatus(ChatFormatting.RED + "Failed to create dump: " + e.getMessage()); } }).bounds(width - 105, 5, 100, 20).build()); addRenderableWidget(Button.builder(Component.literal("Reload configs"), b -> Via.getManager().getConfigurationProvider().reloadConfigs()).bounds(width - 105, height - 25, 100, 20).build()); @@ -109,7 +108,7 @@ public class GuiProtocolSelector extends Screen { matrices.pushPose(); matrices.scale(2.0F, 2.0F, 2.0F); - drawCenteredString(matrices, font, TextFormatting.GOLD + "ViaForge", width / 4, 3, 16777215); + drawCenteredString(matrices, font, ChatFormatting.GOLD + "ViaForge", width / 4, 3, 16777215); matrices.popPose(); drawCenteredString(matrices, font, "https://github.com/ViaVersion/ViaForge", width / 2, (font.lineHeight + 2) * 2 + 3, -1); @@ -151,9 +150,9 @@ public class GuiProtocolSelector extends Screen { String color; if (targetVersion == versionEnum) { - color = GuiProtocolSelector.this.simple ? TextFormatting.GOLD.toString() : TextFormatting.GREEN.toString(); + color = GuiProtocolSelector.this.simple ? ChatFormatting.GOLD.toString() : ChatFormatting.GREEN.toString(); } else { - color = GuiProtocolSelector.this.simple ? TextFormatting.WHITE.toString() : TextFormatting.DARK_RED.toString(); + color = GuiProtocolSelector.this.simple ? ChatFormatting.WHITE.toString() : ChatFormatting.DARK_RED.toString(); } drawCenteredString(matrices, Minecraft.getInstance().font, color + versionEnum.getName(), width / 2, y, -1); diff --git a/viaforge-mc120/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java b/viaforge-mc120/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java index 415e896..bb70956 100644 --- a/viaforge-mc120/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java +++ b/viaforge-mc120/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java @@ -18,11 +18,10 @@ package de.florianmichael.viaforge.gui; -import com.mojang.blaze3d.vertex.PoseStack; import com.viaversion.viaversion.api.Via; import com.viaversion.viaversion.util.DumpUtil; import de.florianmichael.viaforge.common.ViaForgeCommon; -import net.lenni0451.mcstructs.core.TextFormatting; +import net.minecraft.ChatFormatting; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.gui.components.Button; @@ -31,7 +30,6 @@ import net.minecraft.client.gui.screens.Screen; import net.minecraft.network.chat.Component; import net.raphimc.vialoader.util.VersionEnum; import org.lwjgl.glfw.GLFW; -import org.lwjgl.opengl.GL11; import java.util.UUID; import java.util.concurrent.ExecutionException; @@ -73,9 +71,9 @@ public class GuiProtocolSelector extends Screen { addRenderableWidget(Button.builder(Component.literal("Create dump"), b -> { try { minecraft.keyboardHandler.setClipboard(DumpUtil.postDump(UUID.randomUUID()).get()); - setStatus(TextFormatting.GREEN + "Dump created and copied to clipboard"); + setStatus(ChatFormatting.GREEN + "Dump created and copied to clipboard"); } catch (InterruptedException | ExecutionException e) { - setStatus(TextFormatting.RED + "Failed to create dump: " + e.getMessage()); + setStatus(ChatFormatting.RED + "Failed to create dump: " + e.getMessage()); } }).bounds(width - 105, 5, 100, 20).build()); addRenderableWidget(Button.builder(Component.literal("Reload configs"), b -> Via.getManager().getConfigurationProvider().reloadConfigs()).bounds(width - 105, height - 25, 100, 20).build()); @@ -110,7 +108,7 @@ public class GuiProtocolSelector extends Screen { pose.pushPose(); pose.scale(2.0F, 2.0F, 2.0F); - graphics.drawCenteredString(font, TextFormatting.GOLD + "ViaForge", width / 4, 3, 16777215); + graphics.drawCenteredString(font, ChatFormatting.GOLD + "ViaForge", width / 4, 3, 16777215); pose.popPose(); graphics.drawCenteredString(font, "https://github.com/ViaVersion/ViaForge", width / 2, (font.lineHeight + 2) * 2 + 3, -1); @@ -152,9 +150,9 @@ public class GuiProtocolSelector extends Screen { String color; if (targetVersion == versionEnum) { - color = GuiProtocolSelector.this.simple ? TextFormatting.GOLD.toString() : TextFormatting.GREEN.toString(); + color = GuiProtocolSelector.this.simple ? ChatFormatting.GOLD.toString() : ChatFormatting.GREEN.toString(); } else { - color = GuiProtocolSelector.this.simple ? TextFormatting.WHITE.toString() : TextFormatting.DARK_RED.toString(); + color = GuiProtocolSelector.this.simple ? ChatFormatting.WHITE.toString() : ChatFormatting.DARK_RED.toString(); } graphics.drawCenteredString(Minecraft.getInstance().font, color + versionEnum.getName(), width / 2, y, -1);