From ea2e8e9a1d37dcf61db0b55113a2dc849a8ac072 Mon Sep 17 00:00:00 2001 From: Lizbeth Rika Date: Wed, 4 Feb 2015 18:53:45 +0000 Subject: [PATCH] This should fix elementium axes crashing if they kill a player. --- .../equipment/tool/elementium/ItemElementiumAxe.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumAxe.java b/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumAxe.java index e7c75fab9..6b3bf0944 100644 --- a/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumAxe.java +++ b/src/main/java/vazkii/botania/common/item/equipment/tool/elementium/ItemElementiumAxe.java @@ -15,6 +15,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.living.LivingDropsEvent; import vazkii.botania.api.BotaniaAPI; +import vazkii.botania.common.core.helper.ItemNBTHelper; import vazkii.botania.common.item.equipment.tool.manasteel.ItemManasteelAxe; import vazkii.botania.common.lib.LibItemNames; import cpw.mods.fml.common.eventhandler.SubscribeEvent; @@ -44,11 +45,9 @@ public class ItemElementiumAxe extends ItemManasteelAxe { else if(event.entityLiving instanceof EntityCreeper && rand.nextInt(26) <= 2 + 2 * looting) addDrop(event, new ItemStack(Items.skull, 1, 4)); else if(event.entityLiving instanceof EntityPlayer && rand.nextInt(11) <= 1 + looting) { - ItemStack head = new ItemStack(Items.skull, 1, 3); - NBTTagCompound nametag = new NBTTagCompound(); - nametag.setString("SkullOwner", ((EntityPlayer)event.entityLiving).getCommandSenderName()); - head.setTagInfo("SkullOwner", nametag); - addDrop(event, head); + ItemStack stack = new ItemStack(Items.skull, 1, 3); + ItemNBTHelper.setString(stack, "SkullOwner", ((EntityPlayer)event.entityLiving).getCommandSenderName()); + addDrop(event, stack); } } }