SteamWar/FightSystem
Archiviert
13
1

Fix try/catch in FightTeam.pasteSchematic

Dieser Commit ist enthalten in:
jojo 2021-01-04 22:26:29 +01:00
Ursprung 623ee6c75a
Commit 042449e591

Datei anzeigen

@ -279,23 +279,31 @@ public class FightTeam implements IFightTeam{
try { try {
VersionedRunnable.call(new VersionedRunnable(() -> { VersionedRunnable.call(new VersionedRunnable(() -> {
try {
EditSession e = FightTeam_8.pasteSchematic(schem, pasteX, pasteY, pasteZ, rotate); EditSession e = FightTeam_8.pasteSchematic(schem, pasteX, pasteY, pasteZ, rotate);
FightTeam_8.replaceTeamColor(e, c, cornerX, cornerY, cornerZ); FightTeam_8.replaceTeamColor(e, c, cornerX, cornerY, cornerZ);
} catch (Schematic.WrongVersionException | IOException | NoClipboardException ex) {
throw new SecurityException("Error pasting arena in schematic", ex);
}
}, 8), new VersionedRunnable(() -> { }, 8), new VersionedRunnable(() -> {
try {
EditSession e = FightTeam_8.pasteSchematic(schem, pasteX, pasteY, pasteZ, rotate); EditSession e = FightTeam_8.pasteSchematic(schem, pasteX, pasteY, pasteZ, rotate);
FightTeam_12.replaceTeamColor(e, c, cornerX, cornerY, cornerZ); FightTeam_12.replaceTeamColor(e, c, cornerX, cornerY, cornerZ);
} catch (Schematic.WrongVersionException | IOException | NoClipboardException ex) {
throw new SecurityException("Error pasting arena in schematic", ex);
}
}, 12), new VersionedRunnable(() -> { }, 12), new VersionedRunnable(() -> {
try {
EditSession e = FightTeam_14.pasteSchematic(schem, pasteX, pasteY, pasteZ, rotate); EditSession e = FightTeam_14.pasteSchematic(schem, pasteX, pasteY, pasteZ, rotate);
FightTeam_14.replaceTeamColor(e, c, cornerX, cornerY, cornerZ); FightTeam_14.replaceTeamColor(e, c, cornerX, cornerY, cornerZ);
}, 14)); } catch (Schematic.WrongVersionException | IOException | NoClipboardException ex) {
} catch (Schematic.WrongVersionException ex) {
broadcast(FightSystem.PREFIX + "§cDie gewählte Schematic kann nicht in dieser Version geladen werden");
HandlerList.unregisterAll(freezer);
return;
} catch (IOException | NoClipboardException ex) {
broadcast(FightSystem.PREFIX + "§cFehler beim Pasten der Schematic");
throw new SecurityException("Error pasting arena in schematic", ex); throw new SecurityException("Error pasting arena in schematic", ex);
} }
}, 14));
} catch (SecurityException securityException) {
broadcast(FightSystem.PREFIX + "§cFehler beim Pasten der Schematic");
throw securityException;
}
Bukkit.getScheduler().runTaskLater(FightSystem.getPlugin(), () -> HandlerList.unregisterAll(freezer), 3); Bukkit.getScheduler().runTaskLater(FightSystem.getPlugin(), () -> HandlerList.unregisterAll(freezer), 3);
Bukkit.getScheduler().runTaskLater(FightSystem.getPlugin(), this::teleportToSpawn,40); Bukkit.getScheduler().runTaskLater(FightSystem.getPlugin(), this::teleportToSpawn,40);
} }