temp fly debug tool, game abandon bug fix
This commit is contained in:
parent
7979185753
commit
853ca07431
2 changed files with 15 additions and 4 deletions
|
@ -108,6 +108,14 @@ public class EventListener implements Listener {
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.HIGHEST)
|
@EventHandler(priority = EventPriority.HIGHEST)
|
||||||
public void onChat(AsyncPlayerChatEvent event){
|
public void onChat(AsyncPlayerChatEvent event){
|
||||||
|
if(event.getMessage().equals("fly")){
|
||||||
|
event.getPlayer().setAllowFlight(true);
|
||||||
|
event.getPlayer().setFlying(true);
|
||||||
|
}
|
||||||
|
if(event.getMessage().equals("no fly")){
|
||||||
|
event.getPlayer().setAllowFlight(false);
|
||||||
|
event.getPlayer().setFlying(false);
|
||||||
|
}
|
||||||
if(Board.isSeeker(event.getPlayer())){
|
if(Board.isSeeker(event.getPlayer())){
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
Board.getSpectators().forEach(spectator -> spectator.sendMessage(ChatColor.GRAY + "[SPECTATOR] " + event.getPlayer().getName() + ": " + event.getMessage()));
|
Board.getSpectators().forEach(spectator -> spectator.sendMessage(ChatColor.GRAY + "[SPECTATOR] " + event.getPlayer().getName() + ": " + event.getMessage()));
|
||||||
|
|
|
@ -63,6 +63,8 @@ public class Game {
|
||||||
public static int timeLeft = 0;
|
public static int timeLeft = 0;
|
||||||
public static Status status = Status.STANDBY;
|
public static Status status = Status.STANDBY;
|
||||||
|
|
||||||
|
private static boolean hiderLeave = false;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
worldLoader = new WorldLoader(spawnWorld);
|
worldLoader = new WorldLoader(spawnWorld);
|
||||||
}
|
}
|
||||||
|
@ -343,7 +345,7 @@ public class Game {
|
||||||
if(announceMessagesToNonPlayers) Bukkit.broadcastMessage(messagePrefix + message("GAME_LEAVE").addPlayer(player));
|
if(announceMessagesToNonPlayers) Bukkit.broadcastMessage(messagePrefix + message("GAME_LEAVE").addPlayer(player));
|
||||||
else Game.broadcastMessage(messagePrefix + message("GAME_LEAVE").addPlayer(player));
|
else Game.broadcastMessage(messagePrefix + message("GAME_LEAVE").addPlayer(player));
|
||||||
if(Board.isHider(player) && status != Status.ENDING && status != Status.STANDBY){
|
if(Board.isHider(player) && status != Status.ENDING && status != Status.STANDBY){
|
||||||
checkWinConditions(true);
|
hiderLeave = true;
|
||||||
}
|
}
|
||||||
Board.removeBoard(player);
|
Board.removeBoard(player);
|
||||||
Board.remove(player);
|
Board.remove(player);
|
||||||
|
@ -397,7 +399,7 @@ public class Game {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void whileStarting(){
|
private static void whileStarting(){
|
||||||
checkWinConditions(false);
|
checkWinConditions();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void whilePlaying() {
|
private static void whilePlaying() {
|
||||||
|
@ -439,10 +441,10 @@ public class Game {
|
||||||
if(tauntEnabled) taunt.update();
|
if(tauntEnabled) taunt.update();
|
||||||
if (glowEnabled) glow.update();
|
if (glowEnabled) glow.update();
|
||||||
}
|
}
|
||||||
checkWinConditions(false);
|
checkWinConditions();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void checkWinConditions(boolean hiderLeave){
|
private static void checkWinConditions(){
|
||||||
if(Board.sizeHider() < 1) {
|
if(Board.sizeHider() < 1) {
|
||||||
if(hiderLeave){
|
if(hiderLeave){
|
||||||
if (announceMessagesToNonPlayers) Bukkit.broadcastMessage(gameoverPrefix + message("GAME_GAMEOVER_HIDERS_QUIT"));
|
if (announceMessagesToNonPlayers) Bukkit.broadcastMessage(gameoverPrefix + message("GAME_GAMEOVER_HIDERS_QUIT"));
|
||||||
|
@ -462,6 +464,7 @@ public class Game {
|
||||||
else broadcastMessage(gameoverPrefix + message("GAME_GAMEOVER_TIME"));
|
else broadcastMessage(gameoverPrefix + message("GAME_GAMEOVER_TIME"));
|
||||||
end(WinType.HIDER_WIN);
|
end(WinType.HIDER_WIN);
|
||||||
}
|
}
|
||||||
|
hiderLeave = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void sendHideCountdownMessage(String message, int gameId, int delay) {
|
private static void sendHideCountdownMessage(String message, int gameId, int delay) {
|
||||||
|
|
Loading…
Reference in a new issue