mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-01 14:38:48 +00:00
Make shadow mute prefix configurable
This commit is contained in:
1 parent
6d33231d41
commit
de57bbee05
3 files changed
+13
-2
No files matched your search
+1
-1
@@ -38,7 +38,7 @@ public final class CarbonChatModeration extends JavaPlugin {
|
||||
Bukkit.getPluginManager().registerEvents(new CapsHandler(this), this);
|
||||
Bukkit.getPluginManager().registerEvents(new FilterHandler(this), this);
|
||||
Bukkit.getPluginManager().registerEvents(new MuteHandler(), this);
|
||||
Bukkit.getPluginManager().registerEvents(new ShadowMuteHandler(), this);
|
||||
Bukkit.getPluginManager().registerEvents(new ShadowMuteHandler(this), this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+10
-1
@@ -2,12 +2,19 @@ package net.draycia.carbonmoderation.listeners;
|
||||
|
||||
import net.draycia.carbon.events.ChatComponentEvent;
|
||||
import net.draycia.carbon.events.ChatFormatEvent;
|
||||
import net.draycia.carbonmoderation.CarbonChatModeration;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
public class ShadowMuteHandler implements Listener {
|
||||
|
||||
private final CarbonChatModeration moderation;
|
||||
|
||||
public ShadowMuteHandler(CarbonChatModeration moderation) {
|
||||
this.moderation = moderation;
|
||||
}
|
||||
|
||||
@EventHandler(priority = EventPriority.LOWEST)
|
||||
public void onComponent(ChatComponentEvent event) {
|
||||
if (event.getSender().isShadowMuted()) {
|
||||
@@ -27,7 +34,9 @@ public class ShadowMuteHandler implements Listener {
|
||||
return;
|
||||
}
|
||||
|
||||
event.setFormat("[SM] " + event.getFormat());
|
||||
String prefix = moderation.getConfig().getString("shadow-mute-prefix", "[SM] ");
|
||||
|
||||
event.setFormat(prefix + event.getFormat());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -4,6 +4,8 @@ caps-protection:
|
||||
percent-caps: 80
|
||||
block-message: false
|
||||
|
||||
shadow-mute-prefix: '[SM] '
|
||||
|
||||
filters:
|
||||
enabled: true
|
||||
case-sensitive: false
|
||||
|
||||
Reference in new issue
Block a user