2021-12-05 07:01:02 +00:00
|
|
|
package me.totalfreedom.totalfreedommod.admin.module;
|
2021-06-29 22:52:11 +00:00
|
|
|
|
2021-12-05 07:01:02 +00:00
|
|
|
import me.totalfreedom.totalfreedommod.services.AbstractService;
|
2021-06-29 22:52:11 +00:00
|
|
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
|
|
|
import org.bukkit.entity.Player;
|
|
|
|
import org.bukkit.event.EventHandler;
|
|
|
|
import org.bukkit.event.EventPriority;
|
|
|
|
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
|
|
|
|
2021-12-05 07:01:02 +00:00
|
|
|
public class CommandSpy extends AbstractService
|
2021-06-29 22:52:11 +00:00
|
|
|
{
|
|
|
|
@Override
|
|
|
|
public void onStart()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public void onStop()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
@EventHandler(priority = EventPriority.MONITOR)
|
|
|
|
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event)
|
|
|
|
{
|
|
|
|
for (Player player : server.getOnlinePlayers())
|
|
|
|
{
|
2021-12-05 07:01:02 +00:00
|
|
|
if (plugin.adminList.isAdmin(player) && plugin.adminList.getAdmin(player).getCommandSpy())
|
2021-06-29 22:52:11 +00:00
|
|
|
{
|
|
|
|
if (plugin.al.isAdmin(event.getPlayer()) && !plugin.al.isSeniorAdmin(player))
|
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (player != event.getPlayer())
|
|
|
|
{
|
|
|
|
FUtil.playerMsg(player, event.getPlayer().getName() + ": " + event.getMessage());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|