From 5445ec5f5910ef276a479baffc7a37d06b62d792 Mon Sep 17 00:00:00 2001 From: FlorianMichael <60033407+FlorianMichael@users.noreply.github.com> Date: Fri, 28 Apr 2023 16:16:22 +0200 Subject: [PATCH 01/11] fixed FontCache was not reloaded properly --- .../definition/v1_12_2/FontCacheFix.java | 17 ++++++++++------- .../entity/MixinClientPlayerEntity.java | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/main/java/de/florianmichael/viafabricplus/definition/v1_12_2/FontCacheFix.java b/src/main/java/de/florianmichael/viafabricplus/definition/v1_12_2/FontCacheFix.java index ed9a3a3d..71eba79f 100644 --- a/src/main/java/de/florianmichael/viafabricplus/definition/v1_12_2/FontCacheFix.java +++ b/src/main/java/de/florianmichael/viafabricplus/definition/v1_12_2/FontCacheFix.java @@ -24,6 +24,7 @@ import de.florianmichael.viafabricplus.injection.access.IFontStorage; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import de.florianmichael.viafabricplus.settings.groups.ExperimentalSettings; import de.florianmichael.vialoadingbase.ViaLoadingBase; +import de.florianmichael.vialoadingbase.model.ComparableProtocolVersion; import net.fabricmc.loader.api.FabricLoader; import net.minecraft.client.MinecraftClient; import net.minecraft.client.font.Glyph; @@ -37,20 +38,22 @@ import java.util.function.Supplier; public class FontCacheFix { public final static boolean DASH_LOADER = FabricLoader.getInstance().isModLoaded("dashloader"); + private static ComparableProtocolVersion protocolVersion; + public static void init() { if (DASH_LOADER) return; - ChangeProtocolVersionCallback.EVENT.register(protocolVersion -> MinecraftClient.getInstance().fontManager.fontStorages.values().forEach(fontStorage -> { - RenderSystem.recordRenderCall(() -> { - ((IFontStorage) fontStorage).viafabricplus_clearCaches(); - }); - })); + ChangeProtocolVersionCallback.EVENT.register(protocolVersion -> { + FontCacheFix.protocolVersion = protocolVersion; + + MinecraftClient.getInstance().fontManager.fontStorages.values().forEach(fontStorage -> RenderSystem.recordRenderCall(() -> ((IFontStorage) fontStorage).viafabricplus_clearCaches())); + }); } public static boolean shouldReplaceFontRenderer() { - if (ViaLoadingBase.getInstance() == null || DASH_LOADER) return false; + if (ViaLoadingBase.getInstance() == null || DASH_LOADER || protocolVersion == null) return false; - return ExperimentalSettings.INSTANCE.fixFontCache.getValue() && ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_12_2); + return ExperimentalSettings.INSTANCE.fixFontCache.getValue() && protocolVersion.isOlderThanOrEqualTo(ProtocolVersion.v1_12_2); } public enum BuiltinEmptyGlyph1_12_2 implements Glyph { diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinClientPlayerEntity.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinClientPlayerEntity.java index be49ec38..9b37083c 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinClientPlayerEntity.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/entity/MixinClientPlayerEntity.java @@ -113,7 +113,7 @@ public abstract class MixinClientPlayerEntity extends AbstractClientPlayerEntity this.networkHandler.sendPacket(new PlayerMoveC2SPacket.PositionAndOnGround(this.getX(), this.getY(), this.getZ(), this.onGround)); } else if (bl4) { this.networkHandler.sendPacket(new PlayerMoveC2SPacket.LookAndOnGround(this.getYaw(), this.getPitch(), this.onGround)); - } else if (this.lastOnGround != this.onGround || DebugSettings.INSTANCE.sendIdlePacket.getValue()) { + } else if ((this.lastOnGround != this.onGround && !DebugSettings.INSTANCE.sendIdlePacket.getValue()) || DebugSettings.INSTANCE.sendIdlePacket.getValue()) { this.networkHandler.sendPacket(new PlayerMoveC2SPacket.OnGroundOnly(this.onGround)); } else { SkipIdlePacketCallback.EVENT.invoker().onSkipIdlePacket(); From 4ac343c475ea4b20b1a3d36cbfa38dde7c1b010c Mon Sep 17 00:00:00 2001 From: YoMonNPC <97231277+YoMonNPC@users.noreply.github.com> Date: Sat, 29 Apr 2023 09:05:34 +0800 Subject: [PATCH 02/11] Update zh_cn.json --- .../assets/viafabricplus/lang/zh_cn.json | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/main/resources/assets/viafabricplus/lang/zh_cn.json b/src/main/resources/assets/viafabricplus/lang/zh_cn.json index 395c33e9..e33ab04a 100644 --- a/src/main/resources/assets/viafabricplus/lang/zh_cn.json +++ b/src/main/resources/assets/viafabricplus/lang/zh_cn.json @@ -13,13 +13,18 @@ "words.viafabricplus.reset": "重置", "words.viafabricplus.copy": "复制代码", - "general.viafabricplus.secret": "显示 “Super Secret Settings”(超级秘密设置)", + "general.viafabricplus.secret": "显示“Super Secret Settings”(超级秘密设置)", "general.viafabricplus.extrainformation": "在\u00a76[调试]\u00a7r(F3)中显示额外信息", "general.viafabricplus.classicloading": "在连接服务器时使用旧版进度显示", "general.viafabricplus.main": "模组按钮位置", "general.viafabricplus.creative": "从创造模式选项内移除不可用的物品", "general.viafabricplus.classiccommands": "允许使用旧版命令协议", "general.viafabricplus.protocolsync": "自动根据所选版本调整设置", + "general.viafabricplus.autodetect": "自动检测版本", + + "experimental.viafabricplus.chunkborderfix": "修复区块边界", + "experimental.viafabricplus.watermovement": "水中移动边缘检测", + "experimental.viafabricplus.fontcachefix": "修复字体缓存", "debug.viafabricplus.sequence": "禁用排序", "debug.viafabricplus.merchant": "平滑屏幕", @@ -53,19 +58,19 @@ "visual.viafabricplus.walkanimation": "旧版行走动画", "visual.viafabricplus.sodium": "修复钠(Sodium)渲染器", - "bedrocklogin.viafabricplus.text": "你的浏览器现在应该打开了。\n请输入这个代码: %s\n关闭这个屏幕等于取消操作!", - "bedrocklogin.viafabricplus.error": "发生错误!详情请查看 latest.log \n请在这个链接反馈BUG: \nhttps://github.com/FlorianMichael/ViaFabricPlus/issues", + "bedrocklogin.viafabricplus.text": "你的浏览器现在应该打开了。\n请输入这个代码:%s\n关闭这个屏幕等于取消操作!", + "bedrocklogin.viafabricplus.error": "发生错误!详情请查看 latest.log\n请在这个链接反馈BUG:\nhttps://github.com/FlorianMichael/ViaFabricPlus/issues", "forceversion.viafabricplus.title": "请选择连接这个服务器要使用的版本", "classicube.viafabricplus.account": "您可以这里创建一个账户: https://www.classicube.net/", "classicube.viafabricplus.loading": "正在加载个人信息和服务器列表···", - "classicube.viafabricplus.error.token": "Token 不正确。 你的 ViaFabricPlus 是否已经过时?", + "classicube.viafabricplus.error.token": "Token 不正确。你的 ViaFabricPlus 是否已经过时?", "classicube.viafabricplus.error.username": "无效的用户名", "classicube.viafabricplus.error.password": "无效的密码", "classicube.viafabricplus.error.verification": "用戶尚未验证电子邮箱地址。", - "classicube.viafabricplus.error.logincode": "已请求身份验证。 请查看你的电子邮箱!", + "classicube.viafabricplus.error.logincode": "已请求身份验证。请查看你的电子邮箱!", "classicube.viafabricplus.warning": "该功能会向 ClassiCube API 发送请求。", From 5c422640d503a96b7ee82347d087db9044c3c3b3 Mon Sep 17 00:00:00 2001 From: YoMonNPC <97231277+YoMonNPC@users.noreply.github.com> Date: Sat, 29 Apr 2023 09:56:37 +0800 Subject: [PATCH 03/11] Update zh_tw.json --- .../assets/viafabricplus/lang/zh_tw.json | 74 +++++++++++-------- 1 file changed, 45 insertions(+), 29 deletions(-) diff --git a/src/main/resources/assets/viafabricplus/lang/zh_tw.json b/src/main/resources/assets/viafabricplus/lang/zh_tw.json index 3cf22747..b70bed5b 100644 --- a/src/main/resources/assets/viafabricplus/lang/zh_tw.json +++ b/src/main/resources/assets/viafabricplus/lang/zh_tw.json @@ -8,56 +8,72 @@ "words.viafabricplus.rb": "右下", "words.viafabricplus.cancel": "取消", "words.viafabricplus.cancelreset": "返回並重置", + "words.viafabricplus.logout": "登出", + "words.viafabricplus.online": "線上模式", + "words.viafabricplus.reset": "重置", + "words.viafabricplus.copy": "複製程式碼", "general.viafabricplus.secret": "顯示“Super Secret Settings”(超級秘密設定)", - "general.viafabricplus.extrainformation": "在\u00a76[調試]\u00a7r(F3)中顯示額外資訊", - "general.viafabricplus.classicloading": "在連接伺服器時使用舊版加載進度顯示", + "general.viafabricplus.extrainformation": "在 \u00a76[調試]\u00a7r (F3) 中顯示額外資訊", + "general.viafabricplus.classicloading": "在連接伺服器時使用舊版進度顯示", "general.viafabricplus.main": "模組按鈕位置", - "general.viafabricplus.creative": "從創造模式選項內移除不可用的物品", - "general.viafabricplus.classiccommands": "允許使用舊版命令協定", + "general.viafabricplus.creative": "從創造模式物品欄內移除不可用的物品", + "general.viafabricplus.classiccommands": "允許使用舊版指令協議", "general.viafabricplus.protocolsync": "自動根據所選版本調整設定", + "general.viafabricplus.autodetect": "自動偵測版本", + + "experimental.viafabricplus.chunkborderfix": "修復區塊邊界", + "experimental.viafabricplus.watermovement": "水中移動邊緣偵測", + "experimental.viafabricplus.fontcachefix": "修復字體緩存", "debug.viafabricplus.sequence": "禁用排序", - "debug.viafabricplus.merchant": "平滑荧幕顯示", + "debug.viafabricplus.merchant": "平滑螢幕", "debug.viafabricplus.postfix": "同步執行輸入", - "debug.viafabricplus.sneakinstant": "瞬間潜行", - "debug.viafabricplus.inventory": "發送“打開物品欄”數据包", + "debug.viafabricplus.sneakinstant": "瞬間潛行", + "debug.viafabricplus.inventory": "發送“打開物品欄”數據包", "debug.viafabricplus.cooldown": "移除攻擊冷卻", - "debug.viafabricplus.idle": "發送“空閒”數据包", - "debug.viafabricplus.attribute": "替換内容修飾符為舊版本樣式", - "debug.viafabricplus.replacesneak": "替換潜行樣式", - "debug.viafabricplus.longsneak": "一直潜行", - "debug.viafabricplus.legacypseeds": "遠古版本挖掘速度", + "debug.viafabricplus.idle": "發送“空閒”數據包", + "debug.viafabricplus.attribute": "替換屬性修飾符為舊版本樣式", + "debug.viafabricplus.replacesneak": "替換潛行樣式", + "debug.viafabricplus.longsneak": "保持潛行", + "debug.viafabricplus.legacypseeds": "老舊版本挖掘速度", "authentication.viafabricplus.betacraft": "使用 BetaCraft 身份驗證", "authentication.viafabricplus.verify": "允許 ViaLegacy 調用 joinServer() 來驗證會話", "authentication.viafabricplus.fail": "joinServer() 調用失敗時斷開連接", - "authentication.viafabricplus.classicube": "如果使用ClassicCube MP Pass,則強制CPE版本", - "authentication.viafabricplus.bedrock": "點擊這裡以登入基岩版帳號", + "authentication.viafabricplus.classicube": "如果使用 ClassicCube MP Pass,則強制 CPE 版本", + "authentication.viafabricplus.spoof": "如果使用 ClassiCube ,則顯示為 ClassiCube 名稱", + "authentication.viafabricplus.skin": "允許 ViaLegacy 載入舊版本外觀", + "authentication.viafabricplus.bedrock": "點擊以設定基岩版帳戶", "visual.viafabricplus.secure": "禁用安全聊天警告", "visual.viafabricplus.indicator": "隱藏聊天簽名提示", - "visual.viafabricplus.jigsaw": "從方塊介面中移除新版本特性", - "visual.viafabricplus.stoneslab": "替換石化橡木臺階", - "visual.viafabricplus.armor": "類比護甲值(護甲值不顯示請打開)", - "visual.viafabricplus.command": "從命令方塊編輯介面中移除新版本特性", + "visual.viafabricplus.jigsaw": "從拼圖方塊介面中移除新版本特性", + "visual.viafabricplus.stoneslab": "替換石化橡木半磚", + "visual.viafabricplus.armor": "模擬護甲值(護甲值不顯示請打開)", + "visual.viafabricplus.command": "從指令方塊編輯介面中移除新版本特性", "visual.viafabricplus.oof": "將受傷音效替換為舊版本的“oof/噢!”", - "visual.viafabricplus.betahud": "移除新HUD要素(包括饑餓值、護甲值)", + "visual.viafabricplus.betahud": "移除新的 HUD 要素(包括饑餓值、護甲值)", "visual.viafabricplus.classic": "將創造模式物品欄替換為舊版本樣式", "visual.viafabricplus.walkanimation": "舊版行走動畫", - "visual.viafabricplus.sodium": "修復鈉(Sodium)渲染器", + "visual.viafabricplus.sodium": "修復鈉 (Sodium) 渲染器", - "bedrocklogin.viafabricplus.text": "你的瀏覽器現在應該已經打開了。\n請輸入這個程式碼: %s\n關閉這個荧幕等於取消操作。", - "bedrocklogin.viafabricplus.error": "發生錯誤! 詳情請查看 latest.log \n請在這個網站報告BUG: \nhttps://github.com/FlorianMichael/ViaFabricPlus/issues", + "bedrocklogin.viafabricplus.text": "你的瀏覽器現在應該打開了。\n請輸入這個程式碼:%s\n關閉這個螢幕等於取消操作!", + "bedrocklogin.viafabricplus.error": "發生錯誤!詳情請查看 latest.log\n請在這個連結回饋 BUG:\nhttps://github.com/FlorianMichael/ViaFabricPlus/issues", - "forceversion.viafabricplus.title": "請選擇連接這個伺服器所要使用的版本", + "forceversion.viafabricplus.title": "請選擇連接這個伺服器要使用的版本", - "classicube.viafabricplus.account": "您可以在此處創建帳戶: https://www.classicube.net/", - "classicube.viafabricplus.loading": "正在加載个人資訊和伺服器列表", + "classicube.viafabricplus.account": "您可以這裡創建一個帳戶: https://www.classicube.net", + "classicube.viafabricplus.loading": "正在載入個人資訊和伺服器清單…", - "classicube.viafabricplus.error.token": "Token不正確。 你的ViaFabricPlus已經過時了嗎?", + "classicube.viafabricplus.error.token": "Token 不正確。你的 ViaFabricPlus 是否已經過時?", "classicube.viafabricplus.error.username": "無效的用戶名", "classicube.viafabricplus.error.password": "無效的密碼", - "classicube.viafabricplus.error.verification": "用戶尚未驗證其電子郵件。", - "classicube.viafabricplus.error.logincode": "已請求身份驗證。 請檢查您的電子郵件!" -} \ No newline at end of file + "classicube.viafabricplus.error.verification": "用戶尚未驗證電子郵箱位址", + "classicube.viafabricplus.error.logincode": "已請求身份驗證。請查看你的電子郵箱!", + + "classicube.viafabricplus.warning": "該功能會向 ClassiCube API 發送請求", + + "betacraft.viafabricplus.warning": "點擊這個按鈕會向 \"betacraft.uk/serverlist\" 發送 API 請求", + "betacraft.viafabricplus.error": "出錯了! 請稍後再試!" +} From b1fadd3598cef41878e3dc427ee05268b48e7383 Mon Sep 17 00:00:00 2001 From: YoMonNPC <97231277+YoMonNPC@users.noreply.github.com> Date: Sat, 29 Apr 2023 10:07:13 +0800 Subject: [PATCH 04/11] Fix some formatting and text mistakes --- .../assets/viafabricplus/lang/zh_cn.json | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/resources/assets/viafabricplus/lang/zh_cn.json b/src/main/resources/assets/viafabricplus/lang/zh_cn.json index e33ab04a..ff7f0d2d 100644 --- a/src/main/resources/assets/viafabricplus/lang/zh_cn.json +++ b/src/main/resources/assets/viafabricplus/lang/zh_cn.json @@ -1,7 +1,7 @@ { "words.viafabricplus.settings": "设置", - "words.viafabricplus.on": "开", - "words.viafabricplus.off": "关", + "words.viafabricplus.on": "开启", + "words.viafabricplus.off": "关闭", "words.viafabricplus.lt": "左上", "words.viafabricplus.rt": "右上", "words.viafabricplus.lb": "左下", @@ -14,7 +14,7 @@ "words.viafabricplus.copy": "复制代码", "general.viafabricplus.secret": "显示“Super Secret Settings”(超级秘密设置)", - "general.viafabricplus.extrainformation": "在\u00a76[调试]\u00a7r(F3)中显示额外信息", + "general.viafabricplus.extrainformation": "在 \u00a76[调试]\u00a7r (F3) 中显示额外信息", "general.viafabricplus.classicloading": "在连接服务器时使用旧版进度显示", "general.viafabricplus.main": "模组按钮位置", "general.viafabricplus.creative": "从创造模式选项内移除不可用的物品", @@ -44,7 +44,7 @@ "authentication.viafabricplus.classicube": "如果使用 ClassicCube MP Pass,则强制 CPE 版本", "authentication.viafabricplus.spoof": "如果使用 ClassiCube ,则显示为 ClassiCube 名称", "authentication.viafabricplus.skin": "允许 ViaLegacy 加载旧版本皮肤", - "authentication.viafabricplus.bedrock": "点击以设置基岩版账号", + "authentication.viafabricplus.bedrock": "点击以设置基岩版账户", "visual.viafabricplus.secure": "禁用安全聊天警告", "visual.viafabricplus.indicator": "隐藏聊天签名提示", @@ -56,24 +56,24 @@ "visual.viafabricplus.betahud": "移除新的 HUD 要素(包括饥饿值、护甲值)", "visual.viafabricplus.classic": "将创造模式物品栏替换为旧版本样式", "visual.viafabricplus.walkanimation": "旧版行走动画", - "visual.viafabricplus.sodium": "修复钠(Sodium)渲染器", + "visual.viafabricplus.sodium": "修复钠 (Sodium) 渲染器", "bedrocklogin.viafabricplus.text": "你的浏览器现在应该打开了。\n请输入这个代码:%s\n关闭这个屏幕等于取消操作!", - "bedrocklogin.viafabricplus.error": "发生错误!详情请查看 latest.log\n请在这个链接反馈BUG:\nhttps://github.com/FlorianMichael/ViaFabricPlus/issues", + "bedrocklogin.viafabricplus.error": "发生错误!详情请查看 latest.log\n请在这个链接反馈 BUG:\nhttps://github.com/FlorianMichael/ViaFabricPlus/issues", "forceversion.viafabricplus.title": "请选择连接这个服务器要使用的版本", - "classicube.viafabricplus.account": "您可以这里创建一个账户: https://www.classicube.net/", - "classicube.viafabricplus.loading": "正在加载个人信息和服务器列表···", + "classicube.viafabricplus.account": "您可以这里创建一个账户: https://www.classicube.net", + "classicube.viafabricplus.loading": "正在加载个人信息和服务器列表…", "classicube.viafabricplus.error.token": "Token 不正确。你的 ViaFabricPlus 是否已经过时?", "classicube.viafabricplus.error.username": "无效的用户名", "classicube.viafabricplus.error.password": "无效的密码", - "classicube.viafabricplus.error.verification": "用戶尚未验证电子邮箱地址。", + "classicube.viafabricplus.error.verification": "用戶尚未验证电子邮箱地址", "classicube.viafabricplus.error.logincode": "已请求身份验证。请查看你的电子邮箱!", - "classicube.viafabricplus.warning": "该功能会向 ClassiCube API 发送请求。", + "classicube.viafabricplus.warning": "该功能会向 ClassiCube API 发送请求", - "betacraft.viafabricplus.warning": "点击这个按钮会向\"betacraft.uk/serverlist\"发送API请求。", + "betacraft.viafabricplus.warning": "点击这个按钮会向 \"betacraft.uk/serverlist\" 发送 API 请求", "betacraft.viafabricplus.error": "出错了! 请稍后再试!" } From d2c754ab0cc492a6e6b0340a0fc71bb37b509b99 Mon Sep 17 00:00:00 2001 From: FlorianMichael <60033407+FlorianMichael@users.noreply.github.com> Date: Sat, 29 Apr 2023 16:27:02 +0200 Subject: [PATCH 05/11] Added null safety --- .../injection/mixin/base/MixinConnectScreen_1.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/base/MixinConnectScreen_1.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/base/MixinConnectScreen_1.java index 0db0e215..56819ed8 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/base/MixinConnectScreen_1.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/base/MixinConnectScreen_1.java @@ -41,6 +41,8 @@ public class MixinConnectScreen_1 { @Redirect(method = "run", at = @At(value = "INVOKE", target = "Ljava/util/Optional;get()Ljava/lang/Object;")) public Object mapSocketAddress(Optional instance) { final InetSocketAddress address = instance.get(); + if (field_40415 == null) return address; + final ComparableProtocolVersion forcedVersion = ((IServerInfo) field_40415).viafabricplus_forcedVersion(); if (forcedVersion != null) { ProtocolHack.getForcedVersions().put(address, forcedVersion); From 6593180edd757711ba7d7313fb97c295c0c0d1c4 Mon Sep 17 00:00:00 2001 From: Calvineries Date: Sat, 29 Apr 2023 21:46:40 +0200 Subject: [PATCH 06/11] Create fr_fr.json --- .../assets/viafabricplus/lang/fr_fr.json | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 src/main/resources/assets/viafabricplus/lang/fr_fr.json diff --git a/src/main/resources/assets/viafabricplus/lang/fr_fr.json b/src/main/resources/assets/viafabricplus/lang/fr_fr.json new file mode 100644 index 00000000..a4740b5a --- /dev/null +++ b/src/main/resources/assets/viafabricplus/lang/fr_fr.json @@ -0,0 +1,79 @@ +{ + "words.viafabricplus.settings": "Paramètres", + "words.viafabricplus.on": "Activé", + "words.viafabricplus.off": "Désactivé", + "words.viafabricplus.lt": "Gauche; Haut", + "words.viafabricplus.rt": "Droite; Haut", + "words.viafabricplus.lb": "Gauche; Bas", + "words.viafabricplus.rb": "Droite; Bas", + "words.viafabricplus.cancel": "Annuler", + "words.viafabricplus.cancelreset": "Annuler et Réinitialiser", + "words.viafabricplus.logout": "Se déconnecter", + "words.viafabricplus.online": "Mode en ligne", + "words.viafabricplus.reset": "Réinitialiser", + "words.viafabricplus.copy": "Copier le code", + + "general.viafabricplus.secret": "Montrer les Super Secret Settings", + "general.viafabricplus.extrainformation": "Afficher des informations supplémentaires dans le Hud de debug", + "general.viafabricplus.classicloading": "Afficher la progression du chargement classique dans l'écran de connexion", + "general.viafabricplus.main": "Orientation du bouton principal", + "general.viafabricplus.creative": "Supprimer les éléments non disponibles de l'inventaire créatif", + "general.viafabricplus.classiccommands": "Autoriser l'utilisation de la commande de protocole classique", + "general.viafabricplus.protocolsync": "Modifier automatiquement les paramètres en fonction de la version utilisée", + "general.viafabricplus.autodetect": "Détecter automatiquement la version", + + "experimental.viafabricplus.chunkborderfix": "Réparer les bordures de Chunk", + "experimental.viafabricplus.watermovement": "Détection des bords du mouvement de l'eau", + "experimental.viafabricplus.fontcachefix": "Correction du cache de polices", + + "debug.viafabricplus.sequence": "Désactiver le séquençage", + "debug.viafabricplus.merchant": "Lisser les écrans des marchands", + "debug.viafabricplus.postfix": "Exécuter les entrées de manière synchronisée", + "debug.viafabricplus.sneakinstant": "Sneak instantané", + "debug.viafabricplus.inventory": "Envoyer le paquet d'inventaire ouvert", + "debug.viafabricplus.cooldown": "Supprimer les temps de recharge", + "debug.viafabricplus.idle": "Envoyer le paquet d'inactivité", + "debug.viafabricplus.attribute": "Remplacer les modificateurs d'attribut", + "debug.viafabricplus.replacesneak": "Remplacer le sneaking", + "debug.viafabricplus.longsneak": "Sneaking prolongé", + "debug.viafabricplus.legacypseeds": "Vitesses d'exploitation minière héritées", + + "authentication.viafabricplus.betacraft": "Utiliser l'authentification BetaCraft", + "authentication.viafabricplus.verify": "Autoriser ViaLegacy à appeler joinServer() pour vérifier la session", + "authentication.viafabricplus.fail": "Déconnecter si l'appel joinServer() échoue", + "authentication.viafabricplus.classicube": "Forcer la version CPE si ClassiCube est utilisé", + "authentication.viafabricplus.spoof": "Fausser le nom d'utilisateur pour le nom ClassiCube si ClassiCube est utilisé", + "authentication.viafabricplus.skin": "Permettre à ViaLegacy de charger les skins dans les versions héritées", + "authentication.viafabricplus.bedrock": "Cliquer pour définir un compte pour l'édition Bedrock", + + "visual.viafabricplus.secure": "Désactiver l'avertissement de chat sécurisé", + "visual.viafabricplus.indicator": "Masquer l'indicateur de signature", + "visual.viafabricplus.jigsaw": "Supprimer les fonctionnalités plus récentes de l'écran Jigsaw", + "visual.viafabricplus.stoneslab": "Remplacer la dalle en chêne pétrifiée", + "visual.viafabricplus.armor": "Émuler l'HUD d'armure", + "visual.viafabricplus.command": "Supprimer les fonctionnalités plus récentes de l'écran du bloc de commande", + "visual.viafabricplus.oof": "Remplacer le son de blessure par le son OOF", + "visual.viafabricplus.betahud": "Supprimer les nouveaux éléments de l'HUD", + "visual.viafabricplus.classic": "Remplacer l'inventaire créatif", + "visual.viafabricplus.walkanimation": "Ancienne animation de marche", + "visual.viafabricplus.sodium": "Corriger le rendu de chunk de Sodium", + + "bedrocklogin.viafabricplus.text": "Votre navigateur devrait s'être ouvert. Veuillez entrer le code suivant: %s. Fermer cette fenêtre annulera le processus!", + "bedrocklogin.viafabricplus.error": "Une erreur s'est produite ! Veuillez consulter latest.log pour plus d'informations. Veuillez signaler le bogue à l'adresse : \nhttps://github.com/FlorianMichael/ViaFabricPlus/issues", + + "forceversion.viafabricplus.title": "Veuillez sélectionner la version avec laquelle le serveur doit être pingé/connecté", + + "classicube.viafabricplus.account": "Vous pouvez créer un compte ici : https://www.classicube.net/", + "classicube.viafabricplus.loading": "Chargement des informations de profil et de la liste des serveurs...", + + "classicube.viafabricplus.error.token": "Jeton incorrect. ViaFabricPlus est à jour ?", + "classicube.viafabricplus.error.username": "Nom d'utilisateur invalide.", + "classicube.viafabricplus.error.password": "Mot de passe invalide.", + "classicube.viafabricplus.error.verification": "L'utilisateur n'a pas encore vérifié son adresse e-mail.", + "classicube.viafabricplus.error.logincode": "L'authentification multifacteur a été demandée. Veuillez vérifier votre courrier électronique.", + + "classicube.viafabricplus.warning": "Cette fonctionnalité enverra des requêtes API à l'API ClassiCube.", + + "betacraft.viafabricplus.warning": "Appuyer sur ce bouton enverra des requêtes API à betacraft.uk/serverlist", + "betacraft.viafabricplus.error": "Quelque chose s'est mal passé ! Veuillez réessayer plus tard." +} From 61881ecd94b4265fa12553e14efdd2acb5a507ef Mon Sep 17 00:00:00 2001 From: FlorianMichael <60033407+FlorianMichael@users.noreply.github.com> Date: Sat, 29 Apr 2023 23:00:24 +0200 Subject: [PATCH 07/11] removed temp fix --- .../netty/ViaFabricPlusVLBPipeline.java | 12 --- .../FixedUnconnectedPingEncoder.java | 60 --------------- .../FixedUnconnectedPongDecoder.java | 74 ------------------- 3 files changed, 146 deletions(-) delete mode 100644 src/main/java/de/florianmichael/viafabricplus/protocolhack/netty/viabedrock/codec/library_fix/FixedUnconnectedPingEncoder.java delete mode 100644 src/main/java/de/florianmichael/viafabricplus/protocolhack/netty/viabedrock/codec/library_fix/FixedUnconnectedPongDecoder.java diff --git a/src/main/java/de/florianmichael/viafabricplus/protocolhack/netty/ViaFabricPlusVLBPipeline.java b/src/main/java/de/florianmichael/viafabricplus/protocolhack/netty/ViaFabricPlusVLBPipeline.java index b08c98c1..d965c593 100644 --- a/src/main/java/de/florianmichael/viafabricplus/protocolhack/netty/ViaFabricPlusVLBPipeline.java +++ b/src/main/java/de/florianmichael/viafabricplus/protocolhack/netty/ViaFabricPlusVLBPipeline.java @@ -23,8 +23,6 @@ import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import de.florianmichael.viafabricplus.protocolhack.netty.viabedrock.DisconnectAdapter; import de.florianmichael.viafabricplus.protocolhack.netty.viabedrock.codec.PingEncapsulationCodec; import de.florianmichael.viafabricplus.protocolhack.netty.viabedrock.codec.RakMessageEncapsulationCodec; -import de.florianmichael.viafabricplus.protocolhack.netty.viabedrock.codec.library_fix.FixedUnconnectedPingEncoder; -import de.florianmichael.viafabricplus.protocolhack.netty.viabedrock.codec.library_fix.FixedUnconnectedPongDecoder; import de.florianmichael.vialoadingbase.model.ComparableProtocolVersion; import de.florianmichael.vialoadingbase.netty.VLBPipeline; import de.florianmichael.vialoadingbase.netty.event.CompressionReorderEvent; @@ -38,9 +36,6 @@ import net.raphimc.vialegacy.api.LegacyProtocolVersion; import net.raphimc.vialegacy.netty.PreNettyLengthPrepender; import net.raphimc.vialegacy.netty.PreNettyLengthRemover; import net.raphimc.vialegacy.protocols.release.protocol1_7_2_5to1_6_4.baseprotocols.PreNettyBaseProtocol; -import org.cloudburstmc.netty.channel.raknet.RakClientChannel; -import org.cloudburstmc.netty.handler.codec.raknet.common.UnconnectedPingEncoder; -import org.cloudburstmc.netty.handler.codec.raknet.common.UnconnectedPongDecoder; import java.net.InetSocketAddress; @@ -99,13 +94,6 @@ public class ViaFabricPlusVLBPipeline extends VLBPipeline { // Pinging in RakNet is something different if (ProtocolHack.getRakNetPingSessions().contains(address)) { - { // Temporary fix for the ping encoder - final RakClientChannel rakChannel = (RakClientChannel) ctx.channel(); - - rakChannel.parent().pipeline().replace(UnconnectedPingEncoder.NAME, UnconnectedPingEncoder.NAME, new FixedUnconnectedPingEncoder(rakChannel)); - rakChannel.parent().pipeline().replace(UnconnectedPongDecoder.NAME, UnconnectedPongDecoder.NAME, new FixedUnconnectedPongDecoder(rakChannel)); - } - pipeline.replace(VIA_BEDROCK_FRAME_ENCAPSULATION_HANDLER_NAME, VIA_BEDROCK_PING_ENCAPSULATION_HANDLER_NAME, new PingEncapsulationCodec(address)); pipeline.remove(VIA_BEDROCK_PACKET_ENCAPSULATION_HANDLER_NAME); diff --git a/src/main/java/de/florianmichael/viafabricplus/protocolhack/netty/viabedrock/codec/library_fix/FixedUnconnectedPingEncoder.java b/src/main/java/de/florianmichael/viafabricplus/protocolhack/netty/viabedrock/codec/library_fix/FixedUnconnectedPingEncoder.java deleted file mode 100644 index c64e1a8a..00000000 --- a/src/main/java/de/florianmichael/viafabricplus/protocolhack/netty/viabedrock/codec/library_fix/FixedUnconnectedPingEncoder.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * This file is part of ViaBedrock - https://github.com/RaphiMC/ViaBedrock - * Copyright (C) 2023 RK_01/RaphiMC and contributors - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package de.florianmichael.viafabricplus.protocolhack.netty.viabedrock.codec.library_fix; - -import io.netty.buffer.ByteBuf; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.ChannelOutboundHandlerAdapter; -import io.netty.channel.ChannelPromise; -import io.netty.channel.socket.DatagramPacket; -import org.cloudburstmc.netty.channel.raknet.RakClientChannel; -import org.cloudburstmc.netty.channel.raknet.RakPing; -import org.cloudburstmc.netty.channel.raknet.config.RakChannelOption; - -import static org.cloudburstmc.netty.channel.raknet.RakConstants.ID_UNCONNECTED_PING; - -// Temporary fix until the library fixes the issue -public class FixedUnconnectedPingEncoder extends ChannelOutboundHandlerAdapter { - - private final RakClientChannel rakClientChannel; - - public FixedUnconnectedPingEncoder(final RakClientChannel rakClientChannel) { - this.rakClientChannel = rakClientChannel; - } - - @Override - public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception { - if (!(msg instanceof RakPing)) { - ctx.write(msg, promise); - return; - } - - RakPing ping = (RakPing) msg; - ByteBuf magicBuf = this.rakClientChannel.config().getOption(RakChannelOption.RAK_UNCONNECTED_MAGIC); - long guid = this.rakClientChannel.config().getOption(RakChannelOption.RAK_GUID); - - ByteBuf pingBuffer = ctx.alloc().ioBuffer(magicBuf.readableBytes() + 17); - pingBuffer.writeByte(ID_UNCONNECTED_PING); - pingBuffer.writeLong(ping.getPingTime()); - pingBuffer.writeBytes(magicBuf, magicBuf.readerIndex(), magicBuf.readableBytes()); - pingBuffer.writeLong(guid); - ctx.write(new DatagramPacket(pingBuffer, ping.getSender())); - } - -} diff --git a/src/main/java/de/florianmichael/viafabricplus/protocolhack/netty/viabedrock/codec/library_fix/FixedUnconnectedPongDecoder.java b/src/main/java/de/florianmichael/viafabricplus/protocolhack/netty/viabedrock/codec/library_fix/FixedUnconnectedPongDecoder.java deleted file mode 100644 index 245486ed..00000000 --- a/src/main/java/de/florianmichael/viafabricplus/protocolhack/netty/viabedrock/codec/library_fix/FixedUnconnectedPongDecoder.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * This file is part of ViaBedrock - https://github.com/RaphiMC/ViaBedrock - * Copyright (C) 2023 RK_01/RaphiMC and contributors - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -package de.florianmichael.viafabricplus.protocolhack.netty.viabedrock.codec.library_fix; - -import io.netty.buffer.ByteBuf; -import io.netty.buffer.ByteBufUtil; -import io.netty.buffer.Unpooled; -import io.netty.channel.ChannelHandlerContext; -import io.netty.channel.socket.DatagramPacket; -import org.cloudburstmc.netty.channel.raknet.RakClientChannel; -import org.cloudburstmc.netty.channel.raknet.RakPong; -import org.cloudburstmc.netty.channel.raknet.config.RakChannelOption; -import org.cloudburstmc.netty.handler.codec.raknet.AdvancedChannelInboundHandler; - -import static org.cloudburstmc.netty.channel.raknet.RakConstants.ID_UNCONNECTED_PONG; - -// Temporary fix until the library fixes the issue -public class FixedUnconnectedPongDecoder extends AdvancedChannelInboundHandler { - - private final RakClientChannel rakClientChannel; - - public FixedUnconnectedPongDecoder(final RakClientChannel rakClientChannel) { - this.rakClientChannel = rakClientChannel; - } - - @Override - protected boolean acceptInboundMessage(ChannelHandlerContext ctx, Object msg) throws Exception { - if (!super.acceptInboundMessage(ctx, msg)) { - return false; - } - - DatagramPacket packet = (DatagramPacket) msg; - ByteBuf buf = packet.content(); - return buf.isReadable() && buf.getUnsignedByte(buf.readerIndex()) == ID_UNCONNECTED_PONG; - } - - @Override - protected void channelRead0(ChannelHandlerContext ctx, DatagramPacket packet) throws Exception { - ByteBuf buf = packet.content(); - buf.readUnsignedByte(); // Packet ID - - long pingTime = buf.readLong(); - long guid = buf.readLong(); - - ByteBuf magicBuf = this.rakClientChannel.config().getOption(RakChannelOption.RAK_UNCONNECTED_MAGIC); - if (!buf.isReadable(magicBuf.readableBytes()) || !ByteBufUtil.equals(buf.readSlice(magicBuf.readableBytes()), magicBuf)) { - // Magic does not match - return; - } - - ByteBuf pongData = Unpooled.EMPTY_BUFFER; - if (buf.isReadable(2)) { // Length - pongData = buf.readRetainedSlice(buf.readUnsignedShort()); - } - ctx.fireChannelRead(new RakPong(pingTime, guid, pongData, packet.sender())); - } - -} From a8c9ec9654d1fde9d132f668f9a75b552146bfb3 Mon Sep 17 00:00:00 2001 From: FlorianMichael <60033407+FlorianMichael@users.noreply.github.com> Date: Sun, 30 Apr 2023 01:34:12 +0200 Subject: [PATCH 08/11] updated VB --- .../injection/mixin/fixes/viabedrock/MixinJoinPackets.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/viabedrock/MixinJoinPackets.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/viabedrock/MixinJoinPackets.java index a6aeb9f3..27fc7008 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/viabedrock/MixinJoinPackets.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/viabedrock/MixinJoinPackets.java @@ -38,14 +38,14 @@ public class MixinJoinPackets { return seed; } - @Redirect(method = "lambda$register$2", at = @At(value = "INVOKE", target = "Lcom/viaversion/viaversion/api/protocol/packet/PacketWrapper;read(Lcom/viaversion/viaversion/api/type/Type;)Ljava/lang/Object;", ordinal = 54)) + @Redirect(method = "lambda$register$2", at = @At(value = "INVOKE", target = "Lcom/viaversion/viaversion/api/protocol/packet/PacketWrapper;read(Lcom/viaversion/viaversion/api/type/Type;)Ljava/lang/Object;", ordinal = 56)) private static Object trackLevelId(PacketWrapper instance, Type tType) throws Exception { final Object levelId = instance.read(tType); instance.user().get(JoinGameStorage.class).setLevelId((String) levelId); return levelId; } - @Redirect(method = "lambda$register$2", at = @At(value = "INVOKE", target = "Lcom/viaversion/viaversion/api/protocol/packet/PacketWrapper;read(Lcom/viaversion/viaversion/api/type/Type;)Ljava/lang/Object;", ordinal = 62)) + @Redirect(method = "lambda$register$2", at = @At(value = "INVOKE", target = "Lcom/viaversion/viaversion/api/protocol/packet/PacketWrapper;read(Lcom/viaversion/viaversion/api/type/Type;)Ljava/lang/Object;", ordinal = 64)) private static Object trackEnchantmentSeed(PacketWrapper instance, Type tType) throws Exception { final Object enchantmentSeed = instance.read(tType); instance.user().get(JoinGameStorage.class).setEnchantmentSeed((Integer) enchantmentSeed); From bfb28f78354d0a9e305d2464b55784bc44b431ae Mon Sep 17 00:00:00 2001 From: FlorianMichael <60033407+FlorianMichael@users.noreply.github.com> Date: Sun, 30 Apr 2023 20:14:13 +0200 Subject: [PATCH 09/11] fixed NPE --- .../minecraft/MixinClientPlayNetworkHandler.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinClientPlayNetworkHandler.java b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinClientPlayNetworkHandler.java index daa2375e..bf3e6d75 100644 --- a/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinClientPlayNetworkHandler.java +++ b/src/main/java/de/florianmichael/viafabricplus/injection/mixin/fixes/minecraft/MixinClientPlayNetworkHandler.java @@ -19,6 +19,7 @@ package de.florianmichael.viafabricplus.injection.mixin.fixes.minecraft; import com.mojang.authlib.GameProfile; import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; +import de.florianmichael.viafabricplus.ViaFabricPlus; import de.florianmichael.viafabricplus.settings.groups.VisualSettings; import de.florianmichael.viafabricplus.protocolhack.ProtocolHack; import net.minecraft.client.MinecraftClient; @@ -29,14 +30,12 @@ import net.minecraft.client.network.ClientPlayerEntity; import net.minecraft.client.network.PlayerListEntry; import net.minecraft.client.network.ServerInfo; import net.minecraft.client.util.telemetry.WorldSession; -import net.minecraft.entity.EntityType; import net.minecraft.entity.vehicle.BoatEntity; import net.minecraft.network.ClientConnection; import net.minecraft.network.listener.ServerPlayPacketListener; import net.minecraft.network.packet.Packet; import net.minecraft.network.packet.s2c.play.*; import net.minecraft.screen.ScreenHandler; -import net.minecraft.util.math.Vec3d; import org.slf4j.Logger; import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; @@ -153,4 +152,12 @@ public abstract class MixinClientPlayNetworkHandler { public boolean removeSecureChatWarning(ServerMetadataS2CPacket instance) { return instance.isSecureChatEnforced() || VisualSettings.INSTANCE.disableSecureChatWarning.getValue(); } + + @Inject(method = "onSetTradeOffers", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/NetworkThreadUtils;forceMainThread(Lnet/minecraft/network/packet/Packet;Lnet/minecraft/network/listener/PacketListener;Lnet/minecraft/util/thread/ThreadExecutor;)V", shift = At.Shift.AFTER), cancellable = true) + public void checkLoginPacket(SetTradeOffersS2CPacket packet, CallbackInfo ci) { + if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(ProtocolVersion.v1_13_2) && this.client.player == null) { + ViaFabricPlus.LOGGER.error("Server tried to send Play packet in Login process, dropping \"SetTradeOffers\""); + ci.cancel(); + } + } } From ecddd21132c419d96847affbd6ce965c058eb9a8 Mon Sep 17 00:00:00 2001 From: FlorianMichael <60033407+FlorianMichael@users.noreply.github.com> Date: Sun, 30 Apr 2023 21:34:54 +0200 Subject: [PATCH 10/11] Removed ClassicProtocolCommands, Implemented ViaVersion commands --- .github/USAGE.md | 6 ++ README.md | 12 --- gradle.properties | 2 +- .../viafabricplus/ViaFabricPlus.java | 2 - .../command/ClassicProtocolCommands.java | 40 ---------- ...Command.java => ClassicViaSubCommand.java} | 20 ++--- .../c0_30/command/impl/HelpCommand.java | 45 ------------ .../command/impl/ListExtensionsCommand.java | 18 ++--- .../c0_30/command/impl/SetTimeCommand.java | 22 ++++-- .../protocolhack/ProtocolHack.java | 55 +++++++++++++- .../ViaFabricPlusVLBViaCommandHandler.java | 73 +++++++++++++++++++ .../ViaFabricPlusViaCommandSender.java | 53 ++++++++++++++ ...abricPlusClassicCustomCommandProvider.java | 54 -------------- 13 files changed, 215 insertions(+), 187 deletions(-) delete mode 100644 src/main/java/de/florianmichael/viafabricplus/definition/c0_30/command/ClassicProtocolCommands.java rename src/main/java/de/florianmichael/viafabricplus/definition/c0_30/command/{ICommand.java => ClassicViaSubCommand.java} (77%) delete mode 100644 src/main/java/de/florianmichael/viafabricplus/definition/c0_30/command/impl/HelpCommand.java create mode 100644 src/main/java/de/florianmichael/viafabricplus/protocolhack/command/ViaFabricPlusVLBViaCommandHandler.java create mode 100644 src/main/java/de/florianmichael/viafabricplus/protocolhack/command/ViaFabricPlusViaCommandSender.java delete mode 100644 src/main/java/de/florianmichael/viafabricplus/protocolhack/provider/vialegacy/ViaFabricPlusClassicCustomCommandProvider.java diff --git a/.github/USAGE.md b/.github/USAGE.md index 037829cb..3c64d18f 100644 --- a/.github/USAGE.md +++ b/.github/USAGE.md @@ -13,6 +13,12 @@ ViaFabricPlus will use the version set there, the versions are stored in the ser If you don't want to specify a specific version anymore, you can simply press the button and select **"Cancel and reset"**. +## Commands +You can use the ViaVersion commands with **/viafabricplus** or **/viaversion**, and a few classic only commands are also implemented: +- **/viafabricplus settime