Added NoCheatPlus hooks.
This commit is contained in:
parent
fb563c9274
commit
c5b7e97623
@ -35,6 +35,7 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.player.PlayerQuitEvent;
|
||||
import org.bukkit.event.player.PlayerToggleFlightEvent;
|
||||
import org.bukkit.event.player.PlayerVelocityEvent;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
import fr.neatmonster.nocheatplus.NCPAPIProvider;
|
||||
@ -88,9 +89,37 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
NCPExemptionManager.exemptPermanently(event.getPlayer());
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
_exemptTimeMap.put(event.getPlayer().getUniqueId(), System.currentTimeMillis() + 1500);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void ncpExemptVelocity(final PlayerVelocityEvent event)
|
||||
{
|
||||
if (_exemptTimeMap.containsKey(event.getPlayer().getUniqueId()))
|
||||
{
|
||||
_exemptTimeMap.put(event.getPlayer().getUniqueId(), System.currentTimeMillis() + 1500);
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
NCPExemptionManager.exemptPermanently(event.getPlayer());
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
_exemptTimeMap.put(event.getPlayer().getUniqueId(), System.currentTimeMillis() + 1500);
|
||||
event.getPlayer().sendMessage(event.getPlayer().getName() + " ignored.");
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -107,12 +136,14 @@ public class CustomTagFix extends MiniPlugin implements IPacketHandler
|
||||
if (System.currentTimeMillis() > entry.getValue())
|
||||
{
|
||||
iterator.remove();
|
||||
NCPExemptionManager.unexempt(entry.getKey());
|
||||
Player player = Bukkit.getPlayer(entry.getKey());
|
||||
|
||||
if (player != null)
|
||||
try
|
||||
{
|
||||
player.sendMessage(player.getName() + " not ignored.");
|
||||
NCPExemptionManager.unexempt(entry.getKey());
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user