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 ArenaState _state;
|
||||||
private long _stateTime;
|
private long _stateTime;
|
||||||
|
|
||||||
private boolean _alertedAlready;
|
private ArrayList<Player> _alreadyAlertedPleaseWait;
|
||||||
private boolean _alertedAlready2;
|
private boolean _alertedAlready2;
|
||||||
|
|
||||||
private HashMap<Player, ArrayList<ParticleData>> _particles;
|
private HashMap<Player, ArrayList<ParticleData>> _particles;
|
||||||
@ -62,7 +62,7 @@ public class Arena
|
|||||||
_stateTime = System.currentTimeMillis();
|
_stateTime = System.currentTimeMillis();
|
||||||
_particles = new HashMap<>();
|
_particles = new HashMap<>();
|
||||||
_doBye = false;
|
_doBye = false;
|
||||||
_alertedAlready = false;
|
_alreadyAlertedPleaseWait = new ArrayList<>();
|
||||||
_alertedAlready2 = false;
|
_alertedAlready2 = false;
|
||||||
|
|
||||||
setupSpawns();
|
setupSpawns();
|
||||||
@ -174,16 +174,6 @@ public class Arena
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isAlertedAlready()
|
|
||||||
{
|
|
||||||
return _alertedAlready;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setAlertedAlready(boolean alertedAlready)
|
|
||||||
{
|
|
||||||
_alertedAlready = alertedAlready;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setupSpawns()
|
private void setupSpawns()
|
||||||
{
|
{
|
||||||
ArrayList<Location> possible = (ArrayList<Location>) _host.WorldData.GetDataLocs("BLACK").clone();
|
ArrayList<Location> possible = (ArrayList<Location>) _host.WorldData.GetDataLocs("BLACK").clone();
|
||||||
@ -309,15 +299,15 @@ public class Arena
|
|||||||
if (_host.getRoundState() != RoundState.FIGHTING)
|
if (_host.getRoundState() != RoundState.FIGHTING)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (_alertedAlready)
|
|
||||||
return;
|
|
||||||
|
|
||||||
for (Player p : getPastPlayers())
|
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))
|
else if (_state.equals(ArenaState.FIGHTING))
|
||||||
{
|
{
|
||||||
@ -346,7 +336,7 @@ public class Arena
|
|||||||
if (_alertedAlready2)
|
if (_alertedAlready2)
|
||||||
continue;
|
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;
|
_alertedAlready2 = true;
|
||||||
|
@ -676,6 +676,7 @@ public class Gladiators extends SoloGame
|
|||||||
{
|
{
|
||||||
//p.sendMessage("bounce. closest = " + closest.toString() + " player arena = " + _playerArenas.get(p).toString());
|
//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);
|
UtilAction.velocity(p, UtilAlg.getTrajectory2d(e.getTo(), p.getLocation()), 1.7, true, 0.2, 0, 3, true);
|
||||||
|
sendPlayerArenaBounceCheck(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
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
|
@EventHandler
|
||||||
public void arenaChange(PlayerChangeArenaEvent e)
|
public void arenaChange(PlayerChangeArenaEvent e)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user