mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-02 22:16:03 +00:00
Aura/knockback hack blocker
This commit is contained in:
1 parent
aa3796438e
commit
891ca4eb4e
4 files changed
+69
-4
No files matched your search
@@ -0,0 +1,42 @@
|
||||
package net.h31ix.anticheat.manage;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.h31ix.anticheat.Anticheat;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class SprintManager {
|
||||
private Map<Player,Boolean> sprint = new HashMap<Player,Boolean>();
|
||||
private Anticheat plugin;
|
||||
|
||||
public SprintManager(Anticheat plugin)
|
||||
{
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
public void logSprint(final Player player)
|
||||
{
|
||||
sprint.put(player, true);
|
||||
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
sprint.put(player, false);
|
||||
}
|
||||
}, 2L);
|
||||
}
|
||||
|
||||
public boolean justSprinted(Player player)
|
||||
{
|
||||
if(sprint.get(player) == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return sprint.get(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user