From 250602289318eba6e2beefad7cde5ae2aeb93192 Mon Sep 17 00:00:00 2001 From: Des Herriott Date: Fri, 10 May 2024 12:25:07 +0100 Subject: [PATCH 1/6] chore: ported to 1.20.6 --- .github/workflows/build.yml | 3 ++- .github/workflows/release.yml | 3 ++- build.gradle | 4 ++-- common/build.gradle | 2 +- gradle.properties | 16 ++++++++-------- gradle/wrapper/gradle-wrapper.properties | 2 +- neoforge/build.gradle | 2 +- .../mods/ftbranks/neoforge/FTBRanksNeoForge.java | 4 ---- .../META-INF/{mods.toml => neoforge.mods.toml} | 1 + settings.gradle | 6 +++--- 10 files changed, 21 insertions(+), 22 deletions(-) rename neoforge/src/main/resources/META-INF/{mods.toml => neoforge.mods.toml} (96%) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5d4d795..2cb0001 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,6 +18,7 @@ jobs: with: curse-publish-task: "" maven-snapshots: true + java-version: 21 secrets: ftb-maven-token: ${{ secrets.FTB_MAVEN_TOKEN }} - saps-token: ${{ secrets.SAPS_TOKEN }} \ No newline at end of file + saps-token: ${{ secrets.SAPS_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7f875fc..715eb75 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,8 @@ jobs: uses: FTBTeam/mods-meta/.github/workflows/standard-release.yml@main with: curse-publish-task: curseforge + java-version: 21 secrets: ftb-maven-token: ${{ secrets.FTB_MAVEN_TOKEN }} saps-token: ${{ secrets.SAPS_TOKEN }} - curse-token: ${{ secrets.CURSEFORGE_KEY }} \ No newline at end of file + curse-token: ${{ secrets.CURSEFORGE_KEY }} diff --git a/build.gradle b/build.gradle index ba64bb7..227d892 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.5-SNAPSHOT" apply false + id "dev.architectury.loom" version "1.6-SNAPSHOT" apply false } architectury { @@ -33,7 +33,7 @@ allprojects { // needs to be done AFTER version is set apply from: "https://raw.githubusercontent.com/FTBTeam/mods-meta/main/gradle/publishing.gradle" - sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = 17 + sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = 21 compileJava { options.encoding = "UTF-8" diff --git a/common/build.gradle b/common/build.gradle index 3c1591c..14feeaf 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -9,7 +9,7 @@ dependencies { def ENV = System.getenv() architectury { - common("forge", "fabric", "neoforge") + common(/* "forge", */ "fabric", "neoforge") } publishing { diff --git a/gradle.properties b/gradle.properties index 299e9be..09f986b 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,20 +3,20 @@ org.gradle.daemon=false mod_id=ftbranks archives_base_name=ftb-ranks maven_group=dev.ftb.mods -mod_version=2004.2.0 +mod_version=2006.1.0 mod_author=FTB Team -minecraft_version=1.20.4 +minecraft_version=1.20.6 # Deps -forge_version=49.0.31 -neoforge_version=20.4.196 +forge_version=50.0.9 +neoforge_version=20.6.49-beta neoforge_loader_version=1 -fabric_loader_version=0.15.7 -fabric_api_version=0.96.4+1.20.4 -architectury_version=11.1.17 +fabric_loader_version=0.15.10 +fabric_api_version=0.97.8+1.20.6 +architectury_version=12.0.28 -ftb_library_version=2004.2.0 +ftb_library_version=2006.1.0-SNAPSHOT curseforge_id_forge=314905 curseforge_id_fabric=472659 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 0284600..7b17ca0 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip diff --git a/neoforge/build.gradle b/neoforge/build.gradle index 815c43f..e467d94 100644 --- a/neoforge/build.gradle +++ b/neoforge/build.gradle @@ -47,7 +47,7 @@ processResources { inputs.property "version", project.version - filesMatching("META-INF/mods.toml") { + filesMatching("META-INF/neoforge.mods.toml") { expand "version": project.version, "archversion": project.architectury_version, "neoforgeversion": project.neoforge_version, diff --git a/neoforge/src/main/java/dev/ftb/mods/ftbranks/neoforge/FTBRanksNeoForge.java b/neoforge/src/main/java/dev/ftb/mods/ftbranks/neoforge/FTBRanksNeoForge.java index f95e104..f2019c6 100644 --- a/neoforge/src/main/java/dev/ftb/mods/ftbranks/neoforge/FTBRanksNeoForge.java +++ b/neoforge/src/main/java/dev/ftb/mods/ftbranks/neoforge/FTBRanksNeoForge.java @@ -5,8 +5,6 @@ import dev.ftb.mods.ftbranks.impl.decorate.MessageDecorator; import net.minecraft.network.chat.MutableComponent; import net.minecraft.server.level.ServerPlayer; -import net.neoforged.fml.IExtensionPoint.DisplayTest; -import net.neoforged.fml.ModLoadingContext; import net.neoforged.fml.common.Mod; import net.neoforged.neoforge.common.NeoForge; import net.neoforged.neoforge.event.ServerChatEvent; @@ -22,8 +20,6 @@ public FTBRanksNeoForge() { // Nope. // PermissionAPI.setPermissionHandler(new PermissionAPIWrapper(PermissionAPI.getPermissionHandler())); - - ModLoadingContext.get().registerExtensionPoint(DisplayTest.class, () -> new DisplayTest(() -> DisplayTest.IGNORESERVERONLY, (a, b) -> true)); } private void playerNameFormatting(PlayerEvent.NameFormat event) { diff --git a/neoforge/src/main/resources/META-INF/mods.toml b/neoforge/src/main/resources/META-INF/neoforge.mods.toml similarity index 96% rename from neoforge/src/main/resources/META-INF/mods.toml rename to neoforge/src/main/resources/META-INF/neoforge.mods.toml index 8e7bcf7..c2ed6d0 100644 --- a/neoforge/src/main/resources/META-INF/mods.toml +++ b/neoforge/src/main/resources/META-INF/neoforge.mods.toml @@ -11,6 +11,7 @@ authors = "FTB Team" description = ''' A simple mod that lets you create ranks for players, similar to Discord roles, and manage permissions for them ''' +displayTest="IGNORE_SERVER_VERSION" [[mixins]] config = "ftbranks-common.mixins.json" diff --git a/settings.gradle b/settings.gradle index 43b5748..b7a9231 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,14 +1,14 @@ pluginManagement { repositories { + maven { url "https://maven.architectury.dev/" } maven { url "https://maven.creeperhost.net/" } - maven { url "https://maven.shedaniel.me/" } gradlePluginPortal() } } include("common") include("fabric") -include("forge") +//include("forge") include("neoforge") -rootProject.name = 'FTB-Ranks-1.20.4' +rootProject.name = 'FTB-Ranks-1.20.6' From 17eeceef5da126ded3c349748f4b7ab16cceda72 Mon Sep 17 00:00:00 2001 From: Des Herriott Date: Fri, 10 May 2024 12:43:25 +0100 Subject: [PATCH 2/6] feat: /ftbranks list_all_ranks output now clickable Clicking a rank name runs '/ftbranks show_rank ' Also added hover text showing the rank condition, if any --- .../ftb/mods/ftbranks/FTBRanksCommands.java | 21 +++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/common/src/main/java/dev/ftb/mods/ftbranks/FTBRanksCommands.java b/common/src/main/java/dev/ftb/mods/ftbranks/FTBRanksCommands.java index 06e7a36..921bfab 100644 --- a/common/src/main/java/dev/ftb/mods/ftbranks/FTBRanksCommands.java +++ b/common/src/main/java/dev/ftb/mods/ftbranks/FTBRanksCommands.java @@ -24,7 +24,11 @@ import net.minecraft.commands.arguments.EntityArgument; import net.minecraft.commands.arguments.GameProfileArgument; import net.minecraft.nbt.StringTag; +import net.minecraft.network.chat.ClickEvent; +import net.minecraft.network.chat.ClickEvent.Action; import net.minecraft.network.chat.Component; +import net.minecraft.network.chat.HoverEvent; +import net.minecraft.network.chat.Style; import net.minecraft.server.level.ServerPlayer; import java.io.IOException; @@ -176,11 +180,24 @@ private static int refreshReadme(CommandSourceStack source) { return 1; } + private static Component makeRankNameClicky(Rank rank) { + boolean isDef = rank.getCondition().isDefaultCondition(); + return Component.literal(rank.getName()) + .withStyle(isDef ? ChatFormatting.AQUA : ChatFormatting.YELLOW) + .withStyle(Style.EMPTY + .withClickEvent(new ClickEvent(Action.RUN_COMMAND, "/ftbranks show_rank " + rank.getId())) + .withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, isDef ? + Component.literal("Players must be explicitly added to this rank\nwith '/ftbranks add '").withStyle(ChatFormatting.GRAY, ChatFormatting.ITALIC) : + Component.literal("Rank condition: " + rank.getCondition().asString()).withStyle(ChatFormatting.GRAY, ChatFormatting.ITALIC)) + ) + ); + } + private static int listAllRanks(CommandSourceStack source) { source.sendSuccess(() -> Component.literal("Ranks:"), false); for (Rank rank : FTBRanksAPIImpl.manager.getAllRanks()) { - source.sendSuccess(() -> Component.literal("- " + rank.getName()).withStyle(rank.getCondition().isDefaultCondition() ? ChatFormatting.AQUA : ChatFormatting.YELLOW), false); + source.sendSuccess(() -> Component.literal("- ").append(makeRankNameClicky(rank)), false); } return 1; @@ -234,7 +251,7 @@ private static int listRanksOf(CommandSourceStack source, ServerPlayer player) { for (Rank rank : FTBRanksAPIImpl.manager.getAllRanks()) { if (rank.isActive(player)) { - source.sendSuccess(() -> Component.literal("- " + rank.getName()).withStyle(rank.getCondition().isDefaultCondition() ? ChatFormatting.AQUA : ChatFormatting.YELLOW), false); + source.sendSuccess(() -> Component.literal("- ").append(makeRankNameClicky(rank)), false); } } From fed5ad1c558a194ab524743e765cad27409ca223 Mon Sep 17 00:00:00 2001 From: Des Herriott Date: Fri, 10 May 2024 15:20:50 +0100 Subject: [PATCH 3/6] feat: /ftbranks list_all_ranks output now clickable Clicking a rank name runs '/ftbranks show_rank ' Also added hover text showing the rank condition, if any --- .../src/main/java/dev/ftb/mods/ftbranks/FTBRanksCommands.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/src/main/java/dev/ftb/mods/ftbranks/FTBRanksCommands.java b/common/src/main/java/dev/ftb/mods/ftbranks/FTBRanksCommands.java index 921bfab..ae48fc8 100644 --- a/common/src/main/java/dev/ftb/mods/ftbranks/FTBRanksCommands.java +++ b/common/src/main/java/dev/ftb/mods/ftbranks/FTBRanksCommands.java @@ -187,7 +187,7 @@ private static Component makeRankNameClicky(Rank rank) { .withStyle(Style.EMPTY .withClickEvent(new ClickEvent(Action.RUN_COMMAND, "/ftbranks show_rank " + rank.getId())) .withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, isDef ? - Component.literal("Players must be explicitly added to this rank\nwith '/ftbranks add '").withStyle(ChatFormatting.GRAY, ChatFormatting.ITALIC) : + Component.literal("Players must be explicitly added to this rank\nwith '/ftbranks add " + rank.getId() + "'").withStyle(ChatFormatting.GRAY, ChatFormatting.ITALIC) : Component.literal("Rank condition: " + rank.getCondition().asString()).withStyle(ChatFormatting.GRAY, ChatFormatting.ITALIC)) ) ); From 19700bc14d15969f258015fb48a094487e4289d4 Mon Sep 17 00:00:00 2001 From: Des Herriott Date: Fri, 10 May 2024 15:21:15 +0100 Subject: [PATCH 4/6] fix: neoforge build.gradle error (how did that ever work..?) --- neoforge/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/neoforge/build.gradle b/neoforge/build.gradle index e467d94..ea72f61 100644 --- a/neoforge/build.gradle +++ b/neoforge/build.gradle @@ -37,7 +37,7 @@ dependencies { modApi("dev.ftb.mods:ftb-library-neoforge:${rootProject.ftb_library_version}") { transitive false } common(project(path: ":common", configuration: "namedElements")) { transitive false } - shadowCommon(project(path: ":common", configuration: "transformProductionForge")) { transitive false } + shadowCommon(project(path: ":common", configuration: "transformProductionNeoForge")) { transitive false } } apply from: "https://raw.githubusercontent.com/FTBTeam/mods-meta/main/gradle/extra-local-mods.gradle" From f2640f6c4e83cd83814927bc5f755ff27a03dc79 Mon Sep 17 00:00:00 2001 From: Des Herriott Date: Tue, 4 Jun 2024 12:23:20 +0100 Subject: [PATCH 5/6] build: bump neoforge/arch/ftb-library versions --- gradle.properties | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gradle.properties b/gradle.properties index 09f986b..57bce32 100644 --- a/gradle.properties +++ b/gradle.properties @@ -10,13 +10,13 @@ minecraft_version=1.20.6 # Deps forge_version=50.0.9 -neoforge_version=20.6.49-beta +neoforge_version=20.6.100-beta neoforge_loader_version=1 fabric_loader_version=0.15.10 fabric_api_version=0.97.8+1.20.6 -architectury_version=12.0.28 +architectury_version=12.1.3 -ftb_library_version=2006.1.0-SNAPSHOT +ftb_library_version=2006.1.1 curseforge_id_forge=314905 curseforge_id_fabric=472659 From d44bd37c476973161b64d2ddc0157f6ccb535861 Mon Sep 17 00:00:00 2001 From: Des Herriott Date: Tue, 4 Jun 2024 12:23:49 +0100 Subject: [PATCH 6/6] chore: changelog updated --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d065d91..b7eb146 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ 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). +[2006.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 + [2004.2.0] ### Changed