diff --git a/varo/src/main/java/de/cliffbreak/varo/managers/GameManager.java b/varo/src/main/java/de/cliffbreak/varo/managers/GameManager.java index 63f12d9..c3677cc 100644 --- a/varo/src/main/java/de/cliffbreak/varo/managers/GameManager.java +++ b/varo/src/main/java/de/cliffbreak/varo/managers/GameManager.java @@ -1,6 +1,7 @@ package de.cliffbreak.varo.managers; import org.bukkit.Bukkit; +import org.bukkit.GameMode; import org.bukkit.World; import org.bukkit.World.Environment; import org.bukkit.entity.Creeper; @@ -67,6 +68,7 @@ public class GameManager { player.setHealth(20.0d); player.setFoodLevel(20); player.setSaturation(5.0f); + player.setGameMode(GameMode.ADVENTURE); } new BukkitRunnable() { @@ -98,6 +100,9 @@ public class GameManager { for (World world : Bukkit.getWorlds()) { world.setPVP(false); } + for (Player player : Bukkit.getOnlinePlayers()) { + player.setGameMode(GameMode.SURVIVAL); + } } /** diff --git a/varo/src/main/java/de/cliffbreak/varo/utils/LangUtils.java b/varo/src/main/java/de/cliffbreak/varo/utils/LangUtils.java index 1236dcf..2f7d12c 100644 --- a/varo/src/main/java/de/cliffbreak/varo/utils/LangUtils.java +++ b/varo/src/main/java/de/cliffbreak/varo/utils/LangUtils.java @@ -24,7 +24,7 @@ public class LangUtils { this.config.addDefault("Service.BannedDead", "§4Du bist gestorben.\n \n§cDamit bist du aus §eVaro§c ausgeschieden."); this.config.addDefault("Service.Protection", - "§ aDie Schutzzeit ist in §2§l%minutes% Minuten§r§a vorbei. §r§7§o#staysafe"); + " §aDie Schutzzeit ist in §2§l%minutes% Minuten§r§a vorbei. §r§7§o#staysafe"); this.config.addDefault("Service.ProtectionOver", " §c§lAchtung: §r§aDie Schutzzeit ist§2§l JETZT§r§a vorbei. §r§7§o#staysafe"); this.config.addDefault("Error.NoPlayer", diff --git a/varo/src/main/java/de/cliffbreak/varo/utils/PlayerUtils.java b/varo/src/main/java/de/cliffbreak/varo/utils/PlayerUtils.java index 758165e..ed37395 100644 --- a/varo/src/main/java/de/cliffbreak/varo/utils/PlayerUtils.java +++ b/varo/src/main/java/de/cliffbreak/varo/utils/PlayerUtils.java @@ -14,6 +14,7 @@ import org.bukkit.scheduler.BukkitRunnable; import org.bukkit.scheduler.BukkitTask; import de.cliffbreak.varo.Varo; +import de.cliffbreak.varo.enums.GameState; public class PlayerUtils { private final Varo plugin; @@ -79,7 +80,11 @@ public class PlayerUtils { hidePlayersTask.cancel(); plugin.getNPCManager().removeClone(p.getUniqueId()); p.teleport(plugin.getPlayerCache().getPlayerLocationCache(p.getUniqueId().toString().replace("-", ""))); - p.setGameMode(GameMode.SURVIVAL); + if (plugin.getGameManager().getGameState().equals(GameState.PRESTART)) { + p.setGameMode(GameMode.ADVENTURE); + } else { + p.setGameMode(GameMode.SURVIVAL); + } p.setFlySpeed(0.1f); p.setFlying(false); new BukkitRunnable() {