Skip to content

Commit

Permalink
misc
Browse files Browse the repository at this point in the history
  • Loading branch information
Cow authored and Cow committed Feb 16, 2022
1 parent 0232faf commit 3e41f0e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void onPlayerChat(AsyncPlayerChatEvent event) {
return;
}

if (plugin.getConfig().getBoolean("FILTER.ENABLED")) {
if (plugin.getConfig().getBoolean("FILTER.ENABLED") && !player.hasPermission(plugin.getConfig().getString("PERMISSIONS.BYPASS_FILTER"))) {
if (plugin.getConfig().getBoolean("FILTER.BLOCK_UNICODE")) {
if (Arrays.stream(event.getMessage().split("")).map(isInvalid::matcher).anyMatch(Matcher::matches)) {
event.setCancelled(true);
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/io/github/punishmentsx/menus/PunishMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ public void onUpdate(GUI gui) {

for (String key : config.getConfigurationSection("MENUS.PUNISH.SLOTS").getKeys(false)) {
ConfigurationSection section = config.getConfigurationSection("MENUS.PUNISH.SLOTS." + key);

if (section.getString("PERMISSION") != null && !staff.hasPermission(section.getString("PERMISSION"))) continue;

gui.addButton(createButton(plugin, targetProfile, staff, notes, section));
}

Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ MESSAGES:

PERMISSIONS:
SILENT_VIEW: "punishments.view.silent" #See silent punishments in chat & see hover of public punishments
BYPASS_FILTER: "punishments.filter.bypass"
HISTORY: "punishments.history" #/history
PUNISH: "punishments.punish" #/punish, /cmdpunish
UNPUNISH: "punishments.unpunish" #/unban, /unmute
Expand All @@ -178,6 +179,7 @@ MENUS:
NAME: "&c&lCheats" # Name in GUI
MATERIAL: "DIAMOND_SWORD" # Material in GUI
DEFAULT_REASON: "Cheating" # Reason if none is specified in punish command
PERMISSION: "punishments.general"
PUNISHMENTS:
- "ban:30d" # 1st offense
- "ban:90d" # 2nd offense
Expand All @@ -195,6 +197,7 @@ MENUS:
NAME: "&c&lSpamming"
MATERIAL: "PAPER"
DEFAULT_REASON: "Spamming"
PERMISSION: "punishments.general"
PUNISHMENTS:
- "mute:30m"
- "mute:1d"
Expand All @@ -215,6 +218,7 @@ MENUS:
NAME: "&c&lFoul Language"
MATERIAL: "BOOK"
DEFAULT_REASON: "Foul Language"
PERMISSION: "punishments.general"
PUNISHMENTS:
- "mute:1d"
- "mute:7d"
Expand All @@ -235,6 +239,7 @@ MENUS:
NAME: "&c&lAdvertising"
MATERIAL: "GOLD_SWORD"
DEFAULT_REASON: "Advertising"
PERMISSION: "punishments.general"
PUNISHMENTS:
- "mute:30d"
- "mute:90d"
Expand Down

0 comments on commit 3e41f0e

Please sign in to comment.