From d85cdc2a20e31ccc006fc6bd419e2237426c1fd2 Mon Sep 17 00:00:00 2001 From: Flemmli97 Date: Thu, 10 Jun 2021 19:25:05 +0200 Subject: [PATCH] claim name display --- Changelog.txt | 17 +++++++++++++++++ gradle.properties | 2 +- .../io/github/flemmli97/flan/claim/Claim.java | 15 +++++++++++---- .../flemmli97/flan/config/LangConfig.java | 2 ++ 4 files changed, 31 insertions(+), 5 deletions(-) diff --git a/Changelog.txt b/Changelog.txt index 0e34f90..884f4bf 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -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 diff --git a/gradle.properties b/gradle.properties index 09854af..32c7956 100644 --- a/gradle.properties +++ b/gradle.properties @@ -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 diff --git a/src/main/java/io/github/flemmli97/flan/claim/Claim.java b/src/main/java/io/github/flemmli97/flan/claim/Claim.java index ee6103d..5697b93 100644 --- a/src/main/java/io/github/flemmli97/flan/claim/Claim.java +++ b/src/main/java/io/github/flemmli97/flan/claim/Claim.java @@ -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() : ""; - 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)); diff --git a/src/main/java/io/github/flemmli97/flan/config/LangConfig.java b/src/main/java/io/github/flemmli97/flan/config/LangConfig.java index b0c3a24..e20bdcd 100644 --- a/src/main/java/io/github/flemmli97/flan/config/LangConfig.java +++ b/src/main/java/io/github/flemmli97/flan/config/LangConfig.java @@ -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";