mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-01 22:14:49 +00:00
Fixed vehicles and also added animation listeners to watch for instantbreak hacks.
This commit is contained in:
1 parent
18fc901fe9
commit
57edc8cac3
5 files changed
+180
-32
No files matched your search
@@ -0,0 +1,43 @@
|
||||
package net.h31ix.anticheat;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class AnimationManager {
|
||||
public Map<Player,Boolean> animations = new HashMap<Player,Boolean>();
|
||||
Anticheat plugin;
|
||||
|
||||
public AnimationManager(Anticheat plugin)
|
||||
{
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
public void logAnimation(final Player player)
|
||||
{
|
||||
animations.put(player, true);
|
||||
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable()
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
animations.put(player, false);
|
||||
}
|
||||
}, 10L);
|
||||
}
|
||||
|
||||
public boolean swungArm(Player player)
|
||||
{
|
||||
if(animations.get(player) == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if(animations.get(player) == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user