mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-01 14:38:56 +00:00
Command spam blocking
This commit is contained in:
1 parent
9e9a35117f
commit
18fc901fe9
1 file changed
+11
-3
@@ -2,13 +2,12 @@ package net.h31ix.anticheat.event;
|
||||
|
||||
import net.h31ix.anticheat.Anticheat;
|
||||
import net.h31ix.anticheat.checks.LengthCheck;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerChatEvent;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
import org.bukkit.event.player.PlayerKickEvent;
|
||||
import org.bukkit.event.player.PlayerMoveEvent;
|
||||
|
||||
@@ -20,6 +19,15 @@ public class PlayerListener implements Listener {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event)
|
||||
{
|
||||
if(!plugin.lagged)
|
||||
{
|
||||
plugin.cm.addChat(event.getPlayer());
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerChat(PlayerChatEvent event)
|
||||
{
|
||||
@@ -67,7 +75,7 @@ public class PlayerListener implements Listener {
|
||||
}
|
||||
if(player.isSneaking())
|
||||
{
|
||||
if(xd > 0.097D || zd > 0.081D)
|
||||
if(xd > 0.1D || zd > 0.1D)
|
||||
{
|
||||
plugin.log(player.getName()+" is sneaking too fast! XSpeed="+xd+" ZSpeed="+zd);
|
||||
event.setTo(event.getFrom().clone());
|
||||
|
||||
Reference in new issue
Block a user