diff --git a/src/main/java/openblocks/client/SoundEventsManager.java b/src/main/java/openblocks/client/SoundEventsManager.java index b5df3af4..2011af7f 100644 --- a/src/main/java/openblocks/client/SoundEventsManager.java +++ b/src/main/java/openblocks/client/SoundEventsManager.java @@ -11,6 +11,7 @@ import net.minecraft.client.renderer.texture.TextureManager; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; import net.minecraft.util.math.MathHelper; @@ -82,7 +83,7 @@ public class SoundEventsManager { public static boolean isEntityWearingGlasses(Entity e) { if (e instanceof EntityPlayer) { - ItemStack helmet = ((EntityPlayer)e).inventory.armorInventory[3]; + ItemStack helmet = ((EntityPlayer)e).getItemStackFromSlot(EntityEquipmentSlot.HEAD); return helmet != null && helmet.getItem() instanceof ItemSonicGlasses; } diff --git a/src/main/java/openblocks/common/tileentity/TileEntityImaginary.java b/src/main/java/openblocks/common/tileentity/TileEntityImaginary.java index f17e69e3..68f83bdf 100644 --- a/src/main/java/openblocks/common/tileentity/TileEntityImaginary.java +++ b/src/main/java/openblocks/common/tileentity/TileEntityImaginary.java @@ -3,6 +3,7 @@ package openblocks.common.tileentity; import com.google.common.base.Preconditions; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; @@ -144,7 +145,7 @@ public class TileEntityImaginary extends OpenTileEntity implements ICustomPickIt if (what == Property.VISIBLE && player.isSpectator()) return true; if (what == Property.SOLID && isPencil()) return true; - ItemStack helmet = player.inventory.armorInventory[3]; + final ItemStack helmet = player.getItemStackFromSlot(EntityEquipmentSlot.HEAD); if (helmet == null) return isInverted();