Another door bug, and a title fix.
This commit is contained in:
parent
e31124e212
commit
d91e4ab4f7
@ -42,7 +42,7 @@ public class Arena
|
||||
private ArenaState _state;
|
||||
private long _stateTime;
|
||||
|
||||
private boolean _alertedAlready;
|
||||
private ArrayList<Player> _alreadyAlertedPleaseWait;
|
||||
private boolean _alertedAlready2;
|
||||
|
||||
private HashMap<Player, ArrayList<ParticleData>> _particles;
|
||||
@ -62,7 +62,7 @@ public class Arena
|
||||
_stateTime = System.currentTimeMillis();
|
||||
_particles = new HashMap<>();
|
||||
_doBye = false;
|
||||
_alertedAlready = false;
|
||||
_alreadyAlertedPleaseWait = new ArrayList<>();
|
||||
_alertedAlready2 = false;
|
||||
|
||||
setupSpawns();
|
||||
@ -174,16 +174,6 @@ public class Arena
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isAlertedAlready()
|
||||
{
|
||||
return _alertedAlready;
|
||||
}
|
||||
|
||||
public void setAlertedAlready(boolean alertedAlready)
|
||||
{
|
||||
_alertedAlready = alertedAlready;
|
||||
}
|
||||
|
||||
private void setupSpawns()
|
||||
{
|
||||
ArrayList<Location> possible = (ArrayList<Location>) _host.WorldData.GetDataLocs("BLACK").clone();
|
||||
@ -309,15 +299,15 @@ public class Arena
|
||||
if (_host.getRoundState() != RoundState.FIGHTING)
|
||||
return;
|
||||
|
||||
if (_alertedAlready)
|
||||
return;
|
||||
|
||||
for (Player p : getPastPlayers())
|
||||
{
|
||||
UtilTextMiddle.display(C.cAqua + "Please Wait", "The next round will start shortly", 0, 20 * 100, 0, p);
|
||||
}
|
||||
if (_alreadyAlertedPleaseWait.contains(p))
|
||||
continue;
|
||||
|
||||
_alertedAlready = true;
|
||||
UtilTextMiddle.display(C.cAqua + "Please Wait", "The next round will start shortly", 0, 20 * 120, 0, p); // 2 min
|
||||
|
||||
_alreadyAlertedPleaseWait.add(p);
|
||||
}
|
||||
}
|
||||
else if (_state.equals(ArenaState.FIGHTING))
|
||||
{
|
||||
@ -346,7 +336,7 @@ public class Arena
|
||||
if (_alertedAlready2)
|
||||
continue;
|
||||
|
||||
UtilTextMiddle.display(C.cGreen + "Next Battle", "Follow the particles", 0, 20 * 100, 0, p);
|
||||
UtilTextMiddle.display(C.cGreen + "Next Battle", "Follow the particles", 0, 20 * 120, 0, p); // 2 min
|
||||
}
|
||||
|
||||
_alertedAlready2 = true;
|
||||
|
@ -676,6 +676,7 @@ public class Gladiators extends SoloGame
|
||||
{
|
||||
//p.sendMessage("bounce. closest = " + closest.toString() + " player arena = " + _playerArenas.get(p).toString());
|
||||
UtilAction.velocity(p, UtilAlg.getTrajectory2d(e.getTo(), p.getLocation()), 1.7, true, 0.2, 0, 3, true);
|
||||
sendPlayerArenaBounceCheck(p);
|
||||
}
|
||||
|
||||
return;
|
||||
@ -693,6 +694,25 @@ public class Gladiators extends SoloGame
|
||||
}
|
||||
}
|
||||
|
||||
private void sendPlayerArenaBounceCheck(final Player p)
|
||||
{
|
||||
Manager.getScheduler().scheduleSyncDelayedTask(Manager.getPlugin(), new Runnable()
|
||||
{
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
if (!GetPlayers(true).contains(p))
|
||||
return;
|
||||
|
||||
Arena closest = getArenaByMid(UtilAlg.findClosest(p.getLocation(), getAllArenaMids()));
|
||||
if (closest != _playerArenas.get(p))
|
||||
{
|
||||
p.teleport(UtilAlg.findClosest(p.getLocation(), _playerArenas.get(p).getSpawns()));
|
||||
}
|
||||
}
|
||||
}, 20L);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void arenaChange(PlayerChangeArenaEvent e)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user