SteamWar/SpigotCore
Archiviert
13
0

Adding schematic by id method

Dieser Commit ist enthalten in:
Lixfel 2020-04-30 15:43:58 +02:00
Ursprung 5534cfb6d9
Commit abd9815de9

Datei anzeigen

@ -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<Schematic> getSchemsAccessibleByUser(UUID schemOwner){
return getSchemsAccessibleByUser(SteamwarUser.get(schemOwner).getId());
}