From 7a8b4a228df4887c8609766e8dfbe33b89e4ca15 Mon Sep 17 00:00:00 2001 From: Jan9103 Date: Sun, 22 Mar 2020 14:41:09 +0100 Subject: [PATCH] added EventHandler for SwapItemsInHands as expansion for the InventorryClick Eventhandler --- src/de/steamwar/lobby/listener/PlayerInventoryListener.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/de/steamwar/lobby/listener/PlayerInventoryListener.java b/src/de/steamwar/lobby/listener/PlayerInventoryListener.java index 654833d..996ee39 100644 --- a/src/de/steamwar/lobby/listener/PlayerInventoryListener.java +++ b/src/de/steamwar/lobby/listener/PlayerInventoryListener.java @@ -6,6 +6,7 @@ import org.bukkit.event.Listener; import org.bukkit.event.inventory.InventoryClickEvent; import org.bukkit.event.player.PlayerDropItemEvent; import org.bukkit.event.player.PlayerPickupItemEvent; +import org.bukkit.event.player.PlayerSwapHandItemsEvent; public class PlayerInventoryListener implements Listener { @@ -23,6 +24,11 @@ public class PlayerInventoryListener implements Listener { public void handleInventoryClick(InventoryClickEvent event) { event.setCancelled(true); } + + @EventHandler + public void handlePlayerSwapHandItemsEvent(PlayerSwapHandItemsEvent event) { + event.setCancelled(true); + } }