From 86b22cd0a1f42a43817927f5250b16be52935e2f Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sat, 24 Sep 2022 20:39:09 +0200 Subject: [PATCH] Adapt to CommonDB --- .../steamwar/bausystem/features/world/ClipboardListener.java | 5 +++-- .../de/steamwar/bausystem/features/world/StopCommand.java | 2 +- BauSystem_Main/src/de/steamwar/bausystem/region/Region.java | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/world/ClipboardListener.java b/BauSystem_Main/src/de/steamwar/bausystem/features/world/ClipboardListener.java index 3082b29e..03dd9a31 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/world/ClipboardListener.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/world/ClipboardListener.java @@ -21,6 +21,7 @@ package de.steamwar.bausystem.features.world; import de.steamwar.bausystem.linkage.LinkageType; import de.steamwar.bausystem.linkage.Linked; +import de.steamwar.sql.SchematicData; import de.steamwar.sql.SchematicNode; import de.steamwar.sql.SteamwarUser; import org.bukkit.event.EventHandler; @@ -38,7 +39,7 @@ public class ClipboardListener implements Listener { try { SchematicNode schematic = SchematicNode.getSchematicNode(SteamwarUser.get(e.getPlayer().getUniqueId()).getId(), CLIPBOARD_SCHEMNAME, 0); if (schematic != null) { - schematic.loadToPlayer(e.getPlayer()); + new SchematicData(schematic).loadToPlayer(e.getPlayer()); } } catch (Exception ex) { // ignore cause players do all kind of stuff with schematics.... like massively oversized schems @@ -55,7 +56,7 @@ public class ClipboardListener implements Listener { } try { - schematic.saveFromPlayer(e.getPlayer()); + new SchematicData(schematic).saveFromPlayer(e.getPlayer()); } catch (Exception ex) { if (newSchem) { schematic.delete(); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/world/StopCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/world/StopCommand.java index 6629e505..d9536619 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/world/StopCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/world/StopCommand.java @@ -54,7 +54,7 @@ public class StopCommand extends SWCommand { if (Permission.hasPermission(player, Permission.WORLD)) { return true; } - SteamwarUser steamwarUser = SteamwarUser.get(player); + SteamwarUser steamwarUser = SteamwarUser.get(player.getUniqueId()); if (steamwarUser.getUserGroup().isAdminGroup()) { return true; } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/region/Region.java b/BauSystem_Main/src/de/steamwar/bausystem/region/Region.java index cec37575..fef81fa4 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/region/Region.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/region/Region.java @@ -33,6 +33,7 @@ import de.steamwar.bausystem.region.utils.RegionType; import de.steamwar.bausystem.shared.SizedStack; import de.steamwar.bausystem.utils.FlatteningWrapper; import de.steamwar.core.Core; +import de.steamwar.sql.SchematicData; import de.steamwar.sql.SchematicNode; import lombok.AccessLevel; import lombok.Getter; @@ -457,7 +458,7 @@ public class Region { tempFile = prototype.getSkinMap().get(skin).getTestblockSchematicFile(); pastePoint = pastePoint.add(0, 0, prototype.getTestblock().getSizeZ() / 2); } else { - clipboard = schematic.load(); + clipboard = new SchematicData(schematic).load(); int dz = Math.abs(clipboard.getOrigin().getZ() - clipboard.getMinimumPoint().getZ()); if (dz < 2 || dz > prototype.getTestblock().getSizeZ()) { pastePoint = pastePoint.add(0, 0, prototype.getTestblock().getSizeZ() / 2); @@ -482,7 +483,7 @@ public class Region { EditSession editSession = null; if (schematic != null) { - editSession = paste(clipboard != null ? clipboard : schematic.load(), pastePoint, pasteOptions); + editSession = paste(clipboard != null ? clipboard : new SchematicData(schematic).load(), pastePoint, pasteOptions); } else { editSession = paste(tempFile, pastePoint, pasteOptions); }