From 3fadc8156b06ea62228400612312f894cfb8737d Mon Sep 17 00:00:00 2001 From: Lixfel Date: Thu, 1 Apr 2021 20:33:30 +0200 Subject: [PATCH 1/2] Implementing schematic preparation Signed-off-by: Lixfel --- .../commands/SchematicCommand.java | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/SchematicCommand.java b/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/SchematicCommand.java index ff7241c..d473eac 100644 --- a/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/SchematicCommand.java +++ b/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/SchematicCommand.java @@ -19,6 +19,9 @@ package de.steamwar.schematicsystem.commands; +import de.steamwar.comms.packets.PrepareSchemPacket; +import de.steamwar.inventory.SWInventory; +import de.steamwar.inventory.SWItem; import de.steamwar.schematicsystem.AutoCheckResult; import de.steamwar.schematicsystem.CheckSchemType; import de.steamwar.schematicsystem.SchematicSystem; @@ -288,8 +291,19 @@ public class SchematicCommand implements CommandExecutor { return; } - schematic.setSchemType(type.checkType()); - player.sendMessage(SchematicSystem.PREFIX + "§aDie Schematic wird zeitnah überprüft"); + SWInventory inv = new SWInventory(player, 9, "Schematic ausfahren"); + inv.setItem(0, SWItem.getDye(10), (byte)10, "§eSchematic ausfahren", click -> { + new PrepareSchemPacket(SteamwarUser.get(player.getUniqueId()), schematic, type); + player.sendMessage(SchematicSystem.PREFIX + "§aDer Vorbereitungsserver wird gestartet"); + player.closeInventory(); + }); + inv.setItem(8, SWItem.getDye(7), (byte)7, "§eDirekt einsenden", click -> { + schematic.setSchemType(type.checkType()); + player.sendMessage(SchematicSystem.PREFIX + "§aDie Schematic wird zeitnah überprüft"); + player.closeInventory(); + }); + inv.setCallback(-999, click -> player.closeInventory()); + inv.open(); } } -- 2.39.2 From eca811f3a4b5346731cba22ab6e43664d654a3db Mon Sep 17 00:00:00 2001 From: Lixfel Date: Thu, 1 Apr 2021 20:48:48 +0200 Subject: [PATCH 2/2] Fix bugs Signed-off-by: Lixfel --- .../src/de/steamwar/schematicsystem/commands/GUI.java | 1 - .../de/steamwar/schematicsystem/commands/SchematicCommand.java | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/GUI.java b/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/GUI.java index d14f7ea..6533cfb 100644 --- a/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/GUI.java +++ b/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/GUI.java @@ -50,7 +50,6 @@ class GUI { SWListInv inv = new SWListInv<>(p, "Typ ändern", types, (clickType, schematicType) -> { SchematicCommand.changetype(p, schem, schematicType); - p.closeInventory(); }); inv.setCallback(-999, (ClickType click) -> p.closeInventory()); inv.open(); diff --git a/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/SchematicCommand.java b/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/SchematicCommand.java index d473eac..1760e60 100644 --- a/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/SchematicCommand.java +++ b/SchematicSystem_Main/src/de/steamwar/schematicsystem/commands/SchematicCommand.java @@ -293,7 +293,7 @@ public class SchematicCommand implements CommandExecutor { SWInventory inv = new SWInventory(player, 9, "Schematic ausfahren"); inv.setItem(0, SWItem.getDye(10), (byte)10, "§eSchematic ausfahren", click -> { - new PrepareSchemPacket(SteamwarUser.get(player.getUniqueId()), schematic, type); + new PrepareSchemPacket(SteamwarUser.get(player.getUniqueId()), schematic, type).send(player); player.sendMessage(SchematicSystem.PREFIX + "§aDer Vorbereitungsserver wird gestartet"); player.closeInventory(); }); -- 2.39.2