Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ public String onRequest(OfflinePlayer player, @NotNull String identifier) {
Player oPlayer = player.getPlayer();
if (oPlayer == null) return "";

if (oPlayer.getItemInHand().getType() == Material.AIR) return "";
item = oPlayer.getItemInHand();
if (oPlayer.getInventory().getItemInMainHand().getType() == Material.AIR) return "";
item = oPlayer.getInventory().getItemInMainHand();
}

BigDecimal worth = essentials.getWorth().getPrice(essentials, item);
Expand Down Expand Up @@ -263,6 +263,8 @@ public String onRequest(OfflinePlayer player, @NotNull String identifier) {
return user.getNickname() != null ? essentials.getUser(player.getUniqueId()).getNickname() : player.getName();
case "nickname_stripped":
return ChatColor.stripColor(user.getNickname() != null ? essentials.getUser(player.getUniqueId()).getNickname() : player.getName());
case "nickname_hex_stripped":
return user.getNickname() != null ? user.getNickname().replaceAll("§x§[0-9a-f]§[0-9a-f]§[0-9a-f]§[0-9a-f]§[0-9a-f]§[0-9a-f]", "") : player.getName();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cache this regex

case "godmode":
return user.isGodModeEnabled() ? papiTrue : papiFalse;
case "unique":
Expand Down