mirror of
https://github.com/darksaid98/AntiCheatReloaded.git
synced 2026-12-02 22:16:03 +00:00
PvP fix, players (hopefully) won't be teleported like mad while PvP'ing
This commit is contained in:
1 parent
0c7e4140bd
commit
e9a0bc2bdd
4 files changed
+60
-24
No files matched your search
+29
-2
@@ -5,11 +5,12 @@ import java.util.Map;
|
||||
import net.h31ix.anticheat.Anticheat;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class VehicleManager {
|
||||
public class ExemptManager {
|
||||
public Map<Player,Boolean> enter = new HashMap<Player,Boolean>();
|
||||
public Map<Player,Boolean> hit = new HashMap<Player,Boolean>();
|
||||
Anticheat plugin;
|
||||
|
||||
public VehicleManager(Anticheat plugin)
|
||||
public ExemptManager(Anticheat plugin)
|
||||
{
|
||||
this.plugin = plugin;
|
||||
}
|
||||
@@ -19,6 +20,7 @@ public class VehicleManager {
|
||||
enter.put(player, true);
|
||||
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
enter.put(player, false);
|
||||
@@ -37,4 +39,29 @@ public class VehicleManager {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
public void logHit(final Player player)
|
||||
{
|
||||
hit.put(player, true);
|
||||
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
hit.put(player, false);
|
||||
}
|
||||
}, 15L);
|
||||
}
|
||||
|
||||
public boolean isHit(Player player)
|
||||
{
|
||||
if(hit.get(player) == null || hit.get(player) == false)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user