From 9e814d06336956956889214d64c5f239e841f361 Mon Sep 17 00:00:00 2001 From: Des Herriott Date: Thu, 20 Feb 2025 17:04:06 +0000 Subject: [PATCH 1/4] fix: fixed up changelog markdown [ciskip] --- CHANGELOG.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35460de..80a7bd1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,63 +4,63 @@ 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). -[2100.1.2] +## [2100.1.2] ### Changed * API change for RankManager#createRank * Added new RankManager#createRank(String, int, boolean) method, deprecated the existing RankManager#createRank(String, String, int) method * Note: minor API break here: both methods now throw a RankException if the rank already exists, rather than blindly overwrite it -[2100.1.1] +## [2100.1.1] ### Changed * Now loads a supplementary `config/ftbranks-pack.snbt` file alongside the default file * Intended to augment existing ranks from `ranks.snbt` with pack-specific settings, to be created by modpack makers, independent of the server admin settings. -[2100.1.0] +## [2100.1.0] ### Changed * Ported to Minecraft 1.21. Support for Fabric and NeoForge. * Forge support may be re-added if/when Architectury adds support for Forge -## 2006.1.0 +## [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 +## [2004.2.0] ### Changed * Ported to MC 1.20.4: Forge, NeoForge and Fabric all supported -## 1902.1.16 +## [1902.1.16] ### Fixed * Correctly report errors and stop when a syntax error in ranks.snbt or players.snbt prevents the file from loading * Don't tell the player it loaded OK then wipe the current runtime config... -## 1902.1.15 +## [1902.1.15] ### Added * Added `/ftbranks node list ` command to view the permissions nodes that are added to a given rank * Some backend code improvements for Fabric, related to player display name processing * Now using a custom Fabric event in FTB Library for better inter-mod compatibility with upcoming Fabric version of FTB Essentials -## 1902.1.14 +## [1902.1.14] ### Fixed * Backed out dynamic tab-completion functionality and use simple server-side suggestions instead * FTB Ranks is a server-only mod again and no longer needs to be installed on the client since that's unnecessarily disruptive -## 1902.1.13 +## [1902.1.13] ### Fixed * Made rank-based chat text colouring (using `ftbranks.chat_text.*` nodes in `ranks.snbt`) work correctly on Forge and Fabric * FTB Ranks is no longer incorrectly marked as a server-only mod * As of the previous release, it is also required on the client (to support Tab-completion for ranks in commands) -## 1902.1.12 +## [1902.1.12] ### Added * Events are now fired for other mods to consume when various things happen: From a3a68f4b7027d5feb20d967f8adf242f9dcbc0fc Mon Sep 17 00:00:00 2001 From: Des Herriott Date: Wed, 9 Apr 2025 11:32:29 +0100 Subject: [PATCH 2/4] feat: added new "rank_applies" condition Similar to "rank_added", but doesn't require the rank to be explicitly added to the player, just that it currently applies --- .../mods/ftbranks/impl/FTBRanksAPIImpl.java | 1 + .../impl/condition/DimensionCondition.java | 3 --- .../impl/condition/RankAddedCondition.java | 6 ++--- .../impl/condition/RankAppliesCondition.java | 23 +++++++++++++++++++ 4 files changed, 27 insertions(+), 6 deletions(-) create mode 100644 common/src/main/java/dev/ftb/mods/ftbranks/impl/condition/RankAppliesCondition.java diff --git a/common/src/main/java/dev/ftb/mods/ftbranks/impl/FTBRanksAPIImpl.java b/common/src/main/java/dev/ftb/mods/ftbranks/impl/FTBRanksAPIImpl.java index 8ef5c23..6e39e68 100644 --- a/common/src/main/java/dev/ftb/mods/ftbranks/impl/FTBRanksAPIImpl.java +++ b/common/src/main/java/dev/ftb/mods/ftbranks/impl/FTBRanksAPIImpl.java @@ -64,6 +64,7 @@ public static void worldSaved(ServerLevel event) { public static void registerConditions(RegisterConditionsEvent event) { event.register("always_active", (rank, json) -> AlwaysActiveCondition.INSTANCE); event.register("rank_added", RankAddedCondition::new); + event.register("rank_applies", RankAppliesCondition::new); event.register("not", NotCondition::new); event.register("or", OrCondition::new); diff --git a/common/src/main/java/dev/ftb/mods/ftbranks/impl/condition/DimensionCondition.java b/common/src/main/java/dev/ftb/mods/ftbranks/impl/condition/DimensionCondition.java index a6742fa..3a86958 100644 --- a/common/src/main/java/dev/ftb/mods/ftbranks/impl/condition/DimensionCondition.java +++ b/common/src/main/java/dev/ftb/mods/ftbranks/impl/condition/DimensionCondition.java @@ -8,9 +8,6 @@ import net.minecraft.server.level.ServerPlayer; import net.minecraft.world.level.Level; -/** - * @author LatvianModder - */ public class DimensionCondition implements RankCondition { private final ResourceKey dimension; diff --git a/common/src/main/java/dev/ftb/mods/ftbranks/impl/condition/RankAddedCondition.java b/common/src/main/java/dev/ftb/mods/ftbranks/impl/condition/RankAddedCondition.java index e937ba2..e4b9a90 100644 --- a/common/src/main/java/dev/ftb/mods/ftbranks/impl/condition/RankAddedCondition.java +++ b/common/src/main/java/dev/ftb/mods/ftbranks/impl/condition/RankAddedCondition.java @@ -5,9 +5,9 @@ import dev.ftb.mods.ftbranks.api.RankCondition; import net.minecraft.server.level.ServerPlayer; -public final class RankAddedCondition implements RankCondition { - private final Rank original; - private final String id; +public class RankAddedCondition implements RankCondition { + protected final Rank original; + protected final String id; public RankAddedCondition(Rank r, SNBTCompoundTag tag) { original = r; diff --git a/common/src/main/java/dev/ftb/mods/ftbranks/impl/condition/RankAppliesCondition.java b/common/src/main/java/dev/ftb/mods/ftbranks/impl/condition/RankAppliesCondition.java new file mode 100644 index 0000000..384949f --- /dev/null +++ b/common/src/main/java/dev/ftb/mods/ftbranks/impl/condition/RankAppliesCondition.java @@ -0,0 +1,23 @@ +package dev.ftb.mods.ftbranks.impl.condition; + +import dev.ftb.mods.ftblibrary.snbt.SNBTCompoundTag; +import dev.ftb.mods.ftbranks.api.Rank; +import net.minecraft.server.level.ServerPlayer; + +public class RankAppliesCondition extends RankAddedCondition { + public RankAppliesCondition(Rank r, SNBTCompoundTag tag) { + super(r, tag); + } + + @Override + public String getType() { + return "rank_applies"; + } + + @Override + public boolean isRankActive(ServerPlayer player) { + return original.getManager().getRank(id) + .map(rank -> rank != original && rank.isActive(player)) + .orElse(false); + } +} From 2bce4d7b6beb25dc4152a7dc45added4bc08d12c Mon Sep 17 00:00:00 2001 From: Des Herriott Date: Wed, 9 Apr 2025 11:54:05 +0100 Subject: [PATCH 3/4] build: version -> 2101.1.3, changelog updated --- CHANGELOG.md | 8 ++++++++ gradle.properties | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 80a7bd1..0bbb023 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,14 @@ 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.3] + +### Added +* New condition: `rank_applies` + * This is very similar to the existing `rank_added`, but does not require the rank to be explicitly added to the player + * It just requires that rank currently applies to the player, either implicitly or explicitly + * These two conditions can be useful to create more complex conditions by combining them with the boolean conditions (and/or/not) + ## [2100.1.2] ### Changed diff --git a/gradle.properties b/gradle.properties index cdac6e1..fb5a40d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,7 +4,7 @@ mod_id=ftbranks readable_name=FTB Ranks archives_base_name=ftb-ranks maven_group=dev.ftb.mods -mod_version=2101.1.2 +mod_version=2101.1.3 mod_author=FTB Team minecraft_version=1.21.1 From d0969f779bf97dfd58bec9b145235a9e23ef1bc6 Mon Sep 17 00:00:00 2001 From: Des Herriott Date: Wed, 9 Apr 2025 12:34:24 +0100 Subject: [PATCH 4/4] build: stop using saps updated ftb library dep version --- build.gradle | 12 +++--------- gradle.properties | 2 +- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/build.gradle b/build.gradle index d3fa6b8..c04dc67 100644 --- a/build.gradle +++ b/build.gradle @@ -47,26 +47,20 @@ allprojects { maven { url "https://maven.architectury.dev/" - } - - maven { - url "https://www.cursemaven.com" content { - includeGroup "curse.maven" + includeGroup "dev.architectury" } } maven { - url "https://maven.saps.dev/minecraft" + url "https://maven.ftb.dev/releases" content { - includeGroup "dev.latvian.mods" includeGroup "dev.ftb.mods" } } maven { - url "https://maven.saps.dev/snapshots" + url "https://maven.ftb.dev/snapshots" content { - includeGroup "dev.latvian.mods" includeGroup "dev.ftb.mods" } } diff --git a/gradle.properties b/gradle.properties index fb5a40d..0484dd9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -19,7 +19,7 @@ fabric_api_version=0.102.1+1.21.1 fabric_api_version_range=>=0.102.1+1.21.1 architectury_version=13.0.6 -ftb_library_version=2101.1.3 +ftb_library_version=2101.1.12 curseforge_id_forge=314905 curseforge_id_fabric=472659