2015-11-15 23:32:04 +00:00
|
|
|
package me.totalfreedom.totalfreedommod;
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
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)
|
|
|
|
{
|
|
|
|
for (Player player : server.getOnlinePlayers())
|
|
|
|
{
|
2020-12-04 00:28:53 +00:00
|
|
|
if (plugin.al.isAdmin(player) && plugin.al.getAdmin(player).getCommandSpy())
|
2016-06-24 23:24:56 +00:00
|
|
|
{
|
2020-12-19 02:43:24 +00:00
|
|
|
if (plugin.al.isAdmin(event.getPlayer()) && !plugin.al.isSeniorAdmin(player))
|
2018-04-19 14:29:19 +00:00
|
|
|
{
|
|
|
|
continue;
|
|
|
|
}
|
2020-12-19 02:43:24 +00:00
|
|
|
|
2018-04-19 14:29:19 +00:00
|
|
|
if (player != event.getPlayer())
|
|
|
|
{
|
|
|
|
FUtil.playerMsg(player, event.getPlayer().getName() + ": " + event.getMessage());
|
|
|
|
}
|
2015-11-15 23:32:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-12-04 00:28:53 +00:00
|
|
|
}
|