From 1fa81166dfe255d37a54e0a81d212954351c8d20 Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Fri, 6 Sep 2019 16:22:22 -0400 Subject: More affixes --- .../jewelrycraft/tileentity/TileEntityShadowEye.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/main/java/darkknight/jewelrycraft/tileentity/TileEntityShadowEye.java') diff --git a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityShadowEye.java b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityShadowEye.java index 9b4930f..d223252 100755 --- a/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityShadowEye.java +++ b/src/main/java/darkknight/jewelrycraft/tileentity/TileEntityShadowEye.java @@ -191,25 +191,26 @@ public class TileEntityShadowEye extends TileEntity { if (worldObj.getBlock(xCoord, yCoord + 2, zCoord) == Blocks.enchanting_table) { if (worldObj.rand.nextBoolean()) { JewelryNBT.addPrefix(centerItem, AffixMods.pickPrefix(worldObj.rand, jewelType)); - target.addChatMessage( - new ChatComponentText(EnumChatFormatting.DARK_PURPLE + "The item is infused with a prefix")); + if (target != null) + target.addChatMessage(new ChatComponentText( + EnumChatFormatting.DARK_PURPLE + "The item is infused with a prefix")); } else if (target.experienceLevel > 2) { target.addExperienceLevel(-2); JewelryNBT.addPrefix(centerItem, AffixMods.pickPrefix(worldObj.rand, jewelType)); - if (!worldObj.isRemote) + if (target != null) target.addChatMessage(new ChatComponentText( EnumChatFormatting.DARK_PURPLE + "You infuse the item with a prefix")); } if (worldObj.rand.nextBoolean()) { JewelryNBT.addSuffix(centerItem, AffixMods.pickSuffix(worldObj.rand, jewelType)); - if (!worldObj.isRemote) + if (target != null) target.addChatMessage(new ChatComponentText( EnumChatFormatting.DARK_PURPLE + "The item is infused with a suffix")); } else if (target.experienceLevel > 2) { target.addExperienceLevel(-2); JewelryNBT.addSuffix(centerItem, AffixMods.pickSuffix(worldObj.rand, jewelType)); - if (!worldObj.isRemote) + if (target != null) target.addChatMessage(new ChatComponentText( EnumChatFormatting.DARK_PURPLE + "You infuse the item with a suffix")); } -- cgit v1.2.3