diff --git a/buildSrc/src/main/groovy/multiloader-common.gradle b/buildSrc/src/main/groovy/multiloader-common.gradle index d069647..3b0299e 100644 --- a/buildSrc/src/main/groovy/multiloader-common.gradle +++ b/buildSrc/src/main/groovy/multiloader-common.gradle @@ -103,7 +103,6 @@ processResources { "mod_authors_string": mod_authors.replace(",", ", "), "mod_contributors_string": mod_contributors.replace(",", ", "), "mod_license": mod_license, - "mod_environment": mod_environment, // Links "homepage_url": homepage_url, "sources_url": sources_url, diff --git a/common/build.gradle b/common/build.gradle index 2f5f9c5..05c6c66 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -3,6 +3,16 @@ plugins { id("net.neoforged.moddev") } +// Workaround for NeoForge transitive deps conflict +configurations.all { + resolutionStrategy { + force "org.ow2.asm:asm:9.7" + force "org.ow2.asm:asm-commons:9.7" + force "org.ow2.asm:asm-tree:9.7" + force "org.ow2.asm:asm-util:9.7" + } +} + dependencies { compileOnly("org.spongepowered:mixin:${mixin_version}") compileOnly("io.github.llamalad7:mixinextras-common:${mixinextras_version}") 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 9f7b1c5..30b4c92 100644 --- a/common/src/main/java/dev/terminalmc/clientsort/inventory/ContainerScreenHelper.java +++ b/common/src/main/java/dev/terminalmc/clientsort/inventory/ContainerScreenHelper.java @@ -24,7 +24,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; @@ -64,7 +63,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) { if (isHotbarSlot(slot)) { Config.Options options = Config.get().options; 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 78603d4..cfe94f7 100644 --- a/common/src/main/java/dev/terminalmc/clientsort/mixin/MixinClientPacketListener.java +++ b/common/src/main/java/dev/terminalmc/clientsort/mixin/MixinClientPacketListener.java @@ -27,7 +27,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; @@ -44,8 +44,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/java/dev/terminalmc/clientsort/screen/ConfigScreenProvider.java b/common/src/main/java/dev/terminalmc/clientsort/screen/ConfigScreenProvider.java index 4e77f74..21f979a 100644 --- a/common/src/main/java/dev/terminalmc/clientsort/screen/ConfigScreenProvider.java +++ b/common/src/main/java/dev/terminalmc/clientsort/screen/ConfigScreenProvider.java @@ -6,12 +6,10 @@ package dev.terminalmc.clientsort.screen; import net.minecraft.Util; -import net.minecraft.client.Minecraft; import net.minecraft.client.gui.components.Button; import net.minecraft.client.gui.components.MultiLineTextWidget; import net.minecraft.client.gui.screens.ConfirmLinkScreen; import net.minecraft.client.gui.screens.Screen; -import net.minecraft.client.gui.screens.options.OptionsSubScreen; import net.minecraft.network.chat.CommonComponents; import static dev.terminalmc.clientsort.util.mod.Localization.localized; @@ -28,20 +26,27 @@ public static Screen getConfigScreen(Screen parent) { return ClothConfigScreenProvider.getConfigScreen(parent); } catch (NoClassDefFoundError ignored) { - return new BackupScreen(parent); + return new BackupScreen(parent, "install_cloth", "https://modrinth.com/mod/9s6osm5g"); } } - static class BackupScreen extends OptionsSubScreen { - public BackupScreen(Screen parent) { - super(parent, Minecraft.getInstance().options, localized("screen", "default")); + static class BackupScreen extends Screen { + private final Screen parent; + private final String modKey; + private final String modUrl; + + public BackupScreen(Screen parent, String modKey, String modUrl) { + super(localized("name")); + this.parent = parent; + this.modKey = modKey; + this.modUrl = modUrl; } @Override public void init() { MultiLineTextWidget messageWidget = new MultiLineTextWidget( width / 2 - 120, height / 2 - 40, - localized("message", "install_cloth"), + localized("message", modKey), minecraft.font); messageWidget.setMaxWidth(240); messageWidget.setCentered(true); @@ -50,9 +55,9 @@ public void init() { Button openLinkButton = Button.builder(localized("message", "go_modrinth"), (button) -> minecraft.setScreen(new ConfirmLinkScreen( (open) -> { - if (open) Util.getPlatform().openUri("https://modrinth.com/mod/9s6osm5g"); - minecraft.setScreen(lastScreen); - }, "https://modrinth.com/mod/9s6osm5g", true))) + if (open) Util.getPlatform().openUri(modUrl); + minecraft.setScreen(parent); + }, modUrl, true))) .pos(width / 2 - 120, height / 2) .size(115, 20) .build(); @@ -65,8 +70,5 @@ public void init() { .build(); addRenderableWidget(exitButton); } - - @Override - protected void addOptions() {} } } diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index dbfebde..0d1569a 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -9,7 +9,7 @@ "contributors": [$mod_contributors_list], "license": "${mod_license}", - "environment": "${mod_environment}", + "environment": "client", "provides": [], diff --git a/gradle.properties b/gradle.properties index 59a193b..8f3ffe6 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.0.0 +mod_version=21.2.0-beta.01 mod_group=dev.terminalmc mod_id=clientsort mod_name=ClientSort @@ -18,44 +18,41 @@ sources_url=https://github.com/TerminalMC/ClientSort issues_url=https://github.com/TerminalMC/ClientSort/issues contact_url=https://terminalmc.dev -# Environment -mod_environment=client - # Java java_version=21 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.2 +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 # Fabric https://fabricmc.net/develop/ -fabric_loader_version=0.16.5 +fabric_loader_version=0.16.7 fabric_loader_versions=>=0.15.0 -fabric_api_version=0.102.0+1.21 +fabric_api_version=0.106.1+1.21.2 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.2.0-beta +neoforge_versions=[21.2.0-beta, 22) # NeoForm https://projects.neoforged.net/neoforged/neoform -neoform_version=1.21-20240613.152323 +neoform_version=1.21.2-20241022.151510 # 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,) # ModMenu https://modrinth.com/mod/mOgUt4GM/versions -modmenu_version=11.0.2 -modmenu_versions=>10 +modmenu_version=12.0.0-beta.1 +modmenu_versions=>11 # GitHub, Modrinth, CurseForge releases # Plural properties expect CSV lists @@ -67,12 +64,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 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 release_required_dep_ids_neoforge_mr=9s6osm5g release_required_dep_ids_neoforge_cf=cloth-config @@ -83,9 +80,9 @@ mixinextras_version=0.4.1 # Plugins # Fabric Loom https://mvnrepository.com/artifact/net.fabricmc/fabric-loom -loom_version=1.7.4 +loom_version=1.8.6 # ModDev https://plugins.gradle.org/plugin/net.neoforged.moddev -moddev_version=1.0.19 +moddev_version=1.0.21 # Minotaur https://plugins.gradle.org/plugin/com.modrinth.minotaur minotaur_version=2.8.7 # CurseForgeGradle https://plugins.gradle.org/plugin/net.darkhax.curseforgegradle @@ -93,9 +90,8 @@ 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 # Gradle org.gradle.jvmargs=-Xmx4G org.gradle.daemon=false - diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a441313..df97d72 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.10.2-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME