Search in sources :

Example 1 with EntityProjectedItem

use of lumien.randomthings.entitys.EntityProjectedItem in project Random-Things by lumien231.

the class RenderProjectedItem method transformModelCount.

private int transformModelCount(EntityProjectedItem itemIn, double p_177077_2_, double p_177077_4_, double p_177077_6_, float p_177077_8_, IBakedModel p_177077_9_) {
    ItemStack itemstack = itemIn.getItem();
    Item item = itemstack.getItem();
    if (item == null) {
        return 0;
    } else {
        boolean flag = p_177077_9_.isGui3d();
        int i = this.getModelCount(itemstack);
        float f = 0.25F;
        float f2 = p_177077_9_.getItemCameraTransforms().getTransform(ItemCameraTransforms.TransformType.GROUND).scale.y;
        float modY = (float) p_177077_4_ + f2 * 0.25f;
        if (flag) {
            modY -= 0.15f;
        } else {
            modY -= 0.2;
        }
        GlStateManager.translate((float) p_177077_2_, modY, (float) p_177077_6_);
        if (flag || this.renderManager.options != null) {
            float f3 = ((itemIn.getAge() + p_177077_8_) / 20.0F + itemIn.hoverStart) * (180F / (float) Math.PI);
            GlStateManager.rotate(f3, 0.0F, 1.0F, 0.0F);
        }
        GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
        return i;
    }
}
Also used : Item(net.minecraft.item.Item) EntityProjectedItem(lumien.randomthings.entitys.EntityProjectedItem) RenderItem(net.minecraft.client.renderer.RenderItem) ItemStack(net.minecraft.item.ItemStack)

Aggregations

EntityProjectedItem (lumien.randomthings.entitys.EntityProjectedItem)1 RenderItem (net.minecraft.client.renderer.RenderItem)1 Item (net.minecraft.item.Item)1 ItemStack (net.minecraft.item.ItemStack)1