mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-02 06:28:52 +00:00
A little cleanup and adding bow spam blocker, hoping to do something better with blocking instant fire soon, though.
This commit is contained in:
1 parent
ea7997e862
commit
488be4c68d
9 files changed
+96
-18
No files matched your search
@@ -0,0 +1,41 @@
|
||||
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 BowManager {
|
||||
public Map<Player,Boolean> shot = new HashMap<Player,Boolean>();
|
||||
Anticheat plugin;
|
||||
|
||||
public BowManager(Anticheat plugin)
|
||||
{
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
public void logShoot(final Player player)
|
||||
{
|
||||
shot.put(player, true);
|
||||
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
shot.put(player, false);
|
||||
}
|
||||
}, 5L);
|
||||
}
|
||||
|
||||
public boolean hasShot(Player player)
|
||||
{
|
||||
if(shot.get(player) == null || shot.get(player) == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user