From 950d87d1ac8306e8daa8f74a0c88ccf75b3fc27c Mon Sep 17 00:00:00 2001 From: NotRyken <127091011+NotRyken@users.noreply.github.com> Date: Sat, 7 Dec 2024 14:13:46 +0800 Subject: [PATCH] Update to mc1.21.3 --- common/build.gradle | 17 ++++++++++ .../framework/command/Commands.java | 2 +- .../gui/screen/YaclScreenProvider.java | 11 +++--- gradle.properties | 34 ++++++++++--------- 4 files changed, 41 insertions(+), 23 deletions(-) diff --git a/common/build.gradle b/common/build.gradle index 206ba45..8e1f0b8 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -3,7 +3,24 @@ plugins { id("net.neoforged.moddev") } +// Vanilla depends on ASM 9.3, MDG makes that a 'strict' version constraint, +// but Mixin and MixinExtras needs newer ASM so we override that here. +configurations.configureEach { + resolutionStrategy.eachDependency { details -> + if (details.requested.group == "org.ow2.asm") { + details.useVersion(asm_version) + details.because("Mixin requires new ASM") + } + } +} + dependencies { + compileOnly "org.ow2.asm:asm:${asm_version}" + compileOnly "org.ow2.asm:asm-analysis:${asm_version}" + compileOnly "org.ow2.asm:asm-commons:${asm_version}" + compileOnly "org.ow2.asm:asm-tree:${asm_version}" + compileOnly "org.ow2.asm:asm-util:${asm_version}" + compileOnly("org.spongepowered:mixin:${mixin_version}") compileOnly(annotationProcessor("io.github.llamalad7:mixinextras-common:${mixinextras_version}")) diff --git a/common/src/main/java/dev/terminalmc/framework/command/Commands.java b/common/src/main/java/dev/terminalmc/framework/command/Commands.java index b8d03e8..3d9a238 100644 --- a/common/src/main/java/dev/terminalmc/framework/command/Commands.java +++ b/common/src/main/java/dev/terminalmc/framework/command/Commands.java @@ -58,7 +58,7 @@ public void register(CommandDispatcher dispatcher, CommandBuildContext buildC Item item = ItemArgument.getItem(ctx, "item").getItem(); MutableComponent msg = Framework.PREFIX.copy(); - msg.append(item.getDescription()); + msg.append(item.getName()); mc.gui.getChat().addMessage(msg); return Command.SINGLE_SUCCESS; diff --git a/common/src/main/java/dev/terminalmc/framework/gui/screen/YaclScreenProvider.java b/common/src/main/java/dev/terminalmc/framework/gui/screen/YaclScreenProvider.java index 7637737..9a67761 100644 --- a/common/src/main/java/dev/terminalmc/framework/gui/screen/YaclScreenProvider.java +++ b/common/src/main/java/dev/terminalmc/framework/gui/screen/YaclScreenProvider.java @@ -17,16 +17,18 @@ import dev.terminalmc.framework.Framework; import dev.terminalmc.framework.config.Config; import net.minecraft.ChatFormatting; -import net.minecraft.ResourceLocationException; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.screens.Screen; +import net.minecraft.core.Holder; import net.minecraft.core.registries.BuiltInRegistries; import net.minecraft.network.chat.Component; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Item; +import net.minecraft.world.item.Items; import java.awt.Color; import java.util.List; +import java.util.Optional; import static dev.terminalmc.framework.util.Localization.localized; @@ -389,11 +391,8 @@ static Screen getConfigScreen(Screen parent) { // Special option utils private static Item asItem(String s) { - try { - return BuiltInRegistries.ITEM.get(ResourceLocation.parse(s)); - } catch (ResourceLocationException e) { - return BuiltInRegistries.ITEM.get(BuiltInRegistries.ITEM.getDefaultKey()); - } + Optional> item = BuiltInRegistries.ITEM.get(ResourceLocation.parse(s)); + return item.map(Holder.Reference::value).orElse(Items.AIR); } private static String asString(Item i) { diff --git a/gradle.properties b/gradle.properties index 70d72b8..93f0c4f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ # Neo/Forge version ranges: https://maven.apache.org/enforcer/enforcer-rules/versionRanges.html # Project -mod_version=1.0.4+1.21 +mod_version=1.0.4+1.21.3 mod_group=dev.terminalmc mod_id=framework mod_name=Framework @@ -25,9 +25,9 @@ java_versions_fabric=>=21 java_versions_neoforge=[21,) # Minecraft -minecraft_version=1.21 -minecraft_versions_fabric=>1.20.6 <1.22 -minecraft_versions_neoforge=(1.20.6, 1.22) +minecraft_version=1.21.3 +minecraft_versions_fabric=>1.21.1 <1.22 +minecraft_versions_neoforge=(1.21.1, 1.22) # Parchment https://parchmentmc.org/docs/getting-started#choose-a-version parchment_minecraft_version=1.21 @@ -36,29 +36,29 @@ parchment_version=2024.11.10 # Fabric https://fabricmc.net/develop fabric_loader_version=0.16.9 fabric_loader_versions=>=0.15.0 -fabric_api_version=0.102.0+1.21 +fabric_api_version=0.110.0+1.21.3 fabric_api_versions=* # NeoForge https://projects.neoforged.net/neoforged/neoforge neoforge_loader_versions=[1,) -neoforge_version=21.0.167 -neoforge_versions=[21.0.143, 22) +neoforge_version=21.3.57 +neoforge_versions=[21.2.0, 22) # NeoForm https://projects.neoforged.net/neoforged/neoform -neoform_version=1.21-20240613.152323 +neoform_version=1.21.3-20241023.131943 # Cloth Config https://modrinth.com/mod/9s6osm5g/versions -clothconfig_version=15.0.140 -clothconfig_versions_fabric=>=15 -clothconfig_versions_neoforge=[15,) +clothconfig_version=16.0.141 +clothconfig_versions_fabric=>=16 +clothconfig_versions_neoforge=[16,) # YACL https://modrinth.com/mod/1eAoo2KR/versions -yacl_version=3.6.2+1.21 +yacl_version=3.6.2+1.21.2 yacl_versions_fabric=>=3.5.0 yacl_versions_neoforge=[3.5.0,) # ModMenu https://modrinth.com/mod/mOgUt4GM/versions -modmenu_version=11.0.3 -modmenu_versions_fabric=>=11.0.0-beta.1 +modmenu_version=12.0.0 +modmenu_versions_fabric=>=12.0.0-beta.1 # GitHub, Modrinth, CurseForge releases # Plural properties expect CSV lists @@ -70,12 +70,12 @@ curseforge_slug=tmc-framework release_type=STABLE # Fabric release_mod_loaders_fabric=fabric -release_game_versions_fabric=1.21,1.21.1 +release_game_versions_fabric=1.21.2,1.21.3 release_required_dep_ids_fabric_mr=P7dR8mSH,mOgUt4GM,9s6osm5g,1eAoo2KR release_required_dep_ids_fabric_cf=fabric-api,modmenu,cloth-config,yacl # NeoForge release_mod_loaders_neoforge=neoforge -release_game_versions_neoforge=1.21,1.21.1 +release_game_versions_neoforge=1.21.2,1.21.3 release_required_dep_ids_neoforge_mr=9s6osm5g,1eAoo2KR release_required_dep_ids_neoforge_cf=cloth-config,yacl @@ -83,6 +83,8 @@ release_required_dep_ids_neoforge_cf=cloth-config,yacl mixin_version=0.8.7 # MixinExtras https://github.com/LlamaLad7/MixinExtras/releases mixinextras_version=0.4.1 +# ASM https://mvnrepository.com/artifact/org.ow2.asm/asm +asm_version=9.7 # Plugins # Fabric Loom https://mvnrepository.com/artifact/net.fabricmc/fabric-loom