diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/fight/FightTeam.java b/FightSystem_Main/src/de/steamwar/fightsystem/fight/FightTeam.java index 22e7a21..fde3dbf 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/fight/FightTeam.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/fight/FightTeam.java @@ -228,8 +228,15 @@ public class FightTeam implements IFightTeam{ return ready; } + private void allowFlying(boolean fly){ + for(FightPlayer p : players) + if(p.getPlayer() != null) + p.getPlayer().setAllowFlight(fly); + } + public void pasteSchematic(){ FreezeWorld freezer = new FreezeWorld(); + allowFlying(true); DyeColor c = ColorConverter.chat2dye(color); EditSession e; try { @@ -266,6 +273,7 @@ public class FightTeam implements IFightTeam{ broadcast(FightSystem.PREFIX + "§cFehler beim Pasten der Schematic"); throw new SecurityException("Error pasting arena in schematic", ex); } + allowFlying(false); Bukkit.getScheduler().runTaskLater(FightSystem.getPlugin(), () -> HandlerList.unregisterAll(freezer), 3); Bukkit.getScheduler().runTaskLater(FightSystem.getPlugin(), this::teleportToSpawn,40); }