From d36700e663d5a54690002b5a8c0f4245237c6cc3 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sat, 6 Feb 2021 01:47:25 +0100 Subject: [PATCH] Fix Debugstick in 1.12 and some more things --- .../de/steamwar/bausystem/commands/CommandDebugStick_15.java | 4 ++-- .../src/de/steamwar/bausystem/commands/CommandDetonator.java | 2 +- .../src/de/steamwar/bausystem/commands/CommandGUI.java | 3 ++- .../src/de/steamwar/bausystem/commands/CommandSkull.java | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/BauSystem_15/src/de/steamwar/bausystem/commands/CommandDebugStick_15.java b/BauSystem_15/src/de/steamwar/bausystem/commands/CommandDebugStick_15.java index abbfc71..88e5b3b 100644 --- a/BauSystem_15/src/de/steamwar/bausystem/commands/CommandDebugStick_15.java +++ b/BauSystem_15/src/de/steamwar/bausystem/commands/CommandDebugStick_15.java @@ -28,8 +28,8 @@ class CommandDebugStick_15 { static void giveStick(Player player){ if(player.getInventory().getItemInMainHand().getType() == Material.AIR) - player.getInventory().setItemInMainHand(new ItemStack(Material.DEBUG_STICK, 1)); + player.getInventory().setItemInMainHand(new ItemStack(Material.DEBUG_STICK)); else - player.getInventory().setItemInOffHand(new ItemStack(Material.DEBUG_STICK, 1)); + player.getInventory().addItem(new ItemStack(Material.DEBUG_STICK)); } } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandDetonator.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandDetonator.java index c45f3a0..4446023 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandDetonator.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandDetonator.java @@ -66,7 +66,7 @@ public class CommandDetonator implements CommandExecutor { if(player.getInventory().getItemInMainHand().getType() == Material.AIR) player.getInventory().setItemInMainHand(Detonator.WAND); else - player.getInventory().setItemInOffHand(Detonator.WAND); + player.getInventory().addItem(Detonator.WAND); player.updateInventory(); Detonator.getDetonator(player); break; diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandGUI.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandGUI.java index b2a78a6..23ff0f4 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandGUI.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandGUI.java @@ -5,6 +5,7 @@ import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.tracer.record.RecordStateMachine; import de.steamwar.bausystem.tracer.show.TraceShowManager; import de.steamwar.bausystem.world.*; +import de.steamwar.core.Core; import de.steamwar.inventory.SWAnvilInv; import de.steamwar.inventory.SWInventory; import de.steamwar.inventory.SWItem; @@ -84,7 +85,7 @@ public class CommandGUI implements CommandExecutor, Listener { player.closeInventory(); player.performCommand("/wand"); }); - inv.setItem(41, Material.DEBUG_STICK, "§7Debugstick", Arrays.asList("§8/§7debugstick"), false, clickType -> { + inv.setItem(41, getMaterial("DEBUG_STICK", "STICK"), "§7Debugstick", Arrays.asList("§8/§7debugstick"), Core.getVersion() < 13,clickType -> { player.closeInventory(); player.performCommand("debugstick"); }); diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandSkull.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandSkull.java index ed0f820..4a4cbf4 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandSkull.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandSkull.java @@ -50,7 +50,7 @@ public class CommandSkull implements CommandExecutor { if(p.getInventory().getItemInMainHand().getType() == Material.AIR) p.getInventory().setItemInMainHand(is); else - p.getInventory().setItemInOffHand(is); + p.getInventory().addItem(is); return false; } }