mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-02 14:38:45 +00:00
Teleport and autoheal blocker
This commit is contained in:
1 parent
721c618b26
commit
5cd3e8b717
7 files changed
+113
-30
No files matched your search
@@ -2,21 +2,26 @@ 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 HealthManager {
|
||||
Anticheat plugin;
|
||||
|
||||
public Map<Player,Float> fall = new HashMap<Player,Float>();
|
||||
public Map<Player,Boolean> healed = new HashMap<Player,Boolean>();
|
||||
public Map<Player,Integer> health = new HashMap<Player,Integer>();
|
||||
public Map<Player,Integer> fallvl = new HashMap<Player,Integer>();
|
||||
|
||||
public HealthManager()
|
||||
public HealthManager(Anticheat plugin)
|
||||
{
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
public void log(Player player)
|
||||
public void log(final Player player)
|
||||
{
|
||||
fall.put(player, player.getFallDistance());
|
||||
health.put(player, player.getHealth());
|
||||
health.put(player, player.getHealth());
|
||||
}
|
||||
|
||||
public boolean checkFall(Player player)
|
||||
@@ -51,6 +56,31 @@ public class HealthManager {
|
||||
}
|
||||
}
|
||||
|
||||
public void logHeal(final Player player)
|
||||
{
|
||||
healed.put(player, true);
|
||||
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
healed.put(player, false);
|
||||
}
|
||||
}, 35L);
|
||||
}
|
||||
|
||||
public boolean justHealed(Player player)
|
||||
{
|
||||
if(healed.get(player) != null)
|
||||
{
|
||||
return healed.get(player);
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public float getFall(Player player)
|
||||
{
|
||||
if(fall.get(player) != null)
|
||||
@@ -73,6 +103,5 @@ public class HealthManager {
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ import net.h31ix.anticheat.Anticheat;
|
||||
|
||||
public class LoginManager {
|
||||
Anticheat plugin;
|
||||
boolean join;
|
||||
public boolean join;
|
||||
|
||||
public LoginManager(Anticheat plugin)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user