mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-03 06:28:52 +00:00
Blocks dropping your inventory all at once.
This commit is contained in:
1 parent
169dd2b520
commit
a2720d8640
4 files changed
+65
-1
No files matched your search
@@ -0,0 +1,40 @@
|
||||
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 ItemManager {
|
||||
public Map<Player,Boolean> drop = new HashMap<Player,Boolean>();
|
||||
Anticheat plugin;
|
||||
|
||||
public ItemManager(Anticheat plugin)
|
||||
{
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
public void logDrop(final Player player)
|
||||
{
|
||||
drop.put(player, true);
|
||||
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable()
|
||||
{
|
||||
public void run()
|
||||
{
|
||||
drop.put(player, false);
|
||||
}
|
||||
}, 2L);
|
||||
}
|
||||
|
||||
public boolean hasDropped(Player player)
|
||||
{
|
||||
if(drop.get(player) == null || drop.get(player) == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user