Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed getItemInHand call and added nickname_hex_stripped placeholder #36

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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 @@ -263,8 +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("\\&#[0-9a-f]{6,}", "") : 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