Skip to content

Commit 249cecc

Browse files
authored
Merge pull request #52 from FTBTeam/dev
Dev
2 parents 09b03b9 + d0969f7 commit 249cecc

File tree

7 files changed

+50
-27
lines changed

7 files changed

+50
-27
lines changed

CHANGELOG.md

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,63 +4,71 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7-
[2100.1.2]
7+
## [2101.1.3]
8+
9+
### Added
10+
* New condition: `rank_applies`
11+
* This is very similar to the existing `rank_added`, but does not require the rank to be explicitly added to the player
12+
* It just requires that rank currently applies to the player, either implicitly or explicitly
13+
* These two conditions can be useful to create more complex conditions by combining them with the boolean conditions (and/or/not)
14+
15+
## [2100.1.2]
816

917
### Changed
1018
* API change for RankManager#createRank
1119
* Added new RankManager#createRank(String, int, boolean) method, deprecated the existing RankManager#createRank(String, String, int) method
1220
* Note: minor API break here: both methods now throw a RankException if the rank already exists, rather than blindly overwrite it
1321

14-
[2100.1.1]
22+
## [2100.1.1]
1523

1624
### Changed
1725
* Now loads a supplementary `config/ftbranks-pack.snbt` file alongside the default file
1826
* Intended to augment existing ranks from `ranks.snbt` with pack-specific settings, to be created by modpack makers, independent of the server admin settings.
1927

20-
[2100.1.0]
28+
## [2100.1.0]
2129

2230
### Changed
2331
* Ported to Minecraft 1.21. Support for Fabric and NeoForge.
2432
* Forge support may be re-added if/when Architectury adds support for Forge
2533

26-
## 2006.1.0
34+
## [2006.1.0]
2735

2836
### Changed
2937
* Ported to Minecraft 1.20.6. Support for Fabric and NeoForge.
3038
* Forge support may be re-added if/when Architectury adds support for Forge
3139

32-
## 2004.2.0
40+
## [2004.2.0]
3341

3442
### Changed
3543
* Ported to MC 1.20.4: Forge, NeoForge and Fabric all supported
3644

37-
## 1902.1.16
45+
## [1902.1.16]
3846

3947
### Fixed
4048
* Correctly report errors and stop when a syntax error in ranks.snbt or players.snbt prevents the file from loading
4149
* Don't tell the player it loaded OK then wipe the current runtime config...
4250

43-
## 1902.1.15
51+
## [1902.1.15]
4452

4553
### Added
4654
* Added `/ftbranks node list <rank>` command to view the permissions nodes that are added to a given rank
4755
* Some backend code improvements for Fabric, related to player display name processing
4856
* Now using a custom Fabric event in FTB Library for better inter-mod compatibility with upcoming Fabric version of FTB Essentials
4957

50-
## 1902.1.14
58+
## [1902.1.14]
5159

5260
### Fixed
5361
* Backed out dynamic tab-completion functionality and use simple server-side suggestions instead
5462
* FTB Ranks is a server-only mod again and no longer needs to be installed on the client since that's unnecessarily disruptive
5563

56-
## 1902.1.13
64+
## [1902.1.13]
5765

5866
### Fixed
5967
* Made rank-based chat text colouring (using `ftbranks.chat_text.*` nodes in `ranks.snbt`) work correctly on Forge and Fabric
6068
* FTB Ranks is no longer incorrectly marked as a server-only mod
6169
* As of the previous release, it is also required on the client (to support Tab-completion for ranks in commands)
6270

63-
## 1902.1.12
71+
## [1902.1.12]
6472

6573
### Added
6674
* Events are now fired for other mods to consume when various things happen:

build.gradle

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,26 +47,20 @@ allprojects {
4747

4848
maven {
4949
url "https://maven.architectury.dev/"
50-
}
51-
52-
maven {
53-
url "https://www.cursemaven.com"
5450
content {
55-
includeGroup "curse.maven"
51+
includeGroup "dev.architectury"
5652
}
5753
}
5854

5955
maven {
60-
url "https://maven.saps.dev/minecraft"
56+
url "https://maven.ftb.dev/releases"
6157
content {
62-
includeGroup "dev.latvian.mods"
6358
includeGroup "dev.ftb.mods"
6459
}
6560
}
6661
maven {
67-
url "https://maven.saps.dev/snapshots"
62+
url "https://maven.ftb.dev/snapshots"
6863
content {
69-
includeGroup "dev.latvian.mods"
7064
includeGroup "dev.ftb.mods"
7165
}
7266
}

common/src/main/java/dev/ftb/mods/ftbranks/impl/FTBRanksAPIImpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ public static void worldSaved(ServerLevel event) {
6464
public static void registerConditions(RegisterConditionsEvent event) {
6565
event.register("always_active", (rank, json) -> AlwaysActiveCondition.INSTANCE);
6666
event.register("rank_added", RankAddedCondition::new);
67+
event.register("rank_applies", RankAppliesCondition::new);
6768

6869
event.register("not", NotCondition::new);
6970
event.register("or", OrCondition::new);

common/src/main/java/dev/ftb/mods/ftbranks/impl/condition/DimensionCondition.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
import net.minecraft.server.level.ServerPlayer;
99
import net.minecraft.world.level.Level;
1010

11-
/**
12-
* @author LatvianModder
13-
*/
1411
public class DimensionCondition implements RankCondition {
1512
private final ResourceKey<Level> dimension;
1613

common/src/main/java/dev/ftb/mods/ftbranks/impl/condition/RankAddedCondition.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
import dev.ftb.mods.ftbranks.api.RankCondition;
66
import net.minecraft.server.level.ServerPlayer;
77

8-
public final class RankAddedCondition implements RankCondition {
9-
private final Rank original;
10-
private final String id;
8+
public class RankAddedCondition implements RankCondition {
9+
protected final Rank original;
10+
protected final String id;
1111

1212
public RankAddedCondition(Rank r, SNBTCompoundTag tag) {
1313
original = r;
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package dev.ftb.mods.ftbranks.impl.condition;
2+
3+
import dev.ftb.mods.ftblibrary.snbt.SNBTCompoundTag;
4+
import dev.ftb.mods.ftbranks.api.Rank;
5+
import net.minecraft.server.level.ServerPlayer;
6+
7+
public class RankAppliesCondition extends RankAddedCondition {
8+
public RankAppliesCondition(Rank r, SNBTCompoundTag tag) {
9+
super(r, tag);
10+
}
11+
12+
@Override
13+
public String getType() {
14+
return "rank_applies";
15+
}
16+
17+
@Override
18+
public boolean isRankActive(ServerPlayer player) {
19+
return original.getManager().getRank(id)
20+
.map(rank -> rank != original && rank.isActive(player))
21+
.orElse(false);
22+
}
23+
}

gradle.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ mod_id=ftbranks
44
readable_name=FTB Ranks
55
archives_base_name=ftb-ranks
66
maven_group=dev.ftb.mods
7-
mod_version=2101.1.2
7+
mod_version=2101.1.3
88
mod_author=FTB Team
99

1010
minecraft_version=1.21.1
@@ -19,7 +19,7 @@ fabric_api_version=0.102.1+1.21.1
1919
fabric_api_version_range=>=0.102.1+1.21.1
2020
architectury_version=13.0.6
2121

22-
ftb_library_version=2101.1.3
22+
ftb_library_version=2101.1.12
2323

2424
curseforge_id_forge=314905
2525
curseforge_id_fabric=472659

0 commit comments

Comments
 (0)