From d7a786aad736adf04d7d0efddd9e92be80891180 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Thu, 24 Dec 2020 09:44:28 +0100 Subject: [PATCH] Classloader doesnt like multithreading... --- .../bausystem/world/ClipboardListener.java | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/world/ClipboardListener.java b/BauSystem_Main/src/de/steamwar/bausystem/world/ClipboardListener.java index 633bf28..f31f51a 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/world/ClipboardListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/world/ClipboardListener.java @@ -19,10 +19,8 @@ package de.steamwar.bausystem.world; -import de.steamwar.bausystem.BauSystem; import de.steamwar.sql.Schematic; import de.steamwar.sql.SchematicType; -import org.bukkit.Bukkit; import org.bukkit.event.EventHandler; import org.bukkit.event.Listener; import org.bukkit.event.player.PlayerJoinEvent; @@ -36,16 +34,14 @@ public class ClipboardListener implements Listener { @EventHandler public void onLogin(PlayerJoinEvent e){ - Bukkit.getScheduler().runTaskAsynchronously(BauSystem.getPlugin(), () -> { - try { - Schematic schematic = Schematic.getSchemFromDB(CLIPBOARD_SCHEMNAME, e.getPlayer().getUniqueId()); - if(schematic != null){ - schematic.loadToPlayer(e.getPlayer()); - } - } catch (Exception ex) { - //ignore cause players do all kind of stuff with schematics.... like massively oversized schems + try { + Schematic schematic = Schematic.getSchemFromDB(CLIPBOARD_SCHEMNAME, e.getPlayer().getUniqueId()); + if(schematic != null){ + schematic.loadToPlayer(e.getPlayer()); } - }); + } catch (Exception ex) { + //ignore cause players do all kind of stuff with schematics.... like massively oversized schems + } } @EventHandler -- 2.39.5