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"));
heartbeatSound = heartbeatOptional.orElse(XSound.BLOCK_NOTE_BLOCK_BASEDRUM);
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
nametagsVisible = config.getBoolean("nametagsVisible");

View file

@ -67,8 +67,8 @@ public class EventListener implements Listener {
event.getPlayer().setGameMode(GameMode.ADVENTURE);
}
} else {
if (event.getPlayer().getWorld().getName().equals(Game.getGameWorld())) {
if(Game.status != Status.STANDBY){
if (mapSaveEnabled && event.getPlayer().getWorld().getName().equals(Game.getGameWorld())) {
if(Game.status != Status.STANDBY && Game.status != Status.ENDING){
Game.join(event.getPlayer());
} else {
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(mapSaveEnabled && worldLoader.getWorld() != null) {
worldLoader.rollback();
} else {
} else if(mapSaveEnabled) {
worldLoader.loadMap();
}
Board.reload();
@ -302,6 +302,9 @@ public class Game {
Board.addHider(player);
if(announceMessagesToNonPlayers) Bukkit.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);
Board.createLobbyBoard(player);
Board.reloadLobbyBoards();
@ -348,6 +351,9 @@ public class Game {
Board.reloadGameBoards();
Board.reloadBoardTeams();
}
for(PotionEffect effect : player.getActivePotionEffects()){
player.removePotionEffect(effect.getType());
}
if(bungeeLeave) {
ByteArrayDataOutput out = ByteStreams.newDataOutput();
out.writeUTF("Connect");