claim name display

This commit is contained in:
Flemmli97 2021-06-10 19:25:05 +02:00
parent 35c9e98213
commit d85cdc2a20
4 changed files with 31 additions and 5 deletions

View File

@ -1,3 +1,20 @@
Flan 1.4.2
======================
- Fix a ticking player crash
- Fix anvil gui not updating client xp use
- Add ability to name claims.
Names have to be unique for each player and claim.
No additional feature for that (yet)
- Add blockEntityTagIgnore config
Blockentities are checked against the strings here and if their tag
matches one they will be ignored for a permission check.
Useful for blockentities that should only be accessible under certain circumstances.
Default values: ["IsDeathChest"] for vanilla death chest mod (only for version 2.0.0+)
- Add entityTagIgnore config same as blockEntityTagIgnore but it will only
check against scoreboard tags. Default "graves.marker" is for vanilla tweaks graves.
Keep in mind that the items dropped by graves are not player bound so if a claim disables
item pickups you will not be able to pick up the items
Flan 1.4.1
======================
- Change globalDefaultPerms to use a version where you can specify if its modifiable or not

View File

@ -6,7 +6,7 @@ minecraft_version=1.16.2
yarn_mappings=1.16.2+build.1
loader_version=0.9.1+build.205
# Mod Properties
mod_version=1.4.1
mod_version=1.4.2
maven_group=io.github.flemmli97
archives_base_name=flan
# Dependencies

View File

@ -601,10 +601,17 @@ public class Claim implements IPermissionContainer {
l.add(PermHelper.simpleColoredText("=============================================", Formatting.GREEN));
GameProfile prof = this.owner != null ? player.getServer().getUserCache().getByUuid(this.owner) : null;
String ownerName = this.isAdminClaim() ? "Admin" : prof != null ? prof.getName() : "<UNKNOWN>";
if (this.parent == null)
l.add(PermHelper.simpleColoredText(String.format(ConfigHandler.lang.claimBasicInfo, ownerName, this.minX, this.minZ, this.maxX, this.maxZ, this.subClaims.size()), Formatting.GOLD));
else
l.add(PermHelper.simpleColoredText(String.format(ConfigHandler.lang.claimBasicInfoSub, ownerName, this.minX, this.minZ, this.maxX, this.maxZ), Formatting.GOLD));
if (this.parent == null) {
if (this.claimName.isEmpty())
l.add(PermHelper.simpleColoredText(String.format(ConfigHandler.lang.claimBasicInfo, ownerName, this.minX, this.minZ, this.maxX, this.maxZ, this.subClaims.size()), Formatting.GOLD));
else
l.add(PermHelper.simpleColoredText(String.format(ConfigHandler.lang.claimBasicInfoNamed, ownerName, this.minX, this.minZ, this.maxX, this.maxZ, this.subClaims.size(), this.claimName), Formatting.GOLD));
} else {
if (this.claimName.isEmpty())
l.add(PermHelper.simpleColoredText(String.format(ConfigHandler.lang.claimBasicInfoSub, ownerName, this.minX, this.minZ, this.maxX, this.maxZ), Formatting.GOLD));
else
l.add(PermHelper.simpleColoredText(String.format(ConfigHandler.lang.claimBasicInfoSubNamed, ownerName, this.minX, this.minZ, this.maxX, this.maxZ, this.claimName), Formatting.GOLD));
}
if (perms) {
l.add(PermHelper.simpleColoredText(String.format(ConfigHandler.lang.claimInfoPerms, this.globalPerm), Formatting.RED));
l.add(PermHelper.simpleColoredText(ConfigHandler.lang.claimGroupInfoHeader, Formatting.RED));

View File

@ -79,8 +79,10 @@ public class LangConfig {
public String giveClaimBlocks = "Gave following players %2$d claimblocks: %1$s";
public String claimBasicInfo = "Owner: %1$s, from: [x=%2$d,z=%3$d] to [x=%4$d,z=%5$d]; Subclaim-amount: %6$d";
public String claimBasicInfoNamed = "Claim: %7$s, Owner: %1$s, from: [x=%2$d,z=%3$d] to [x=%4$d,z=%5$d]; Subclaim-amount: %6$d";
public String claimSubHeader = "==SubclaimInfo==";
public String claimBasicInfoSub = "Owner: %1$s, from: [x=%2$d,z=%3$d] to [x=%4$d,z=%5$d]";
public String claimBasicInfoSubNamed = "Claim: %6$s, Owner: %1$s, from: [x=%2$d,z=%3$d] to [x=%4$d,z=%5$d]";
public String claimInfoPerms = "Permissions: %s";
public String claimGroupInfoHeader = "Groups: ";
public String claimGroupPerms = " Permissions: %s";