2018-10-14 17:46:00 +02:00
|
|
|
package de.ellpeck.naturesaura.items;
|
|
|
|
|
2018-10-21 14:42:30 +02:00
|
|
|
import de.ellpeck.naturesaura.Helper;
|
|
|
|
import de.ellpeck.naturesaura.renderers.ITrinketItem;
|
|
|
|
import de.ellpeck.naturesaura.renderers.PlayerLayerTrinkets.RenderType;
|
|
|
|
import net.minecraft.client.renderer.GlStateManager;
|
|
|
|
import net.minecraft.entity.player.EntityPlayer;
|
|
|
|
import net.minecraft.inventory.EntityEquipmentSlot;
|
|
|
|
import net.minecraft.item.ItemStack;
|
|
|
|
import net.minecraftforge.fml.relauncher.Side;
|
|
|
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
|
|
|
|
|
|
public class ItemEye extends ItemImpl implements ITrinketItem {
|
2018-10-14 17:46:00 +02:00
|
|
|
|
|
|
|
public ItemEye() {
|
|
|
|
super("eye");
|
2018-10-20 21:19:08 +02:00
|
|
|
this.setMaxStackSize(1);
|
2018-10-14 17:46:00 +02:00
|
|
|
}
|
2018-10-21 14:42:30 +02:00
|
|
|
|
|
|
|
@Override
|
|
|
|
@SideOnly(Side.CLIENT)
|
2018-11-02 21:10:53 +01:00
|
|
|
public void render(ItemStack stack, EntityPlayer player, RenderType type, boolean isHolding) {
|
|
|
|
if (type == RenderType.BODY && !isHolding) {
|
2018-10-21 14:42:30 +02:00
|
|
|
boolean armor = !player.inventory.armorInventory.get(EntityEquipmentSlot.CHEST.getIndex()).isEmpty();
|
|
|
|
GlStateManager.translate(0.1F, 0.19F, armor ? -0.195F : -0.13F);
|
|
|
|
GlStateManager.scale(0.15F, 0.15F, 0.15F);
|
|
|
|
GlStateManager.rotate(180F, 1F, 0F, 0F);
|
|
|
|
Helper.renderItemInWorld(stack);
|
|
|
|
}
|
|
|
|
}
|
2018-10-14 17:46:00 +02:00
|
|
|
}
|