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 ec1560c..88e5b3b 100644 --- a/BauSystem_15/src/de/steamwar/bausystem/commands/CommandDebugStick_15.java +++ b/BauSystem_15/src/de/steamwar/bausystem/commands/CommandDebugStick_15.java @@ -27,6 +27,9 @@ class CommandDebugStick_15 { private CommandDebugStick_15(){} static void giveStick(Player player){ - player.getInventory().setItemInMainHand(new ItemStack(Material.DEBUG_STICK, 1)); + if(player.getInventory().getItemInMainHand().getType() == Material.AIR) + player.getInventory().setItemInMainHand(new ItemStack(Material.DEBUG_STICK)); + else + 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 52bc21e..4446023 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandDetonator.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandDetonator.java @@ -23,6 +23,7 @@ import de.steamwar.bausystem.BauSystem; import de.steamwar.bausystem.Permission; import de.steamwar.bausystem.world.Detonator; import de.steamwar.bausystem.world.Welt; +import org.bukkit.Material; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; @@ -62,7 +63,10 @@ public class CommandDetonator implements CommandExecutor { case "wand": case "detonator": case "item": - player.getInventory().setItemInMainHand(Detonator.WAND); + if(player.getInventory().getItemInMainHand().getType() == Material.AIR) + player.getInventory().setItemInMainHand(Detonator.WAND); + else + player.getInventory().addItem(Detonator.WAND); player.updateInventory(); Detonator.getDetonator(player); break; diff --git a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandSkull.java b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandSkull.java index 0208ca7..9a0ca95 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandSkull.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/commands/CommandSkull.java @@ -21,6 +21,7 @@ package de.steamwar.bausystem.commands; import de.steamwar.bausystem.BauSystem; import de.steamwar.inventory.SWItem; +import org.bukkit.Material; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; @@ -46,7 +47,11 @@ public class CommandSkull implements CommandExecutor { assert sm != null; sm.setDisplayName("§e" + args[0] + "§8s Kopf"); is.setItemMeta(sm); - p.getInventory().setItemInMainHand(is); + if(p.getInventory().getItemInMainHand().getType() == Material.AIR) + p.getInventory().setItemInMainHand(is); + else + p.getInventory().addItem(is); + return false; } }