From 4b4d5f92bfed64624a13cdc73391b1cf88747caf Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sat, 30 Jan 2021 00:22:27 +0100 Subject: [PATCH] Add Schematic Translation Layer --- SpigotCore_Main/src/de/steamwar/sql/CheckedSchematic.java | 8 ++++++++ .../src/de/steamwar/sql/DownloadSchematic.java | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/SpigotCore_Main/src/de/steamwar/sql/CheckedSchematic.java b/SpigotCore_Main/src/de/steamwar/sql/CheckedSchematic.java index 7bbd963..741f637 100644 --- a/SpigotCore_Main/src/de/steamwar/sql/CheckedSchematic.java +++ b/SpigotCore_Main/src/de/steamwar/sql/CheckedSchematic.java @@ -106,4 +106,12 @@ public class CheckedSchematic { public int getNode() { return node; } + + public String getSchemName() { + return SchematicNode.getSchematicNode(node).getName(); + } + + public int getSchemOwner() { + return SchematicNode.getSchematicNode(node).getId(); + } } diff --git a/SpigotCore_Main/src/de/steamwar/sql/DownloadSchematic.java b/SpigotCore_Main/src/de/steamwar/sql/DownloadSchematic.java index e941b8d..0bda812 100644 --- a/SpigotCore_Main/src/de/steamwar/sql/DownloadSchematic.java +++ b/SpigotCore_Main/src/de/steamwar/sql/DownloadSchematic.java @@ -45,4 +45,8 @@ public class DownloadSchematic { SQL.update("INSERT INTO SchemDownload (SchemID, Link) VALUES (?, ?) ON DUPLICATE KEY UPDATE Link = VALUES(Link)", schem.getId(), hash); return BASE + hash; } + + public static String getLink(Schematic schematic) { + return getLink(SchematicNode.getSchematicNode(schematic.getSchemID())); + } }