23w18a support, CI updates, Minor README adjustments (#242)

* Update to 23w18a.

I have finally learned something incredible in the ViaVersion universe, Also i thank RK for his help.

Co-Authored-By: RK_01 <50594595+RaphiMC@users.noreply.github.com>

* Update Gradle dependencies and Jitpack.

* [ci skip] Reference Modrinth properly, 1.19.4 too, Fix typos.

* ViaForge and ViaFabricPlus are also on modrinth.

And now let GitHub actions compile this entire thing.

* Restore and fix viafabric ping textures.

---------

Co-authored-by: RK_01 <50594595+RaphiMC@users.noreply.github.com>
This commit is contained in:
Kichura 2023-05-08 23:09:40 +02:00 committed by GitHub
parent 685efbcddc
commit 4cdceacb94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 43 additions and 38 deletions

View File

@ -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)
<!-- ^ GitHub seems to not like this https -->
### 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:

View File

@ -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()

View File

@ -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

Binary file not shown.

View File

@ -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

12
gradlew vendored
View File

@ -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

2
gradlew.bat vendored
View File

@ -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

View File

@ -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

View File

@ -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"
}

View File

@ -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 {

View File

@ -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();
}
}

View File

@ -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<Text> tooltipText) {
ProtocolVersion proto = ProtocolVersion.getProtocol(((ViaServerInfo) this.server).getViaServerVer());