Skip to content

Commit

Permalink
Fixed where custom mob heads would drop when destroyed in creative mode
Browse files Browse the repository at this point in the history
  • Loading branch information
meiskam committed May 3, 2013
1 parent 14b198a commit 88b0b0e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/org/shininet/bukkit/playerheads/PlayerHeadsListener.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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));

Expand Down

0 comments on commit 88b0b0e

Please sign in to comment.