2015-11-15 23:32:04 +00:00
|
|
|
package me.totalfreedom.totalfreedommod;
|
|
|
|
|
2022-11-17 08:34:45 +00:00
|
|
|
import net.kyori.adventure.text.Component;
|
|
|
|
import net.kyori.adventure.text.event.ClickEvent;
|
2015-11-15 23:32:04 +00:00
|
|
|
import org.bukkit.event.EventHandler;
|
|
|
|
import org.bukkit.event.EventPriority;
|
|
|
|
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
|
|
|
|
2016-06-24 23:24:56 +00:00
|
|
|
public class CommandSpy extends FreedomService
|
|
|
|
{
|
2015-11-15 23:32:04 +00:00
|
|
|
@Override
|
2020-07-01 01:51:06 +00:00
|
|
|
public void onStart()
|
2016-06-24 23:24:56 +00:00
|
|
|
{
|
2015-11-15 23:32:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2020-07-01 01:51:06 +00:00
|
|
|
public void onStop()
|
2016-06-24 23:24:56 +00:00
|
|
|
{
|
2015-11-15 23:32:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@EventHandler(priority = EventPriority.MONITOR)
|
2016-06-24 23:24:56 +00:00
|
|
|
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event)
|
|
|
|
{
|
2022-11-17 08:34:45 +00:00
|
|
|
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()))));
|
2015-11-15 23:32:04 +00:00
|
|
|
}
|
2020-12-04 00:28:53 +00:00
|
|
|
}
|