From 12ed389ae371076991c57dab3930e8018feba0f7 Mon Sep 17 00:00:00 2001 From: jojo Date: Wed, 20 Jan 2021 20:30:24 +0100 Subject: [PATCH] Add TNTSpawn naming --- .../steamwar/bausystem/cannonsimulator/TNTSimulator.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/cannonsimulator/TNTSimulator.java b/BauSystem_Main/src/de/steamwar/bausystem/cannonsimulator/TNTSimulator.java index 36c2a8e..e1aae1a 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/cannonsimulator/TNTSimulator.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/cannonsimulator/TNTSimulator.java @@ -103,7 +103,7 @@ public class TNTSimulator { static void editTNT(Player player, TNTSpawn tntSpawn) { TNTSimulator tntSimulator = get(player); - SWInventory swInventory = new SWInventory(player, 54, "TNT" + (tntSpawn.getName().isEmpty() ? "§8- §e" + tntSpawn.getName() : "")); + SWInventory swInventory = new SWInventory(player, 54, "TNT" + (!tntSpawn.getName().isEmpty() ? "§8- §e" + tntSpawn.getName() : "")); swInventory.setItem(49, new SWItem(Material.REDSTONE_BLOCK, "§cZurück", clickType -> { openSimulator(player); })); @@ -116,12 +116,12 @@ public class TNTSimulator { // tnt Name swInventory.setItem(45, new SWItem(Material.NAME_TAG, "§eName", clickType -> { - SWAnvilInv swAnvilInv = new SWAnvilInv(player, "Name"); - swAnvilInv.setCallback(s -> { + TNTSimulatorAnvil tntSimulatorAnvil = new TNTSimulatorAnvil(player, "Name", tntSpawn.getName()); + tntSimulatorAnvil.setCallback(s -> { tntSpawn.setName(s); editTNT(player, tntSpawn); }); - swAnvilInv.open(); + tntSimulatorAnvil.open(); })); // Change Count of spawned TNT