diff --git a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/SmokeBomb.java b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/SmokeBomb.java index 41f70572b..7a7e54133 100644 --- a/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/SmokeBomb.java +++ b/Plugins/Mineplex.Minecraft.Game.ClassCombat/src/mineplex/minecraft/game/classcombat/Skill/Assassin/SmokeBomb.java @@ -24,6 +24,7 @@ import org.bukkit.Sound; import org.bukkit.entity.Player; import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; +import org.bukkit.event.inventory.InventoryCloseEvent; import org.bukkit.event.player.PlayerDropItemEvent; import org.bukkit.event.player.PlayerInteractEvent; @@ -55,7 +56,12 @@ public class SmokeBomb extends Skill public void Use(PlayerDropItemEvent event) { Player player = event.getPlayer(); - + + if (player.getOpenInventory() != null) + { + return; + } + int level = getLevel(player); if (level == 0) return; @@ -140,7 +146,19 @@ public class SmokeBomb extends Skill Factory.Condition().EndCondition(event.getPlayer(), null, GetName()); } - + + @EventHandler + public void closeInv(InventoryCloseEvent event) + { + if (getLevel(event.getPlayer()) == 0) + { + return; + } + + event.getPlayer().getInventory().addItem(event.getPlayer().getItemOnCursor()); + event.getPlayer().setItemOnCursor(null); + } + @EventHandler public void Smoke(UpdateEvent event) {