diff --git a/SpigotCore_Main/src/de/steamwar/sql/Schematic.java b/SpigotCore_Main/src/de/steamwar/sql/Schematic.java index 9053edf..00a2b6e 100644 --- a/SpigotCore_Main/src/de/steamwar/sql/Schematic.java +++ b/SpigotCore_Main/src/de/steamwar/sql/Schematic.java @@ -64,6 +64,17 @@ public class Schematic { } } + public static Schematic getSchemFromDB(int schemID){ + ResultSet schematic = SQL.select("SELECT SchemID, SchemName, SchemOwner, Item, SchemType, SchemFormat FROM Schematic WHERE SchemID = ?", schemID); + try { + if(!schematic.next()) + throw new SecurityException("Failed loading schematic " + schemID); + return new Schematic(schematic); + } catch (SQLException e) { + throw new SecurityException("Failed loading schematic", e); + } + } + public static List getSchemsAccessibleByUser(UUID schemOwner){ return getSchemsAccessibleByUser(SteamwarUser.get(schemOwner).getId()); }