From dbf346eef83831c3e0cb1a50d740575702165bdd Mon Sep 17 00:00:00 2001 From: FlorianMichael <60033407+FlorianMichael@users.noreply.github.com> Date: Thu, 8 Jun 2023 20:18:39 +0200 Subject: [PATCH] Fixed GUI and building --- .github/workflows/main.yml | 2 +- gradle.properties | 7 ++++--- mc1122/build.gradle | 3 ++- .../src/main/java/de/florianmichael/viaforge/ViaForge.java | 3 +++ .../florianmichael/viaforge/gui/GuiProtocolSelector.java | 6 +++--- 5 files changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fd7c406..1a95026 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,4 +27,4 @@ jobs: uses: actions/upload-artifact@v3 with: name: ViaForge-1.12.2 - path: build/libs/ + path: mc1122/build/libs/ diff --git a/gradle.properties b/gradle.properties index 86df7c0..b381519 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,12 +8,13 @@ mod_name=ViaForge mod_version=3.3.2 mod_base_package=de.florianmichael -# mixin -mixin_version=0.8.3 - # via-version vialoader_version=2.2.5-SNAPSHOT viaversion_version=4.7.0 viabackwards_version=4.7.0 viarewind_version=2.0.4-SNAPSHOT snake_yml_version=2.0 + +# libs +slf4j_version=2.0.7 +mixin_version=0.8.3 diff --git a/mc1122/build.gradle b/mc1122/build.gradle index 521ff72..e7087f0 100644 --- a/mc1122/build.gradle +++ b/mc1122/build.gradle @@ -88,7 +88,8 @@ def viaLibs = [ "com.viaversion:viarewind-core:${project.viarewind_version}", "org.yaml:snakeyaml:${project.snake_yml_version}", - "net.raphimc:ViaLoader:${project.vialoader_version}" + "net.raphimc:ViaLoader:${project.vialoader_version}", + "org.slf4j:slf4j-api:${project.slf4j_version}" ] dependencies { diff --git a/mc1122/src/main/java/de/florianmichael/viaforge/ViaForge.java b/mc1122/src/main/java/de/florianmichael/viaforge/ViaForge.java index d3127ac..dcbf9b3 100644 --- a/mc1122/src/main/java/de/florianmichael/viaforge/ViaForge.java +++ b/mc1122/src/main/java/de/florianmichael/viaforge/ViaForge.java @@ -38,6 +38,9 @@ public class ViaForge { @Mod.EventHandler public void init(FMLPreInitializationEvent event) { + VersionEnum.SORTED_VERSIONS.remove(VersionEnum.r1_7_6tor1_7_10); + VersionEnum.SORTED_VERSIONS.remove(VersionEnum.r1_7_2tor1_7_5); + ViaLoader.init( null, new VLLoader() { diff --git a/mc1122/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java b/mc1122/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java index cf2f875..0d2958e 100644 --- a/mc1122/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java +++ b/mc1122/src/main/java/de/florianmichael/viaforge/gui/GuiProtocolSelector.java @@ -80,12 +80,12 @@ public class GuiProtocolSelector extends GuiScreen { @Override protected int getSize() { - return VersionEnum.OFFICIAL_SUPPORTED_PROTOCOLS.size(); + return VersionEnum.SORTED_VERSIONS.size(); } @Override protected void elementClicked(int i, boolean b, int i1, int i2) { - ViaForge.targetVersion = VersionEnum.OFFICIAL_SUPPORTED_PROTOCOLS.get(i); + ViaForge.targetVersion = VersionEnum.SORTED_VERSIONS.get(i); } @Override @@ -100,7 +100,7 @@ public class GuiProtocolSelector extends GuiScreen { @Override protected void drawSlot(int i, int i1, int i2, int i3, int i4, int i5, float v) { - final VersionEnum version = VersionEnum.OFFICIAL_SUPPORTED_PROTOCOLS.get(i); + final VersionEnum version = VersionEnum.SORTED_VERSIONS.get(i); drawCenteredString(mc.fontRenderer,(ViaForge.targetVersion.getVersion() == version.getVersion() ? ChatFormatting.GREEN.toString() : ChatFormatting.DARK_RED.toString()) + version.getName(), width / 2, i2, -1); }