From 88b0b0ede401a0543343dbf47acccd00d122b2d3 Mon Sep 17 00:00:00 2001 From: meiskam Date: Fri, 3 May 2013 10:12:46 -0400 Subject: [PATCH] Fixed where custom mob heads would drop when destroyed in creative mode --- .../shininet/bukkit/playerheads/PlayerHeadsListener.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/org/shininet/bukkit/playerheads/PlayerHeadsListener.java b/src/org/shininet/bukkit/playerheads/PlayerHeadsListener.java index 277f681f..f41b61bf 100644 --- a/src/org/shininet/bukkit/playerheads/PlayerHeadsListener.java +++ b/src/org/shininet/bukkit/playerheads/PlayerHeadsListener.java @@ -8,6 +8,7 @@ import java.util.Random; import org.bukkit.ChatColor; +import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.SkullType; @@ -207,14 +208,13 @@ public void onBlockBreak(BlockBreakEvent event) { return; } Block block = event.getBlock(); - if (block.getType() == Material.SKULL) { + Player player = event.getPlayer(); + if ((player.getGameMode() != GameMode.CREATIVE) && (block.getType() == Material.SKULL)) { Skull skull = (Skull)block.getState(); if (skull.hasOwner()) { String owner = ChatColor.stripColor(skull.getOwner()); for (CustomSkullType skullType : CustomSkullType.values()) { if (owner.equals(skullType.getOwner())) { - Player player = event.getPlayer(); - plugin.getServer().getPluginManager().callEvent(new PlayerAnimationEvent(player)); plugin.getServer().getPluginManager().callEvent(new BlockDamageEvent(player, block, player.getItemInHand(), true));