From a10ddc9c377ecd0961a1ca8e8ca059d0a9753826 Mon Sep 17 00:00:00 2001 From: asofold Date: Fri, 16 Nov 2012 12:18:21 +0100 Subject: [PATCH] Restrict spawn-egg dupe prevention to non-creative players. --- .../nocheatplus/checks/inventory/InventoryListener.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/fr/neatmonster/nocheatplus/checks/inventory/InventoryListener.java b/src/fr/neatmonster/nocheatplus/checks/inventory/InventoryListener.java index a9a676c4..e398b4df 100644 --- a/src/fr/neatmonster/nocheatplus/checks/inventory/InventoryListener.java +++ b/src/fr/neatmonster/nocheatplus/checks/inventory/InventoryListener.java @@ -285,7 +285,9 @@ public class InventoryListener extends CheckListener { @EventHandler(ignoreCancelled = false, priority = EventPriority.LOWEST) public final void onPlayerInteractEntity(final PlayerInteractEntityEvent event) { - final ItemStack stack = event.getPlayer().getItemInHand(); + final Player player = event.getPlayer(); + if (player.getGameMode() == GameMode.CREATIVE) return; + final ItemStack stack = player.getItemInHand(); if (stack != null && stack.getTypeId() == Material.MONSTER_EGG.getId()){ event.setCancelled(true); }