mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-01 05:57:09 +00:00
2265783afb
Only thing left is to fix all the code issues from moving out the discord and shop implementations.
29 lines
948 B
Java
29 lines
948 B
Java
package me.totalfreedom.totalfreedommod;
|
|
|
|
import net.kyori.adventure.text.Component;
|
|
import net.kyori.adventure.text.event.ClickEvent;
|
|
import org.bukkit.event.EventHandler;
|
|
import org.bukkit.event.EventPriority;
|
|
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
|
|
|
public class CommandSpy extends FreedomService
|
|
{
|
|
@Override
|
|
public void onStart()
|
|
{
|
|
}
|
|
|
|
@Override
|
|
public void onStop()
|
|
{
|
|
}
|
|
|
|
@EventHandler(priority = EventPriority.MONITOR)
|
|
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event)
|
|
{
|
|
server.getOnlinePlayers().stream().filter(player -> plugin.al.isAdmin(player)
|
|
&& plugin.al.getAdmin(player).getCommandSpy() && player != event.getPlayer()).forEach(player ->
|
|
player.sendMessage(Component.text(event.getPlayer().getName()).append(Component.text(": "))
|
|
.append(Component.text(event.getMessage()))));
|
|
}
|
|
} |