Skip to content
Merged

Dev #52

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 18 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,63 +4,71 @@ 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]
## [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
* 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 <rank>` 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:
Expand Down
12 changes: 3 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<Level> dimension;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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);
}
}
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down