mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-12-22 14:59:22 +01:00
how bout we make it not crash, my dude
This commit is contained in:
parent
baea1d91a9
commit
1d76a5a135
3 changed files with 4 additions and 5 deletions
|
@ -1,6 +1,5 @@
|
|||
package de.ellpeck.naturesaura.items;
|
||||
|
||||
import baubles.api.render.IRenderBauble;
|
||||
import de.ellpeck.naturesaura.Helper;
|
||||
import de.ellpeck.naturesaura.aura.Capabilities;
|
||||
import de.ellpeck.naturesaura.aura.container.IAuraContainer;
|
||||
|
@ -103,7 +102,6 @@ public class ItemAuraCache extends ItemImpl implements ITrinketItem {
|
|||
public void render(ItemStack stack, EntityPlayer player, RenderType type) {
|
||||
if (type == RenderType.BODY) {
|
||||
boolean armor = !player.inventory.armorInventory.get(EntityEquipmentSlot.CHEST.getIndex()).isEmpty();
|
||||
IRenderBauble.Helper.rotateIfSneaking(player);
|
||||
GlStateManager.translate(-0.15F, 0.65F, armor ? -0.195F : -0.13F);
|
||||
GlStateManager.scale(0.25F, 0.25F, 0.25F);
|
||||
GlStateManager.rotate(180F, 1F, 0F, 0F);
|
||||
|
|
|
@ -1,9 +1,7 @@
|
|||
package de.ellpeck.naturesaura.items;
|
||||
|
||||
import baubles.api.render.IRenderBauble;
|
||||
import de.ellpeck.naturesaura.Helper;
|
||||
import de.ellpeck.naturesaura.renderers.ITrinketItem;
|
||||
import de.ellpeck.naturesaura.renderers.PlayerLayerTrinkets;
|
||||
import de.ellpeck.naturesaura.renderers.PlayerLayerTrinkets.RenderType;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -24,7 +22,6 @@ public class ItemEye extends ItemImpl implements ITrinketItem {
|
|||
public void render(ItemStack stack, EntityPlayer player, RenderType type) {
|
||||
if (type == RenderType.BODY) {
|
||||
boolean armor = !player.inventory.armorInventory.get(EntityEquipmentSlot.CHEST.getIndex()).isEmpty();
|
||||
IRenderBauble.Helper.rotateIfSneaking(player);
|
||||
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);
|
||||
|
|
|
@ -59,6 +59,10 @@ public class PlayerLayerTrinkets implements LayerRenderer<EntityPlayer> {
|
|||
Item item = stack.getItem();
|
||||
if (item instanceof ITrinketItem && !this.alreadyRendered.contains(item)) {
|
||||
GlStateManager.pushMatrix();
|
||||
if (type == RenderType.BODY && player.isSneaking()) {
|
||||
GlStateManager.translate(0F, 0.2F, 0F);
|
||||
GlStateManager.rotate(90F / (float) Math.PI, 1.0F, 0.0F, 0.0F);
|
||||
}
|
||||
((ITrinketItem) item).render(stack, player, type);
|
||||
GlStateManager.popMatrix();
|
||||
this.alreadyRendered.add(item);
|
||||
|
|
Loading…
Reference in a new issue