From 31629db6920bc8dfa61a7dc7d59a47b7b6e2e358 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Tue, 12 May 2020 09:10:24 +0200 Subject: [PATCH] Implementing rank system --- SpigotCore_Main/src/de/steamwar/sql/Schematic.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/SpigotCore_Main/src/de/steamwar/sql/Schematic.java b/SpigotCore_Main/src/de/steamwar/sql/Schematic.java index 00a2b6e..fc40e7f 100644 --- a/SpigotCore_Main/src/de/steamwar/sql/Schematic.java +++ b/SpigotCore_Main/src/de/steamwar/sql/Schematic.java @@ -20,6 +20,7 @@ public class Schematic { private final int schemOwner; private boolean schemFormat; private String item; + private int rank; private SchematicType schemType; private Schematic(ResultSet rs) throws SQLException { @@ -27,6 +28,7 @@ public class Schematic { this.schemName = rs.getString("SchemName"); this.schemOwner = rs.getInt("SchemOwner"); this.item = rs.getString("Item"); + this.rank = rs.getInt("Rank"); this.schemType = SchematicType.fromDB(rs.getString("SchemType")); this.schemFormat = rs.getBoolean("SchemFormat"); } @@ -134,6 +136,10 @@ public class Schematic { return schemOwner; } + public int getRank(){ + return rank; + } + public String getItem() { return item; } @@ -143,6 +149,11 @@ public class Schematic { updateDB(); } + public void setRank(int rank){ + this.rank = rank; + SQL.update("UPDATE Schematic SET Rank = ? WHERE SchemID = ?", rank, schemID); + } + public SchematicType getSchemType() { return schemType; }