Formatting
This commit is contained in:
1 parent
543912b8a1
commit
5ae4b03d30
4 files changed
+10
-18
No files matched your search
@@ -8,10 +8,10 @@ PlayerBounties-OG is a hard fork of [PlayerBountiesPlus](https://github.com/Tech
|
||||
- Inventory GUI for viewing bounties.
|
||||
- Customizable odds for receiving player head from bounty victim.
|
||||
- Localized messages in multiple languages.
|
||||
- Integrates [DiamondBank-OG](https://github.com/true-og/DiamondBank-OG) for currency.
|
||||
- Integrates [SimpleClans](https://github.com/true-og/SimpleClans) for team detection.
|
||||
- Integrates [CoreProtect-OG](https://github.com/true-og/CoreProtect-OG) for player head rollback injection.
|
||||
- Integrates [DiamondBank-OG](https://github.com/true-og/DiamondBank-OG) for currency.
|
||||
- Integrates [LuckPerms](https://github.com/true-og/LuckPerms) for player name and rank formatting.
|
||||
- Integrates [SimpleClans](https://github.com/true-og/SimpleClans) for team detection.
|
||||
|
||||
## Commands
|
||||
- `/bounty set <player> <amount>` – set a bounty on a player
|
||||
|
||||
@@ -124,10 +124,8 @@ public class BountyTopCmd {
|
||||
|
||||
private static String sanitizeDisplay(String formatted, String fallbackName) {
|
||||
|
||||
final String cleaned = StringUtils.trimToEmpty(formatted)
|
||||
.replaceAll("(?i)(?:\\s*(?:<reset>|[&§]r))+$", "")
|
||||
.replaceAll("\\s+>", " >")
|
||||
.replaceAll("\\s*>$", "");
|
||||
final String cleaned = StringUtils.trimToEmpty(formatted).replaceAll("(?i)(?:\\s*(?:<reset>|[&§]r))+$", "")
|
||||
.replaceAll("\\s+>", " >").replaceAll("\\s*>$", "");
|
||||
|
||||
if (cleaned.isBlank()) {
|
||||
|
||||
@@ -162,9 +160,7 @@ public class BountyTopCmd {
|
||||
|
||||
}
|
||||
|
||||
return input.replaceAll("(?i)[&§][0-9A-FK-ORX]", "")
|
||||
.replaceAll("<[^>]+>", "")
|
||||
.trim();
|
||||
return input.replaceAll("(?i)[&§][0-9A-FK-ORX]", "").replaceAll("<[^>]+>", "").trim();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -254,8 +254,7 @@ public class MainBountyGui extends GUIBase {
|
||||
final GUIItem item;
|
||||
if (entry.targetName() != null && !entry.targetName().isBlank()) {
|
||||
|
||||
item = new GUIItem(Material.PLAYER_HEAD, 1, " &f#" + rank + " " + displayName,
|
||||
entry.targetName());
|
||||
item = new GUIItem(Material.PLAYER_HEAD, 1, " &f#" + rank + " " + displayName, entry.targetName());
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
@@ -273,8 +273,8 @@ public class BountyHeadListener implements Listener {
|
||||
final CachedMetaData meta = user.getCachedData().getMetaData();
|
||||
final String prefix = StringUtils.trim(StringUtils.defaultString(meta.getPrefix()).replace('§', '&'));
|
||||
final String suffix = StringUtils.trim(StringUtils.defaultString(meta.getSuffix()).replace('§', '&'));
|
||||
final boolean metaContainsName = containsVisibleName(prefix, playerName) || containsVisibleName(suffix,
|
||||
playerName);
|
||||
final boolean metaContainsName = containsVisibleName(prefix, playerName)
|
||||
|| containsVisibleName(suffix, playerName);
|
||||
|
||||
final StringBuilder out = new StringBuilder();
|
||||
if (!prefix.isBlank()) {
|
||||
@@ -301,8 +301,7 @@ public class BountyHeadListener implements Listener {
|
||||
|
||||
private static String sanitizeDisplay(String formatted, String fallbackName) {
|
||||
|
||||
final String cleaned = StringUtils.trimToEmpty(formatted)
|
||||
.replaceAll("(?i)(?:\\s*(?:<reset>|[&§]r))+$", "")
|
||||
final String cleaned = StringUtils.trimToEmpty(formatted).replaceAll("(?i)(?:\\s*(?:<reset>|[&§]r))+$", "")
|
||||
.replaceAll("\\s*>$", "");
|
||||
|
||||
if (cleaned.isBlank()) {
|
||||
@@ -338,9 +337,7 @@ public class BountyHeadListener implements Listener {
|
||||
|
||||
}
|
||||
|
||||
return input.replaceAll("(?i)[&§][0-9A-FK-ORX]", "")
|
||||
.replaceAll("<[^>]+>", "")
|
||||
.trim();
|
||||
return input.replaceAll("(?i)[&§][0-9A-FK-ORX]", "").replaceAll("<[^>]+>", "").trim();
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user