From f1509cc5f9761c63c8b0bcb20389b8d31f5d4248 Mon Sep 17 00:00:00 2001 From: NotRyken <127091011+NotRyken@users.noreply.github.com> Date: Tue, 26 Nov 2024 13:41:12 +0800 Subject: [PATCH] Update to mc1.21.3 --- common/build.gradle | 17 ++++++++ .../terminalmc/clientsort/config/Config.java | 4 +- .../gui/screen/ClothScreenProvider.java | 10 ++--- .../inventory/ContainerScreenHelper.java | 3 +- .../inventory/sort/InventorySorter.java | 2 +- .../mixin/MixinClientPacketListener.java | 6 +-- .../assets/clientsort/lang/en_us.json | 4 +- .../assets/clientsort/lang/ru_ru.json | 4 +- .../assets/clientsort/lang/uk_ua.json | 4 +- .../assets/clientsort/lang/zh_cn.json | 4 +- .../assets/clientsort/lang/zh_tw.json | 4 +- gradle.properties | 40 ++++++++++--------- gradle/wrapper/gradle-wrapper.properties | 2 +- 13 files changed, 61 insertions(+), 43 deletions(-) diff --git a/common/build.gradle b/common/build.gradle index 6000f04..e54af12 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/clientsort/config/Config.java b/common/src/main/java/dev/terminalmc/clientsort/config/Config.java index 7690ada..902a713 100644 --- a/common/src/main/java/dev/terminalmc/clientsort/config/Config.java +++ b/common/src/main/java/dev/terminalmc/clientsort/config/Config.java @@ -81,8 +81,8 @@ public String lowerName() { } } - public static final boolean defaultLmbBundle = false; - public boolean lmbBundle = defaultLmbBundle; + public static final boolean defaultRmbBundle = false; + public boolean rmbBundle = defaultRmbBundle; // Sorting public static final String defaultSortMode = SortMode.CREATIVE.name; diff --git a/common/src/main/java/dev/terminalmc/clientsort/gui/screen/ClothScreenProvider.java b/common/src/main/java/dev/terminalmc/clientsort/gui/screen/ClothScreenProvider.java index 8e1f268..e8ef7f6 100644 --- a/common/src/main/java/dev/terminalmc/clientsort/gui/screen/ClothScreenProvider.java +++ b/common/src/main/java/dev/terminalmc/clientsort/gui/screen/ClothScreenProvider.java @@ -100,12 +100,12 @@ else if (val > 100) return Optional.of( .setSaveConsumer(val -> options.extraSlotMode = val) .build()); - general.addEntry(eb.startBooleanToggle(localized("option", "lmbBundle"), - options.lmbBundle) - .setTooltip(localized("option", "lmbBundle.tooltip")) - .setDefaultValue(Config.Options.defaultLmbBundle) + general.addEntry(eb.startBooleanToggle(localized("option", "rmbBundle"), + options.rmbBundle) + .setTooltip(localized("option", "rmbBundle.tooltip")) + .setDefaultValue(Config.Options.defaultRmbBundle) .setSaveConsumer(val -> { - options.lmbBundle = val; + options.rmbBundle = val; if (val) CreativeSearchOrder.tryRefreshItemSearchPositionLookup(); }) .build()); diff --git a/common/src/main/java/dev/terminalmc/clientsort/inventory/ContainerScreenHelper.java b/common/src/main/java/dev/terminalmc/clientsort/inventory/ContainerScreenHelper.java index 0326b31..ade9751 100644 --- a/common/src/main/java/dev/terminalmc/clientsort/inventory/ContainerScreenHelper.java +++ b/common/src/main/java/dev/terminalmc/clientsort/inventory/ContainerScreenHelper.java @@ -23,7 +23,6 @@ import dev.terminalmc.clientsort.util.inject.ISlot; import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen; import net.minecraft.client.gui.screens.inventory.CreativeModeInventoryScreen; -import net.minecraft.client.gui.screens.inventory.EffectRenderingInventoryScreen; import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.inventory.ClickType; import net.minecraft.world.inventory.Slot; @@ -63,7 +62,7 @@ public int getScope(Slot slot, boolean preferSmallerScopes) { if (slot.container == null || ((ISlot) slot).mouseWheelie_getIndexInInv() >= slot.container.getContainerSize() || !slot.mayPlace(ItemStack.EMPTY)) { return INVALID_SCOPE; } - if (screen instanceof EffectRenderingInventoryScreen) { + if (screen instanceof AbstractContainerScreen) { if (slot.container instanceof Inventory) { Config.Options options = Config.get().options; if (isHotbarSlot(slot)) { diff --git a/common/src/main/java/dev/terminalmc/clientsort/inventory/sort/InventorySorter.java b/common/src/main/java/dev/terminalmc/clientsort/inventory/sort/InventorySorter.java index 1b41a48..93c64bf 100644 --- a/common/src/main/java/dev/terminalmc/clientsort/inventory/sort/InventorySorter.java +++ b/common/src/main/java/dev/terminalmc/clientsort/inventory/sort/InventorySorter.java @@ -206,7 +206,7 @@ protected void sortOnClient(int[] sortedIds) { // swap the current stack with the target stack if ( - Config.get().options.lmbBundle + !Config.get().options.rmbBundle && ( (backingStacks[id] instanceof BundleItem && !(carriedItem instanceof AirItem)) || (carriedItem instanceof BundleItem && !(backingStacks[id] instanceof AirItem)) diff --git a/common/src/main/java/dev/terminalmc/clientsort/mixin/MixinClientPacketListener.java b/common/src/main/java/dev/terminalmc/clientsort/mixin/MixinClientPacketListener.java index 6285ef0..9f44db0 100644 --- a/common/src/main/java/dev/terminalmc/clientsort/mixin/MixinClientPacketListener.java +++ b/common/src/main/java/dev/terminalmc/clientsort/mixin/MixinClientPacketListener.java @@ -26,7 +26,7 @@ import net.minecraft.network.Connection; import net.minecraft.network.protocol.game.ClientboundContainerSetSlotPacket; import net.minecraft.network.protocol.game.ClientboundLoginPacket; -import net.minecraft.network.protocol.game.ClientboundSetCarriedItemPacket; +import net.minecraft.network.protocol.game.ClientboundSetCursorItemPacket; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; @@ -43,8 +43,8 @@ private void onLogin(ClientboundLoginPacket packet, CallbackInfo ci) { ClientSort.searchOrderUpdated = false; } - @Inject(method = "handleSetCarriedItem", at = @At("HEAD")) - public void onHeldItemChangeBegin(ClientboundSetCarriedItemPacket packet, CallbackInfo ci) { + @Inject(method = "handleSetCursorItem", at = @At("HEAD")) + public void onHeldItemChangeBegin(ClientboundSetCursorItemPacket packet, CallbackInfo ci) { InteractionManager.triggerSend(InteractionManager.TriggerType.HELD_ITEM_CHANGE); } diff --git a/common/src/main/resources/assets/clientsort/lang/en_us.json b/common/src/main/resources/assets/clientsort/lang/en_us.json index 278cdf7..baaf2f5 100644 --- a/common/src/main/resources/assets/clientsort/lang/en_us.json +++ b/common/src/main/resources/assets/clientsort/lang/en_us.json @@ -13,8 +13,8 @@ "option.clientsort.interactionRate.tooltip": "Reduce to sort faster, increase if you are experiencing packet rate issues", "option.clientsort.hotbarMode": "Hotbar Mode", "option.clientsort.extraSlotMode": "Extra Slot Mode", - "option.clientsort.lmbBundle": "Bundles use Left Click", - "option.clientsort.lmbBundle.tooltip": "In 1.21.2+, bundles use left-click to load, which breaks sorting. If playing on a 1.21.2+ server, enable this option.", + "option.clientsort.rmbBundle": "Bundles use Right Click", + "option.clientsort.rmbBundle.tooltip": "Before 1.21.2, bundles used right-click to load, which breaks sorting. If playing on a 1.21.1 or earlier server, enable this option.", "option.clientsort.sorting": "Sorting", "option.clientsort.sortMode": "Sort Mode", diff --git a/common/src/main/resources/assets/clientsort/lang/ru_ru.json b/common/src/main/resources/assets/clientsort/lang/ru_ru.json index 7bfe7fa..c37e7fe 100644 --- a/common/src/main/resources/assets/clientsort/lang/ru_ru.json +++ b/common/src/main/resources/assets/clientsort/lang/ru_ru.json @@ -13,8 +13,8 @@ "option.clientsort.interactionRate.tooltip": "Уменьшите, чтобы ускорить сортировку, увеличьте, если у вас возникли проблемы со скоростью передачи пакетов", "option.clientsort.hotbarMode": "Режим горячей панели", "option.clientsort.extraSlotMode": "Extra Slot Mode", - "option.clientsort.lmbBundle": "Bundles use Right Click", - "option.clientsort.lmbBundle.tooltip": "In 1.21.2+, bundles use right-click to load and unload, which breaks sorting. If playing on a 1.21.2+ server, enable this option.", + "option.clientsort.rmbBundle": "Bundles use Right Click", + "option.clientsort.rmbBundle.tooltip": "In 1.21.2+, bundles use right-click to load and unload, which breaks sorting. If playing on a 1.21.2+ server, enable this option.", "option.clientsort.sorting": "Сортировка", "option.clientsort.sortMode": "Режим сортировки", diff --git a/common/src/main/resources/assets/clientsort/lang/uk_ua.json b/common/src/main/resources/assets/clientsort/lang/uk_ua.json index 7dabcf7..25ed231 100644 --- a/common/src/main/resources/assets/clientsort/lang/uk_ua.json +++ b/common/src/main/resources/assets/clientsort/lang/uk_ua.json @@ -13,8 +13,8 @@ "option.clientsort.interactionRate.tooltip": "Зменшіть для швидшого сортування, збільшіть якщо виникають проблеми з частотою пакетів", "option.clientsort.hotbarMode": "Режим панелі швидкого доступу", "option.clientsort.extraSlotMode": "Extra Slot Mode", - "option.clientsort.lmbBundle": "Bundles use Left Click", - "option.clientsort.lmbBundle.tooltip": "In 1.21.2+, bundles use left-click to load, which breaks sorting. If playing on a 1.21.2+ server, enable this option.", + "option.clientsort.rmbBundle": "Bundles use Right Click", + "option.clientsort.rmbBundle.tooltip": "Before 1.21.2, bundles used right-click to load, which breaks sorting. If playing on a 1.21.1 or earlier server, enable this option.", "option.clientsort.sorting": "Сортування", "option.clientsort.sortMode": "Режим сортування", diff --git a/common/src/main/resources/assets/clientsort/lang/zh_cn.json b/common/src/main/resources/assets/clientsort/lang/zh_cn.json index 97305c6..faa062d 100644 --- a/common/src/main/resources/assets/clientsort/lang/zh_cn.json +++ b/common/src/main/resources/assets/clientsort/lang/zh_cn.json @@ -13,8 +13,8 @@ "option.clientsort.interactionRate.tooltip": "降低值可更快整理, 若遇到发包速率问题, 请将该值增加", "option.clientsort.hotbarMode": "快捷栏模式", "option.clientsort.extraSlotMode": "Extra Slot Mode", - "option.clientsort.lmbBundle": "Bundles use Right Click", - "option.clientsort.lmbBundle.tooltip": "In 1.21.2+, bundles use right-click to load and unload, which breaks sorting. If playing on a 1.21.2+ server, enable this option.", + "option.clientsort.rmbBundle": "Bundles use Right Click", + "option.clientsort.rmbBundle.tooltip": "In 1.21.2+, bundles use right-click to load and unload, which breaks sorting. If playing on a 1.21.2+ server, enable this option.", "option.clientsort.sorting": "整理", "option.clientsort.sortMode": "整理模式", diff --git a/common/src/main/resources/assets/clientsort/lang/zh_tw.json b/common/src/main/resources/assets/clientsort/lang/zh_tw.json index 4a0aaf4..12380e4 100644 --- a/common/src/main/resources/assets/clientsort/lang/zh_tw.json +++ b/common/src/main/resources/assets/clientsort/lang/zh_tw.json @@ -13,8 +13,8 @@ "option.clientsort.interactionRate.tooltip": "降低以更快排序,如果遇到封包速率問題則提高", "option.clientsort.hotbarMode": "快捷欄模式", "option.clientsort.extraSlotMode": "Extra Slot Mode", - "option.clientsort.lmbBundle": "Bundles use Right Click", - "option.clientsort.lmbBundle.tooltip": "In 1.21.2+, bundles use right-click to load and unload, which breaks sorting. If playing on a 1.21.2+ server, enable this option.", + "option.clientsort.rmbBundle": "Bundles use Right Click", + "option.clientsort.rmbBundle.tooltip": "In 1.21.2+, bundles use right-click to load and unload, which breaks sorting. If playing on a 1.21.2+ server, enable this option.", "option.clientsort.sorting": "排序", "option.clientsort.sortMode": "排序模式", diff --git a/gradle.properties b/gradle.properties index 6dbb1c1..2bec597 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,7 +2,7 @@ # Neo/Forge version ranges: https://maven.apache.org/enforcer/enforcer-rules/versionRanges.html # Project -mod_version=1.1.1+1.21 +mod_version=1.1.1+1.21.3 mod_group=dev.terminalmc mod_id=clientsort mod_name=ClientSort @@ -24,38 +24,38 @@ 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 -parchment_version=2024.07.28 +parchment_version=2024.11.10 # Fabric https://fabricmc.net/develop -fabric_loader_version=0.16.5 +fabric_loader_version=0.16.9 fabric_loader_versions=>=0.15.0 -fabric_api_version=0.102.0+1.21 +fabric_api_version=0.108.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.33-beta +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_version=16.0.141 clothconfig_versions_fabric=>=15 clothconfig_versions_neoforge=[15,) # ModMenu https://modrinth.com/mod/mOgUt4GM/versions -modmenu_version=11.0.2 -modmenu_versions_fabric=>10 +modmenu_version=12.0.0-beta.1 +modmenu_versions_fabric=>11 # https://modrinth.com/mod/tJzrFuyy/versions -itemlocks_version=1.21-1.3.9 +itemlocks_version=1.21.2-1.3.9 # GitHub, Modrinth, CurseForge releases # Plural properties expect CSV lists @@ -67,12 +67,12 @@ curseforge_id=1049891 release_type=release # 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 release_required_dep_ids_fabric_cf=fabric-api,modmenu,cloth-config # 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 release_required_dep_ids_neoforge_cf=cloth-config @@ -80,12 +80,14 @@ release_required_dep_ids_neoforge_cf=cloth-config 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 -loom_version=1.7.4 +loom_version=1.8.12 # ModDev https://plugins.gradle.org/plugin/net.neoforged.moddev -moddev_version=1.0.19 +moddev_version=2.0.44-beta # Minotaur https://plugins.gradle.org/plugin/com.modrinth.minotaur minotaur_version=2.8.7 # CurseForgeGradle https://plugins.gradle.org/plugin/net.darkhax.curseforgegradle @@ -93,7 +95,7 @@ curseforgegradle_version=1.1.25 # github-release https://plugins.gradle.org/plugin/com.github.breadmoirai.github-release githubrelease_version=2.5.2 # grgit-service https://github.com/ajoberstar/grgit/releases -grgitservice_version=5.2.2 +grgitservice_version=5.3.0 # licenser https://plugins.gradle.org/plugin/org.cadixdev.licenser licenser_version=0.6.1 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a441313..94113f2 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.8-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME