dont load mapsave if its disabled, fixed seeker join effects

This commit is contained in:
Tyler Murphy 2022-05-11 11:31:43 -04:00
parent 77675c7ece
commit 068e1f406a
3 changed files with 10 additions and 4 deletions

View file

@ -247,7 +247,7 @@ public class Config {
Optional<XSound> heartbeatOptional = XSound.matchXSound(config.getString("seekerPing.sounds.heartbeatNoise")); Optional<XSound> heartbeatOptional = XSound.matchXSound(config.getString("seekerPing.sounds.heartbeatNoise"));
heartbeatSound = heartbeatOptional.orElse(XSound.BLOCK_NOTE_BLOCK_BASEDRUM); heartbeatSound = heartbeatOptional.orElse(XSound.BLOCK_NOTE_BLOCK_BASEDRUM);
Optional<XSound> ringingOptional = XSound.matchXSound(config.getString("seekerPing.sounds.ringingNoise")); Optional<XSound> ringingOptional = XSound.matchXSound(config.getString("seekerPing.sounds.ringingNoise"));
ringingSound = heartbeatOptional.orElse(XSound.BLOCK_NOTE_BLOCK_PLING); ringingSound = ringingOptional.orElse(XSound.BLOCK_NOTE_BLOCK_PLING);
//Other //Other
nametagsVisible = config.getBoolean("nametagsVisible"); nametagsVisible = config.getBoolean("nametagsVisible");

View file

@ -67,8 +67,8 @@ public class EventListener implements Listener {
event.getPlayer().setGameMode(GameMode.ADVENTURE); event.getPlayer().setGameMode(GameMode.ADVENTURE);
} }
} else { } else {
if (event.getPlayer().getWorld().getName().equals(Game.getGameWorld())) { if (mapSaveEnabled && event.getPlayer().getWorld().getName().equals(Game.getGameWorld())) {
if(Game.status != Status.STANDBY){ if(Game.status != Status.STANDBY && Game.status != Status.ENDING){
Game.join(event.getPlayer()); Game.join(event.getPlayer());
} else { } else {
event.getPlayer().teleport(new Location(Bukkit.getWorld(exitWorld), exitPosition.getX(), exitPosition.getY(), exitPosition.getZ())); event.getPlayer().teleport(new Location(Bukkit.getWorld(exitWorld), exitPosition.getX(), exitPosition.getY(), exitPosition.getZ()));

View file

@ -91,7 +91,7 @@ public class Game {
if(status == Status.STARTING || status == Status.PLAYING) return; if(status == Status.STARTING || status == Status.PLAYING) return;
if(mapSaveEnabled && worldLoader.getWorld() != null) { if(mapSaveEnabled && worldLoader.getWorld() != null) {
worldLoader.rollback(); worldLoader.rollback();
} else { } else if(mapSaveEnabled) {
worldLoader.loadMap(); worldLoader.loadMap();
} }
Board.reload(); Board.reload();
@ -302,6 +302,9 @@ public class Game {
Board.addHider(player); Board.addHider(player);
if(announceMessagesToNonPlayers) Bukkit.broadcastMessage(messagePrefix + message("GAME_JOIN").addPlayer(player)); if(announceMessagesToNonPlayers) Bukkit.broadcastMessage(messagePrefix + message("GAME_JOIN").addPlayer(player));
else Game.broadcastMessage(messagePrefix + message("GAME_JOIN").addPlayer(player)); else Game.broadcastMessage(messagePrefix + message("GAME_JOIN").addPlayer(player));
for(PotionEffect effect : player.getActivePotionEffects()){
player.removePotionEffect(effect.getType());
}
player.setGameMode(GameMode.ADVENTURE); player.setGameMode(GameMode.ADVENTURE);
Board.createLobbyBoard(player); Board.createLobbyBoard(player);
Board.reloadLobbyBoards(); Board.reloadLobbyBoards();
@ -348,6 +351,9 @@ public class Game {
Board.reloadGameBoards(); Board.reloadGameBoards();
Board.reloadBoardTeams(); Board.reloadBoardTeams();
} }
for(PotionEffect effect : player.getActivePotionEffects()){
player.removePotionEffect(effect.getType());
}
if(bungeeLeave) { if(bungeeLeave) {
ByteArrayDataOutput out = ByteStreams.newDataOutput(); ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("Connect"); out.writeUTF("Connect");