diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/Arena.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/Arena.java index a4dca2dcc..ec26ae9e9 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/Arena.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/Arena.java @@ -258,8 +258,23 @@ public class Arena public void closeDoor() { - for (Location loc : _doorBlocks) - loc.getBlock().setType(Material.OBSIDIAN); + _host.Manager.getScheduler().scheduleSyncDelayedTask(_host.Manager.getPlugin(), new Runnable() + { + @Override + public void run() + { + for (Location loc : _doorBlocks) + loc.getBlock().setType(Material.OBSIDIAN); + + // Lag exploit check + for (Player p : getPastPlayers()) + { + Arena closest = _host.getArenaByMid(UtilAlg.findClosest(p.getLocation(), _host.getAllArenaMids())); + if (closest != _host.getPlayerArenas().get(p)) + p.teleport(UtilAlg.findClosest(p.getLocation(), getSpawns())); + } + } + }, 5L); } public boolean isOpenDoor() diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/Gladiators.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/Gladiators.java index b6080c5ad..b03240656 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/Gladiators.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/gladiators/Gladiators.java @@ -469,6 +469,11 @@ public class Gladiators extends SoloGame return mids; } + public HashMap getPlayerArenas() + { + return _playerArenas; + } + public ArrayList getAllArenaMids() { ArrayList mids = new ArrayList<>(); @@ -664,7 +669,7 @@ public class Gladiators extends SoloGame if (closest != _playerArenas.get(p)) { - if (closest.getColour().furtherOut(_playerArenas.get(p).getColour()) || (!_playerArenas.get(p).isOpenDoor())) + if (closest.getColour().furtherOut(_playerArenas.get(p).getColour())) { // No going backwards. Bounce baby bounce. if (Recharge.Instance.use(p, "Arena Bounce", 500, false, false)) @@ -676,6 +681,9 @@ public class Gladiators extends SoloGame return; } + if (!_playerArenas.get(p).isOpenDoor()) + return; + //p.sendMessage("ARENA MOVE CHECK METHOD!"); Manager.getPluginManager().callEvent(new PlayerChangeArenaEvent(e.getPlayer(), closest, _playerArenas.get(p))); _playerArenas.put(p, closest);