diff --git a/README.md b/README.md index 9a906e1..7d8688f 100644 --- a/README.md +++ b/README.md @@ -2,15 +2,15 @@ [![ViaVersion Discord](https://img.shields.io/badge/chat-on%20discord-blue.svg)](https://viaversion.com/discord) [![CurseForge Downloads](http://cf.way2muchnoise.eu/full_viafabric_downloads.svg)](https://viaversion.com/fabric) +[![Modrinth Downloads](https://img.shields.io/modrinth/dt/ViaFabric?label=Modrinth&logo=Modrinth&style=flat-square)](https://modrinth.com/mod/ViaFabric) [![CurseForge Versions](http://cf.way2muchnoise.eu/versions/viafabric.svg)](https://viaversion.com/fabric) -[![Download on Modrinth](https://img.shields.io/badge/download-modrinth-green)](https://modrinth.com/mod/viafabric) ### Client-side and server-side ViaVersion implementation for Fabric Allows the connection to/from different Minecraft versions on your Minecraft client/server (LAN worlds too) -This mod can be installed on 1.8.9, 1.14.4, 1.15.2, 1.16.5, 1.17.1, 1.18.2 with Fabric Loader. +This mod can be installed on 1.8.9, 1.14.4, 1.15.2, 1.16.5, 1.17.1, 1.18.2, 1.19.4 with Fabric Loader. ## Dependencies @@ -18,8 +18,8 @@ This mod can be installed on 1.8.9, 1.14.4, 1.15.2, 1.16.5, 1.17.1, 1.18.2 with |-----------------------------------------------|----------------------------------------------------------------| | (Bundled) ViaVersion | https://viaversion.com/ | | (Bundled) Cotton Client Commands (MC 1.14-15) | https://jitpack.io/#TinfoilMC/ClientCommands | -| Fabric API (MC 1.14+) | https://www.curseforge.com/minecraft/mc-mods/fabric-api | -| Legacy Fabric API (MC 1.8.9) | https://www.curseforge.com/minecraft/mc-mods/legacy-fabric-api | +| Fabric API (MC 1.14+) | https://modrinth.com/mod/fabric-api | +| Legacy Fabric API (MC 1.8.9) | https://modrinth.com/mod/legacy-fabric-api | Note: ViaVersion is designed for Vanilla Minecraft servers. It probably will not work with modded registry entries or registry synchronization (fabric-registry-sync mod). @@ -71,8 +71,8 @@ registry synchronization (fabric-registry-sync mod). - [ClientViaVersion](https://github.com/Gerrygames/ClientViaVersion): Discontinued 5zig plugin. - [multiconnect](https://www.curseforge.com/minecraft/mc-mods/multiconnect): Fabric mod for connecting to older versions: down to 1.11 (stable) and 1.8 (experimental). -- [ViaForge](https://www.curseforge.com/minecraft/mc-mods/viaforge): Fork of ViaFabric porting it to Forge. -- [ViaFabricPlus](https://www.curseforge.com/minecraft/mc-mods/viafabricplus): Fabric ViaVersion/ViaLegacy/ViaAprilFools implementation with clientside fixes +- [ViaForge](https://www.modrinth.com/mod/viaforge): Fork of ViaFabric porting it to Forge. +- [ViaFabricPlus](https://www.modrinth.com/mod/viafabricplus): Fabric ViaVersion/ViaLegacy/ViaAprilFools implementation with client-side fixes. ### Server-side: diff --git a/build.gradle b/build.gradle index b83866c..a29e648 100644 --- a/build.gradle +++ b/build.gradle @@ -9,11 +9,11 @@ import java.util.stream.IntStream plugins { id "java" id "maven-publish" - id "org.ajoberstar.grgit" version "3.1.1" + id "org.ajoberstar.grgit" version "5.2.0" id "com.matthewprenger.cursegradle" version "1.4.0" - id "com.modrinth.minotaur" version "2.2.0" - id "fabric-loom" version "1.1-SNAPSHOT" apply false - id "com.github.ben-manes.versions" version "0.42.0" + id "com.modrinth.minotaur" version "2.7.5" + id "fabric-loom" version "1.2-SNAPSHOT" apply false + id "com.github.ben-manes.versions" version "0.46.0" } def ENV = System.getenv() diff --git a/gradle.properties b/gradle.properties index ffd1e01..d9ec1ab 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,11 +3,11 @@ org.gradle.jvmargs=-Xms32M -Xmx4G -XX:+UseG1GC -XX:+UseStringDeduplication loader_version=0.14.19 -viaver_version=4.7.0-23w14a-SNAPSHOT +viaver_version=4.7.0-23w18a-SNAPSHOT yaml_version=2.0 publish_mc_versions=1.19.4, 1.18.2, 1.17.1, 1.16.5, 1.15.2, 1.14.4, 1.8.9 # example: 1.19.1-rc2 -modrinth_mc_snapshot=23w14a +modrinth_mc_snapshot=23w18a # example: 1.19-Snapshot curseforge_mc_snapshot=1.20-Snapshot diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index ccebba7..c1962a7 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index bdc9a83..37aef8d 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 79a61d4..ae5eddb 100755 --- a/gradlew +++ b/gradlew @@ -85,9 +85,6 @@ done APP_BASE_NAME=${0##*/} APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum @@ -133,10 +130,13 @@ location of your Java installation." fi else JAVACMD=java - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. + if ! command -v java >/dev/null 2>&1 + then + die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. Please set the JAVA_HOME variable in your environment to match the location of your Java installation." + fi fi # Increase the maximum file descriptors if we can. @@ -197,6 +197,10 @@ if "$cygwin" || "$msys" ; then done fi + +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. +DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m"' + # Collect all arguments for the java command; # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of # shell script including quotes and variable substitutions, so put them in diff --git a/gradlew.bat b/gradlew.bat index 93e3f59..ea603b4 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -34,7 +34,7 @@ set APP_HOME=%DIRNAME% for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" +set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8 "-Xmx64m" "-Xms64m" @rem Find java.exe if defined JAVA_HOME goto findJavaFromJavaHome diff --git a/jitpack.yml b/jitpack.yml index afe9356..e4615c6 100644 --- a/jitpack.yml +++ b/jitpack.yml @@ -1,5 +1,5 @@ before_install: - curl -s "https://get.sdkman.io" | bash - source "$HOME/.sdkman/bin/sdkman-init.sh" - - sdk install java 17.0.5+8-tem - - sdk use java 17.0.5+8-tem + - sdk install java 17.0.7+7-tem + - sdk use java 17.0.7+7-tem diff --git a/settings.gradle.kts b/settings.gradle.kts index ff622ce..cf0a26a 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -17,5 +17,5 @@ include("viafabric-mc119") include("viafabric-mc120") plugins { - id("org.gradle.toolchains.foojay-resolver-convention") version "0.4.0" + id("org.gradle.toolchains.foojay-resolver-convention") version "0.5.0" } diff --git a/viafabric-mc120/build.gradle.kts b/viafabric-mc120/build.gradle.kts index 2480c82..01ea7de 100644 --- a/viafabric-mc120/build.gradle.kts +++ b/viafabric-mc120/build.gradle.kts @@ -1,9 +1,9 @@ dependencies { - minecraft("com.mojang:minecraft:23w14a") - mappings("net.fabricmc:yarn:23w14a+build.4:v2") + minecraft("com.mojang:minecraft:23w18a") + mappings("net.fabricmc:yarn:23w18a+build.4:v2") - modImplementation("net.fabricmc.fabric-api:fabric-api:0.77.2+1.20") - modImplementation("com.terraformersmc:modmenu:6.1.0-rc.4") + modImplementation("net.fabricmc.fabric-api:fabric-api:0.80.0+1.20") + modImplementation("com.terraformersmc:modmenu:7.0.0-beta.2") } tasks.compileJava { diff --git a/viafabric-mc120/src/main/java/com/viaversion/fabric/mc120/gui/ViaConfigScreen.java b/viafabric-mc120/src/main/java/com/viaversion/fabric/mc120/gui/ViaConfigScreen.java index 0d03f96..163b690 100644 --- a/viafabric-mc120/src/main/java/com/viaversion/fabric/mc120/gui/ViaConfigScreen.java +++ b/viafabric-mc120/src/main/java/com/viaversion/fabric/mc120/gui/ViaConfigScreen.java @@ -10,7 +10,7 @@ import net.minecraft.client.gui.screen.ConfirmScreen; import net.minecraft.client.gui.screen.Screen; import net.minecraft.client.gui.widget.ButtonWidget; import net.minecraft.client.gui.widget.TextFieldWidget; -import net.minecraft.client.util.math.MatrixStack; +import net.minecraft.client.gui.DrawContext; import net.minecraft.screen.ScreenTexts; import net.minecraft.text.Text; @@ -142,10 +142,10 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen { } @Override - public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) { - this.renderBackground(matrices); - drawCenteredTextWithShadow(matrices, this.textRenderer, this.title, this.width / 2, 20, 16777215); - super.render(matrices, mouseX, mouseY, delta); + public void render(DrawContext drawContext, int mouseX, int mouseY, float delta) { + this.renderBackground(drawContext); + drawContext.drawCenteredTextWithShadow(this.textRenderer, this.title, this.width / 2, 20, 16777215); + super.render(drawContext, mouseX, mouseY, delta); } @Override @@ -154,4 +154,3 @@ public class ViaConfigScreen extends Screen implements AbstractViaConfigScreen { protocolVersion.tick(); } } - diff --git a/viafabric-mc120/src/main/java/com/viaversion/fabric/mc120/mixin/gui/client/MixinServerEntry.java b/viafabric-mc120/src/main/java/com/viaversion/fabric/mc120/mixin/gui/client/MixinServerEntry.java index dfe39e3..fe03cfa 100644 --- a/viafabric-mc120/src/main/java/com/viaversion/fabric/mc120/mixin/gui/client/MixinServerEntry.java +++ b/viafabric-mc120/src/main/java/com/viaversion/fabric/mc120/mixin/gui/client/MixinServerEntry.java @@ -3,7 +3,7 @@ package com.viaversion.fabric.mc120.mixin.gui.client; import com.mojang.blaze3d.systems.RenderSystem; import com.viaversion.fabric.common.gui.ViaServerInfo; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; -import net.minecraft.client.gui.DrawableHelper; +import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.screen.multiplayer.MultiplayerScreen; import net.minecraft.client.gui.screen.multiplayer.MultiplayerServerListWidget; import net.minecraft.client.network.ServerInfo; @@ -25,15 +25,17 @@ public class MixinServerEntry { private ServerInfo server; @Redirect(method = "render", at = @At(value = "INVOKE", ordinal = 0, - target = "Lcom/mojang/blaze3d/systems/RenderSystem;setShaderTexture(ILnet/minecraft/util/Identifier;)V")) - private void redirectPingIcon(int i, Identifier identifier) { - if (identifier.equals(DrawableHelper.GUI_ICONS_TEXTURE) && ((ViaServerInfo) this.server).isViaTranslating()) { - RenderSystem.setShaderTexture(i, new Identifier("viafabric:textures/gui/icons.png")); + target = "Lnet/minecraft/client/gui/DrawContext;drawTexture(Lnet/minecraft/util/Identifier;IIFFIIII)V")) + private void redirectPingIcon(DrawContext instance, Identifier texture, int x, int y, float u, float v, int width, int height, int textureWidth, int textureHeight) { + if (texture.equals(GUI_ICONS_TEXTURES) && ((ViaServerInfo) this.server).isViaTranslating()) { + instance.drawTexture(new Identifier("textures/gui/icons.png"), x, y, u, v, width, height, textureWidth, textureHeight); return; } - RenderSystem.setShaderTexture(i, identifier); + instance.drawTexture(texture, x, y, u, v, width, height, textureWidth, textureHeight); } + private static final Identifier GUI_ICONS_TEXTURES = new Identifier("textures/gui/icons.png"); + @Redirect(method = "render", at = @At(value = "INVOKE", ordinal = 0, target = "Lnet/minecraft/client/gui/screen/multiplayer/MultiplayerScreen;setMultiplayerScreenTooltip(Ljava/util/List;)V")) private void addServerVer(MultiplayerScreen multiplayerScreen, List tooltipText) { ProtocolVersion proto = ProtocolVersion.getProtocol(((ViaServerInfo) this.server).getViaServerVer()); @@ -41,4 +43,4 @@ public class MixinServerEntry { lines.add(Text.translatable("gui.ping_version.translated", proto.getName(), proto.getVersion())); multiplayerScreen.setMultiplayerScreenTooltip(lines); } -} \ No newline at end of file +}