From 38a4ca72a46f173e9aaffc42cfef91430e94bbf7 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Mon, 16 Dec 2019 20:07:57 +0100 Subject: [PATCH] Schemdownloadlink (untested) --- .../src/de/steamwar/schematicsystem/commands/GUI.java | 4 ++++ .../schematicsystem/commands/SchematicCommand.java | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/GUI.java b/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/GUI.java index c605b95..9d6ba9e 100644 --- a/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/GUI.java +++ b/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/GUI.java @@ -126,6 +126,10 @@ class GUI { p.closeInventory(); changeType(p, schem); }); + inv.setItem(5, SWItem.getMaterial(""), "§eDownload", click -> { + p.closeInventory(); + SchematicCommand.download(p, schem); + }); inv.setItem(6, SWItem.getMaterial("SKULL_ITEM"), "§eMitglieder", click -> { p.closeInventory(); delmembers(p, schem); diff --git a/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/SchematicCommand.java b/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/SchematicCommand.java index af2ed7c..7e00414 100644 --- a/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/SchematicCommand.java +++ b/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/SchematicCommand.java @@ -308,6 +308,15 @@ public class SchematicCommand implements CommandExecutor { } } + static void download(Player player, Schematic schematic){ + if(schematic.getSchemOwner() != SteamwarUser.get(player.getUniqueId()).getId()){ + player.sendMessage("§cDu darfst nur deine eigenen Schematics herunterladen!"); + return; + } + + player.sendMessage(DownloadSchematic.getLink(schematic)); + } + private void addmember(Player player, String[] args){ if(args.length < 3){ help(player);