From bcc6904c83987fe96a1edf8c84c36042470ef3bc Mon Sep 17 00:00:00 2001 From: Hendrix-Shen Date: Tue, 17 Oct 2023 13:06:44 +0800 Subject: [PATCH] Switch `mainProject` to 1.20.2 Signed-off-by: Hendrix-Shen --- README.md | 4 +--- README_ZH_CN.md | 4 +--- .../impl/MagicLanguageResourceManager.java | 8 ++++---- .../mixin/language/MixinLanguageManager.java | 16 ++++++++-------- versions/mainProject | 2 +- 5 files changed, 15 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 09be40cc..70751764 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,6 @@ English | [中文](./README_ZH_CN.md) ❗Before reporting a problem, be sure to try the latest [beta version](https://github.com/Hendrix-Shen/MagicLib/releases) to check if the problem still exists. -♻️Note: Minecraft 1.20 requires the use of a third-party port [Malilib](https://github.com/Nyan-Work/malilib/releases/tag/snapshot-1.20.2). - ## Description A library of versatile mod dependencies. @@ -58,7 +56,7 @@ We have added a complete dependency checking system to verify dependency availab ### Support -Current main development for Minecraft version: 1.20.1 +Current main development for Minecraft version: 1.20.2 And use `preprocess` to be compatible with all versions. diff --git a/README_ZH_CN.md b/README_ZH_CN.md index e5d19149..6bdf689e 100644 --- a/README_ZH_CN.md +++ b/README_ZH_CN.md @@ -19,8 +19,6 @@ ❗在报告问题前,请务必尝试最新[测试版](https://github.com/Hendrix-Shen/MagicLib/releases),检查问题是否依然存在。 -♻注意: Minecraft 1.20 需要使用第三方的 [Malilib](https://github.com/Nyan-Work/malilib/releases/tag/snapshot-1.20.2)。 - ## 描述 一个多功能的模组依赖库。 @@ -58,7 +56,7 @@ ### 支持 -当前主开发版本:1.20.1 +当前主开发版本:1.20.2 并且使用 `预处理` 来兼容各版本。 diff --git a/src/main/java/top/hendrixshen/magiclib/language/impl/MagicLanguageResourceManager.java b/src/main/java/top/hendrixshen/magiclib/language/impl/MagicLanguageResourceManager.java index 49765ae0..308ab760 100644 --- a/src/main/java/top/hendrixshen/magiclib/language/impl/MagicLanguageResourceManager.java +++ b/src/main/java/top/hendrixshen/magiclib/language/impl/MagicLanguageResourceManager.java @@ -62,9 +62,9 @@ public MagicLanguageResourceManager() { ResourceLocation resourceLocation = new ResourceLocation(namespace, languagePath); Resource resource = new MagicLanguageResource( //#if MC > 12001 - //$$ new FilePackResources.FileResourcesSupplier(new File(resourceUrl.getPath()), true).openPrimary(namespace), + new FilePackResources.FileResourcesSupplier(new File(resourceUrl.getPath()), true).openPrimary(namespace), //#elseif MC > 11902 - new FilePackResources(namespace, new File(resourceUrl.getPath()), true), + //$$ new FilePackResources(namespace, new File(resourceUrl.getPath()), true), //#else //$$ namespace, //#endif @@ -106,9 +106,9 @@ public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { Resource resource = new MagicLanguageResource( //#if MC > 12001 - //$$ new FilePackResources.FileResourcesSupplier(file, true).openPrimary(namespace), + new FilePackResources.FileResourcesSupplier(file, true).openPrimary(namespace), //#elseif MC > 11902 - new FilePackResources(namespace, file.toFile(), true), + //$$ new FilePackResources(namespace, file.toFile(), true), //#else //$$ namespace, //#endif diff --git a/src/main/java/top/hendrixshen/magiclib/mixin/language/MixinLanguageManager.java b/src/main/java/top/hendrixshen/magiclib/mixin/language/MixinLanguageManager.java index 5d743a33..25dbb52b 100644 --- a/src/main/java/top/hendrixshen/magiclib/mixin/language/MixinLanguageManager.java +++ b/src/main/java/top/hendrixshen/magiclib/mixin/language/MixinLanguageManager.java @@ -23,7 +23,7 @@ import java.util.Map; //#if MC > 11201 -//$$ import org.spongepowered.asm.mixin.Unique; +import org.spongepowered.asm.mixin.Unique; //#endif @Environment(EnvType.CLIENT) @@ -37,13 +37,13 @@ public class MixinLanguageManager { private Map languages; //#if MC > 12001 - //$$ @Unique - //$$ private static final String magiclib$DEFAULT_LANGUAGE = "en_us"; + @Unique + private static final String magiclib$DEFAULT_LANGUAGE = "en_us"; //#else - @Shadow - @Final + //$$ @Shadow + //$$ @Final //#if MC > 11903 - public static String DEFAULT_LANGUAGE_CODE; + //$$ public static String DEFAULT_LANGUAGE_CODE; //#else //$$ private static LanguageInfo DEFAULT_LANGUAGE; //#endif @@ -126,9 +126,9 @@ private void postSetSelected( if (languageInfoList.isEmpty()) { languageInfoList.add( //#if MC > 12001 - //$$ magiclib$DEFAULT_LANGUAGE + magiclib$DEFAULT_LANGUAGE //#elseif MC > 11903 - DEFAULT_LANGUAGE_CODE + //$$ DEFAULT_LANGUAGE_CODE //#else //$$ DEFAULT_LANGUAGE //#endif diff --git a/versions/mainProject b/versions/mainProject index 1acb46a4..341e509f 100644 --- a/versions/mainProject +++ b/versions/mainProject @@ -1 +1 @@ -1.20.1 \ No newline at end of file +1.20.2 \ No newline at end of file