mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-03 06:28:52 +00:00
Instant bow blocking
This commit is contained in:
1 parent
5cd3e8b717
commit
48d56aef09
3 files changed
+73
-15
No files matched your search
@@ -7,6 +7,7 @@ import org.bukkit.entity.Player;
|
||||
|
||||
public class BowManager {
|
||||
public Map<Player,Boolean> shot = new HashMap<Player,Boolean>();
|
||||
public Map<Player,Boolean> wind = new HashMap<Player,Boolean>();
|
||||
Anticheat plugin;
|
||||
|
||||
public BowManager(Anticheat plugin)
|
||||
@@ -14,6 +15,19 @@ public class BowManager {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
public void logWindUp(final Player player)
|
||||
{
|
||||
wind.put(player, true);
|
||||
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
wind.put(player, false);
|
||||
}
|
||||
}, 2L);
|
||||
}
|
||||
|
||||
public void logShoot(final Player player)
|
||||
{
|
||||
shot.put(player, true);
|
||||
@@ -39,4 +53,16 @@ public class BowManager {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean justWoundUp(Player player)
|
||||
{
|
||||
if(wind.get(player) == null || wind.get(player) == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user