From 5945f3c14830125fd5e3274b006cb87b1c614335 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Mon, 24 May 2021 08:36:25 +0200 Subject: [PATCH 1/2] Fix prepare recoloring Signed-off-by: Lixfel --- .../de/steamwar/fightsystem/fight/FightSchematic.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/fight/FightSchematic.java b/FightSystem_Main/src/de/steamwar/fightsystem/fight/FightSchematic.java index fb63943..4e5790d 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/fight/FightSchematic.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/fight/FightSchematic.java @@ -118,7 +118,7 @@ public class FightSchematic extends StateDependent { private void paste(){ FreezeWorld freezer = new FreezeWorld(); - DyeColor c = ColorConverter.chat2dye(team.getColor()); + DyeColor c = ArenaMode.AntiPrepare.contains(Config.mode) ? ColorConverter.chat2dye(team.getColor()) : DyeColor.PINK; try { VersionedRunnable.call(new VersionedRunnable(() -> { @@ -126,25 +126,25 @@ public class FightSchematic extends StateDependent { FightTeam_8.replaceTeamColor(clipboard, c); FightTeam_8.pasteSchematic(clipboard, region, rotate); } catch (NoClipboardException | WorldEditException ex) { - throw new SecurityException("Error pasting arena in schematic", ex); + throw new SecurityException("Error pasting schematic", ex); } }, 8), new VersionedRunnable(() -> { try { FightTeam_12.replaceTeamColor(clipboard, c); FightTeam_8.pasteSchematic(clipboard, region, rotate); } catch (NoClipboardException | WorldEditException ex) { - throw new SecurityException("Error pasting arena in schematic", ex); + throw new SecurityException("Error pasting schematic", ex); } }, 12), new VersionedRunnable(() -> { try { FightTeam_14.replaceTeamColor(clipboard, c); FightTeam_14.pasteSchematic(clipboard, region, rotate); } catch (NoClipboardException | WorldEditException ex) { - throw new SecurityException("Error pasting arena in schematic", ex); + throw new SecurityException("Error pasting schematic", ex); } }, 14)); } catch (SecurityException securityException) { - team.broadcast(FightSystem.PREFIX + "§cFehler beim Pasten der Schematic"); + FightSystem.shutdown(FightSystem.PREFIX + "§cFehler beim Pasten der Schematic"); throw securityException; } From 3b2857d60d806b59007e7710ccbb658285054779 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Mon, 24 May 2021 09:47:32 +0200 Subject: [PATCH 2/2] Set to preschemstate Signed-off-by: Lixfel --- .../src/de/steamwar/fightsystem/fight/FightSchematic.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/FightSystem_Main/src/de/steamwar/fightsystem/fight/FightSchematic.java b/FightSystem_Main/src/de/steamwar/fightsystem/fight/FightSchematic.java index 4e5790d..172a8b7 100644 --- a/FightSystem_Main/src/de/steamwar/fightsystem/fight/FightSchematic.java +++ b/FightSystem_Main/src/de/steamwar/fightsystem/fight/FightSchematic.java @@ -144,7 +144,8 @@ public class FightSchematic extends StateDependent { } }, 14)); } catch (SecurityException securityException) { - FightSystem.shutdown(FightSystem.PREFIX + "§cFehler beim Pasten der Schematic"); + Bukkit.broadcastMessage(FightSystem.PREFIX + "§cFehler beim Pasten der Schematic"); + Bukkit.getScheduler().runTask(FightSystem.getPlugin(), FightSystem::setPreSchemState); throw securityException; }