mirror of
https://github.com/darksaid98/Carbon.git
synced 2026-12-02 22:16:22 +00:00
Move shadowmute console formatting to moderation addon
This commit is contained in:
1 parent
b058c717ad
commit
6d33231d41
4 files changed
+30
-6
No files matched your search
+13
-1
@@ -1,6 +1,7 @@
|
||||
package net.draycia.carbonmoderation.listeners;
|
||||
|
||||
import net.draycia.carbon.events.ChatComponentEvent;
|
||||
import net.draycia.carbon.events.ChatFormatEvent;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
@@ -14,8 +15,19 @@ public class ShadowMuteHandler implements Listener {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: figure out a way to add the console "[SM]" prefix for shadow muted players
|
||||
@EventHandler
|
||||
public void on(ChatFormatEvent event) {
|
||||
if (event.getTarget() != null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!event.getSender().isShadowMuted()) {
|
||||
return;
|
||||
}
|
||||
|
||||
event.setFormat("[SM] " + event.getFormat());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user