Fixed occasional client crash on /lb tool and /lb toolblock

This commit is contained in:
Robin Kupper
2011-06-13 13:21:53 +02:00
parent 28ea43f6b9
commit 6af7b48610

View File

@@ -134,7 +134,8 @@ public class BukkitUtils
else {
final int free = inv.firstEmpty();
if (free >= 0) {
inv.setItem(free, player.getItemInHand());
if (player.getItemInHand() != null && player.getItemInHand().getTypeId() != 0)
inv.setItem(free, player.getItemInHand());
player.setItemInHand(new ItemStack(type, 1));
player.sendMessage(ChatColor.GREEN + "Here's your " + getMaterialName(type));
} else