From 10547649adf86f253adb573da2fb7a72e6b0246b Mon Sep 17 00:00:00 2001 From: FlorianMichael <60033407+FlorianMichael@users.noreply.github.com> Date: Wed, 14 Feb 2024 23:18:56 +0100 Subject: [PATCH] Fixed GUI rendering --- .../florianmichael/viaforge/gui/GuiProtocolSelector.java | 7 ++++--- .../florianmichael/viaforge/gui/GuiProtocolSelector.java | 3 ++- .../florianmichael/viaforge/gui/GuiProtocolSelector.java | 3 ++- .../florianmichael/viaforge/gui/GuiProtocolSelector.java | 3 ++- .../florianmichael/viaforge/gui/GuiProtocolSelector.java | 3 ++- .../florianmichael/viaforge/gui/GuiProtocolSelector.java | 3 ++- 6 files changed, 14 insertions(+), 8 deletions(-) diff --git a/viaforge-mc112/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java b/viaforge-mc112/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java index 1005ff8..e6c5794 100644 --- a/viaforge-mc112/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java +++ b/viaforge-mc112/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java @@ -27,6 +27,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiButton; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.GuiSlot; +import net.raphimc.vialoader.util.ProtocolVersionList; import org.lwjgl.input.Keyboard; import org.lwjgl.opengl.GL11; @@ -133,12 +134,12 @@ public class GuiProtocolSelector extends GuiScreen { @Override protected int getSize() { - return ProtocolVersion.getProtocols().size(); + return ProtocolVersionList.getProtocolsNewToOld().size(); } @Override protected void elementClicked(int index, boolean b, int i1, int i2) { - finishedCallback.finished(ProtocolVersion.getProtocols().get(index), parent); + finishedCallback.finished(ProtocolVersionList.getProtocolsNewToOld().get(index), parent); } @Override @@ -154,7 +155,7 @@ public class GuiProtocolSelector extends GuiScreen { @Override protected void drawSlot(int index, int x, int y, int slotHeight, int mouseX, int mouseY, float partialTicks) { final ProtocolVersion targetVersion = ViaForgeCommon.getManager().getTargetVersion(); - final ProtocolVersion version = ProtocolVersion.getProtocols().get(index); + final ProtocolVersion version = ProtocolVersionList.getProtocolsNewToOld().get(index); String color; if (targetVersion == version) { diff --git a/viaforge-mc116/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java b/viaforge-mc116/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java index d401726..b9c6b5f 100644 --- a/viaforge-mc116/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java +++ b/viaforge-mc116/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java @@ -30,6 +30,7 @@ import net.minecraft.client.gui.widget.list.ExtendedList; import net.minecraft.util.text.StringTextComponent; import net.minecraft.util.text.TextFormatting; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; +import net.raphimc.vialoader.util.ProtocolVersionList; import org.lwjgl.glfw.GLFW; import org.lwjgl.opengl.GL11; @@ -122,7 +123,7 @@ public class GuiProtocolSelector extends Screen { public SlotList(Minecraft client, int width, int height, int top, int bottom, int slotHeight) { super(client, width, height, top, bottom, slotHeight); - for (ProtocolVersion version : ProtocolVersion.getProtocols()) { + for (ProtocolVersion version : ProtocolVersionList.getProtocolsNewToOld()) { addEntry(new SlotEntry(version)); } } 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 60af73c..895d8bb 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 @@ -30,6 +30,7 @@ import net.minecraft.client.gui.screens.Screen; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.TextComponent; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; +import net.raphimc.vialoader.util.ProtocolVersionList; import org.lwjgl.glfw.GLFW; import java.util.UUID; @@ -121,7 +122,7 @@ public class GuiProtocolSelector extends Screen { public SlotList(Minecraft client, int width, int height, int top, int bottom, int slotHeight) { super(client, width, height, top, bottom, slotHeight); - for (ProtocolVersion version : ProtocolVersion.getProtocols()) { + for (ProtocolVersion version : ProtocolVersionList.getProtocolsNewToOld()) { addEntry(new SlotEntry(version)); } } 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 1931fe1..c165310 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 @@ -30,6 +30,7 @@ import net.minecraft.client.gui.screens.Screen; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.TextComponent; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; +import net.raphimc.vialoader.util.ProtocolVersionList; import org.lwjgl.glfw.GLFW; import java.util.UUID; @@ -121,7 +122,7 @@ public class GuiProtocolSelector extends Screen { public SlotList(Minecraft client, int width, int height, int top, int bottom, int slotHeight) { super(client, width, height, top, bottom, slotHeight); - for (ProtocolVersion version : ProtocolVersion.getProtocols()) { + for (ProtocolVersion version : ProtocolVersionList.getProtocolsNewToOld()) { addEntry(new SlotEntry(version)); } } 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 e1c9688..9fbdb63 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 @@ -29,6 +29,7 @@ import net.minecraft.client.gui.components.ObjectSelectionList; import net.minecraft.client.gui.screens.Screen; import net.minecraft.network.chat.Component; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; +import net.raphimc.vialoader.util.ProtocolVersionList; import org.lwjgl.glfw.GLFW; import java.util.UUID; @@ -120,7 +121,7 @@ public class GuiProtocolSelector extends Screen { public SlotList(Minecraft client, int width, int height, int top, int bottom, int slotHeight) { super(client, width, height, top, bottom, slotHeight); - for (ProtocolVersion version : ProtocolVersion.getProtocols()) { + for (ProtocolVersion version : ProtocolVersionList.getProtocolsNewToOld()) { addEntry(new SlotEntry(version)); } } 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 989700b..2838166 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 @@ -29,6 +29,7 @@ import net.minecraft.client.gui.components.ObjectSelectionList; import net.minecraft.client.gui.screens.Screen; import net.minecraft.network.chat.Component; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; +import net.raphimc.vialoader.util.ProtocolVersionList; import org.lwjgl.glfw.GLFW; import java.util.UUID; @@ -120,7 +121,7 @@ public class GuiProtocolSelector extends Screen { public SlotList(Minecraft client, int width, int height, int top, int bottom, int slotHeight) { super(client, width, height - top - bottom, top, slotHeight); - for (ProtocolVersion version : ProtocolVersion.getProtocols()) { + for (ProtocolVersion version : ProtocolVersionList.getProtocolsNewToOld()) { addEntry(new SlotEntry(version)); } }