SteamWar/BauSystem
Archiviert
13
0

Merge pull request 'Improve join performance' (#143) from asyncClipboardLoading into master

Reviewed-by: YoyoNow <jwsteam@nidido.de>
Dieser Commit ist enthalten in:
YoyoNow 2020-12-21 11:41:05 +01:00
Commit f2acd26835

Datei anzeigen

@ -19,8 +19,10 @@
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;
@ -34,6 +36,7 @@ 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){
@ -42,6 +45,7 @@ public class ClipboardListener implements Listener {
} catch (Exception ex) {
//ignore cause players do all kind of stuff with schematics.... like massively oversized schems
}
});
}
@EventHandler