From f5c34db39e74535145c54c1e1cc2996f2b50c124 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sun, 6 Sep 2020 21:05:39 +0200 Subject: [PATCH] Refactor for "better" error handling --- .../de/steamwar/bausystem/world/ClipboardListener.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/world/ClipboardListener.java b/BauSystem_Main/src/de/steamwar/bausystem/world/ClipboardListener.java index b587d40..f31f51a 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/world/ClipboardListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/world/ClipboardListener.java @@ -34,13 +34,13 @@ public class ClipboardListener implements Listener { @EventHandler public void onLogin(PlayerJoinEvent e){ - Schematic schematic = Schematic.getSchemFromDB(CLIPBOARD_SCHEMNAME, e.getPlayer().getUniqueId()); - if(schematic != null){ - try { + try { + Schematic schematic = Schematic.getSchemFromDB(CLIPBOARD_SCHEMNAME, e.getPlayer().getUniqueId()); + if(schematic != null){ schematic.loadToPlayer(e.getPlayer()); - } catch (Exception ex) { - //ignore } + } catch (Exception ex) { + //ignore cause players do all kind of stuff with schematics.... like massively oversized schems } }