mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-17 21:06:11 +00:00
46 lines
1.1 KiB
Java
46 lines
1.1 KiB
Java
|
package me.totalfreedom.totalfreedommod;
|
||
|
|
||
|
import me.totalfreedom.totalfreedommod.util.FUtil;
|
||
|
import net.pravian.aero.component.service.AbstractService;
|
||
|
import org.bukkit.entity.Player;
|
||
|
import org.bukkit.event.EventHandler;
|
||
|
import org.bukkit.event.EventPriority;
|
||
|
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||
|
|
||
|
public class CommandSpy extends AbstractService<TotalFreedomMod>
|
||
|
{
|
||
|
|
||
|
public CommandSpy(TotalFreedomMod plugin)
|
||
|
{
|
||
|
super(plugin);
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
protected void onStart()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
@Override
|
||
|
protected void onStop()
|
||
|
{
|
||
|
}
|
||
|
|
||
|
@EventHandler(priority = EventPriority.MONITOR)
|
||
|
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event)
|
||
|
{
|
||
|
if (plugin.al.isAdmin(event.getPlayer()))
|
||
|
{
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
for (Player player : server.getOnlinePlayers())
|
||
|
{
|
||
|
if (plugin.al.isAdmin(player) && plugin.pl.getPlayer(player).cmdspyEnabled())
|
||
|
{
|
||
|
FUtil.playerMsg(player, event.getPlayer().getName() + ": " + event.getMessage());
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|