From 44117107c1c16d1aa9f41c241a0befb833b05251 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 8 Jan 2018 17:21:28 +0000 Subject: [PATCH] Prevent players moving skill items out of their inventory --- .../game/games/skywars/kits/perks/SkywarsPerk.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/skywars/kits/perks/SkywarsPerk.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/skywars/kits/perks/SkywarsPerk.java index 943b0c072..12b874af1 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/skywars/kits/perks/SkywarsPerk.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/skywars/kits/perks/SkywarsPerk.java @@ -5,6 +5,7 @@ import org.bukkit.event.EventHandler; import org.bukkit.event.EventPriority; import org.bukkit.event.block.BlockPlaceEvent; import org.bukkit.event.entity.PlayerDeathEvent; +import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.player.PlayerDropItemEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.inventory.ItemStack; @@ -12,6 +13,7 @@ import org.bukkit.inventory.ItemStack; import mineplex.core.common.util.F; import mineplex.core.common.util.UtilEvent; import mineplex.core.common.util.UtilEvent.ActionType; +import mineplex.core.common.util.UtilInv; import nautilus.game.arcade.kit.Perk; @@ -68,6 +70,15 @@ public abstract class SkywarsPerk extends Perk } } + @EventHandler + public void disallowMovement(InventoryClickEvent event) + { + if (hasPerk((Player) event.getWhoClicked())) + { + UtilInv.DisallowMovementOf(event, _itemStack.getItemMeta().getDisplayName(), _itemStack.getType(), _itemStack.getData().getData(), true); + } + } + @EventHandler public void playerDeath(PlayerDeathEvent event) {