diff --git a/CHANGELOG.md b/CHANGELOG.md index ddbde5a..9e5fa99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,25 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2101.1.0] + +### Changed +* Minecraft 1.21.1 is now required; this no longer supports Minecraft 1.21 + +### Added +* Sidebar buttons for this and other FTB mods can now be enabled/disabled/rearranged (new functionality in FTB Library 2101.1.0) + +## [2100.1.1] + +### Fixed +* Fixed `/enderchest` command opening the Ender Chest GUI on target player's screen instead of executing player + +## [2100.1.0] + +### Changed +* Ported to Minecraft 1.20.6. Support for Fabric and NeoForge. + * Forge support may be re-added if/when Architectury adds support for Forge + ## [2006.1.0] ### Changed diff --git a/build.gradle b/build.gradle index c0cf6ec..c7c50f1 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ plugins { id "architectury-plugin" version "3.4-SNAPSHOT" - id "dev.architectury.loom" version "1.6-SNAPSHOT" apply false + id "dev.architectury.loom" version "1.7-SNAPSHOT" apply false id "me.modmuss50.mod-publish-plugin" version "0.5.1" } @@ -109,7 +109,7 @@ publishMods { // TODO: Migrate to something else def tag = providers.environmentVariable("TAG").getOrElse("release") - type = tag == "beta" ? BETA : (tag == "alpha" ? ALPHA : STABLE) + type = tag.endsWith("-beta") ? BETA : (tag.endsWith("-alpha") ? ALPHA : STABLE) def createOptions = (String projectName) -> { publishOptions { diff --git a/common/src/main/java/dev/ftb/mods/ftbessentials/commands/groups/CheatCommands.java b/common/src/main/java/dev/ftb/mods/ftbessentials/commands/groups/CheatCommands.java index 90f0441..b8c7c65 100644 --- a/common/src/main/java/dev/ftb/mods/ftbessentials/commands/groups/CheatCommands.java +++ b/common/src/main/java/dev/ftb/mods/ftbessentials/commands/groups/CheatCommands.java @@ -1,5 +1,7 @@ package dev.ftb.mods.ftbessentials.commands.groups; +import com.mojang.brigadier.context.CommandContext; +import com.mojang.brigadier.exceptions.CommandSyntaxException; import dev.ftb.mods.ftbessentials.FTBEssentialsPlatform; import dev.ftb.mods.ftbessentials.commands.FTBCommand; import dev.ftb.mods.ftbessentials.commands.SimpleCommandPlayer; @@ -7,11 +9,13 @@ import dev.ftb.mods.ftbessentials.commands.impl.cheat.VirtualInventoryCommand; import dev.ftb.mods.ftbessentials.config.FTBEConfig; import dev.ftb.mods.ftbessentials.util.FTBEPlayerData; +import net.minecraft.commands.CommandSourceStack; import net.minecraft.commands.Commands; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.SimpleMenuProvider; +import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.ChestMenu; import java.util.List; @@ -40,16 +44,18 @@ public class CheatCommands { new VirtualInventoryCommand(), // Enderchest - new SimpleCommandPlayer("enderchest", Commands.LEVEL_GAMEMASTERS, FTBEConfig.ENDER_CHEST, (ctx, player) -> enderChest(player)) + new SimpleCommandPlayer("enderchest", Commands.LEVEL_GAMEMASTERS, FTBEConfig.ENDER_CHEST, CheatCommands::enderChest) ); - private static void enderChest(ServerPlayer player) { + private static void enderChest(CommandContext ctx, ServerPlayer player) { MutableComponent title = Component.translatable("container.enderchest"); - if (player != null) { + ServerPlayer srcPlayer = ctx.getSource().getPlayer(); + if (player != null && srcPlayer != null) { title.append(" × ").append(player.getDisplayName()); + srcPlayer.openMenu(new SimpleMenuProvider((i, inv, p) -> ChestMenu.threeRows(i, inv, player.getEnderChestInventory()), title)); + } else { + ctx.getSource().sendFailure(Component.literal("Unable to open enderchest inventory!")); } - - player.openMenu(new SimpleMenuProvider((i, inv, p) -> ChestMenu.threeRows(i, inv, player.getEnderChestInventory()), title)); } public static void heal(ServerPlayer player) { diff --git a/common/src/main/resources/assets/ftbessentials/sidebar_buttons.json b/common/src/main/resources/assets/ftbessentials/sidebar_buttons.json deleted file mode 100644 index 919d63e..0000000 --- a/common/src/main/resources/assets/ftbessentials/sidebar_buttons.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "trash_can": { - "group": "ftblibrary:util", - "icon": "ftblibrary:icons/bin", - "x": 150, - "click": "command:/trashcan", - "required_server_mods": [ - "ftbessentials" - ] - } -} \ No newline at end of file diff --git a/common/src/main/resources/assets/ftbessentials/sidebar_buttons/trash_can.json b/common/src/main/resources/assets/ftbessentials/sidebar_buttons/trash_can.json new file mode 100644 index 0000000..179101f --- /dev/null +++ b/common/src/main/resources/assets/ftbessentials/sidebar_buttons/trash_can.json @@ -0,0 +1,10 @@ +{ + "icon": "ftblibrary:icons/bin", + "sort_index": 1000, + "click": [ + "command:/trashcan" + ], + "required_server_mods": [ + "ftbessentials" + ] +} \ No newline at end of file diff --git a/fabric/build.gradle b/fabric/build.gradle index 1a1897f..8dd2d8b 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -41,7 +41,7 @@ processResources { filesMatching("fabric.mod.json") { expand "version": project.version, "archversion": project.architectury_api_version, - "fabricapiversion": project.fabric_api_version, + "fabricapiversionrange": project.fabric_api_version_range, "mcversion": project.minecraft_version, "ftblibraryversion": project.ftb_library_version } diff --git a/fabric/src/main/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json index aaf1d13..f016fd1 100644 --- a/fabric/src/main/resources/fabric.mod.json +++ b/fabric/src/main/resources/fabric.mod.json @@ -22,7 +22,7 @@ "ftbessentials-common.mixins.json" ], "depends": { - "fabric": "*", + "fabric": "${fabricapiversionrange}", "minecraft": ">=${mcversion}", "architectury": ">=${archversion}", "ftblibrary": ">=${ftblibraryversion}" diff --git a/gradle.properties b/gradle.properties index 4cd509e..648ce31 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,23 +8,24 @@ readable_name=FTB Essentials archives_base_name=ftb-essentials maven_group=dev.ftb.mods -minecraft_version=1.21 -mod_version=2100.1.0 +minecraft_version=1.21.1 +mod_version=2101.1.0 mod_author=FTB Team # Deps #forge_version=50.0.9 -neoforge_version=21.0.8-beta -# https://maven.neoforged.net/#/releases/net/neoforged/fancymodloader/loader +neoforge_version=21.1.9 +neoforge_version_range=[21.1.0,) neoforge_loader_version=4 fabric_loader_version=0.15.11 -fabric_api_version=0.100.1+1.21 +fabric_api_version=0.100.8+1.21 +fabric_api_version_range=>=0.100.1+1.21 -architectury_api_version=13.0.1 +architectury_api_version=13.0.6 -ftb_library_version=2100.1.0-SNAPSHOT -ftb_ranks_version=2100.1.0-SNAPSHOT +ftb_library_version=2101.1.0 +ftb_ranks_version=2100.1.0 # common curseforge project for forge and fabric curseforge_id=410811 diff --git a/neoforge/build.gradle b/neoforge/build.gradle index 7d18935..0e2aa5e 100644 --- a/neoforge/build.gradle +++ b/neoforge/build.gradle @@ -52,7 +52,7 @@ processResources { filesMatching("META-INF/neoforge.mods.toml") { expand "version": project.version, - "neoforgeversion": project.neoforge_version, + "neoforgeversionrange": project.neoforge_version_range, "neoforgeloaderversion": project.neoforge_loader_version, "mcversion": project.minecraft_version, "libraryversion": project.ftb_library_version, diff --git a/neoforge/src/main/resources/META-INF/neoforge.mods.toml b/neoforge/src/main/resources/META-INF/neoforge.mods.toml index 7101d48..e5f47ba 100644 --- a/neoforge/src/main/resources/META-INF/neoforge.mods.toml +++ b/neoforge/src/main/resources/META-INF/neoforge.mods.toml @@ -19,7 +19,7 @@ displayTest="IGNORE_SERVER_VERSION" [[dependencies.ftbessentials]] modId = "neoforge" type = "required" -versionRange = "[${neoforgeversion},)" +versionRange = "${neoforgeversionrange}" ordering = "NONE" side = "BOTH"