Search in sources :

Example 1 with ScubaMaterial

use of net.tropicraft.core.common.item.scuba.api.ScubaMaterial in project Tropicraft by Tropicraft.

the class ModelScubaGear method renderTank.

private void renderTank(EntityLivingBase entityIn, float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
    ItemStack gearStack = entityIn.getItemStackFromSlot(EntityEquipmentSlot.CHEST);
    IScubaGear gear = gearStack.getCapability(ScubaCapabilities.getGearCapability(), null);
    TextureManager tm = Minecraft.getMinecraft().getTextureManager();
    if (gear.getTanks().getRight() != null) {
        ScubaMaterial material = gear.getStackInSlot(1).getItem() == ItemRegistry.pinkScubaTank ? ScubaMaterial.PINK : ScubaMaterial.YELLOW;
        tm.bindTexture(ItemScubaGear.getArmorTexture(material));
        Tank2.rotateAngleX = 0F;
        Tank2.rotateAngleY = 0F;
        Tank2.rotateAngleZ = 0F;
        Tank2.renderWithRotation(scale);
        Tank2m1.rotateAngleX = 0F;
        Tank2m1.rotateAngleY = 0F;
        Tank2m1.rotateAngleZ = 0F;
        Tank2m1.renderWithRotation(scale);
        Tank2m2.rotateAngleX = 0F;
        Tank2m2.rotateAngleY = -1.570796F;
        Tank2m2.rotateAngleZ = 0F;
        Tank2m2.renderWithRotation(scale);
        Tank2m3.rotateAngleX = 0F;
        Tank2m3.rotateAngleY = -1.570796F;
        Tank2m3.rotateAngleZ = 0F;
        Tank2m3.renderWithRotation(scale);
        Tank2m4.rotateAngleX = 0F;
        Tank2m4.rotateAngleY = 0F;
        Tank2m4.rotateAngleZ = 0F;
        Tank2m4.renderWithRotation(scale);
        Tank2m5.rotateAngleX = 0F;
        Tank2m5.rotateAngleY = 0F;
        Tank2m5.rotateAngleZ = 0F;
        Tank2m5.renderWithRotation(scale);
        Tank2m6.rotateAngleX = 0F;
        Tank2m6.rotateAngleY = 0F;
        Tank2m6.rotateAngleZ = 0F;
        Tank2m6.renderWithRotation(scale);
        Tank2m7.rotateAngleX = 0F;
        Tank2m7.rotateAngleY = 0F;
        Tank2m7.rotateAngleZ = 0F;
        Tank2m7.renderWithRotation(scale);
    }
    if (gear.getTanks().getLeft() != null) {
        ScubaMaterial material = gear.getStackInSlot(0).getItem() == ItemRegistry.pinkScubaTank ? ScubaMaterial.PINK : ScubaMaterial.YELLOW;
        tm.bindTexture(ItemScubaGear.getArmorTexture(material));
        Tank1.rotateAngleX = 0F;
        Tank1.rotateAngleY = 0F;
        Tank1.rotateAngleZ = 0F;
        Tank1.renderWithRotation(scale);
        Tank1m1.rotateAngleX = 0F;
        Tank1m1.rotateAngleY = 0F;
        Tank1m1.rotateAngleZ = 0F;
        Tank1m1.renderWithRotation(scale);
        Tank1m2.rotateAngleX = 0F;
        Tank1m2.rotateAngleY = -1.570796F;
        Tank1m2.rotateAngleZ = 0F;
        Tank1m2.renderWithRotation(scale);
        Tank1m3.rotateAngleX = 0F;
        Tank1m3.rotateAngleY = -1.570796F;
        Tank1m3.rotateAngleZ = 0F;
        Tank1m3.renderWithRotation(scale);
        Tank1m4.rotateAngleX = 0F;
        Tank1m4.rotateAngleY = 0F;
        Tank1m4.rotateAngleZ = 0F;
        Tank1m4.renderWithRotation(scale);
        Tank1m5.rotateAngleX = 0F;
        Tank1m5.rotateAngleY = 0F;
        Tank1m5.rotateAngleZ = 0F;
        Tank1m5.renderWithRotation(scale);
        Tank1m6.rotateAngleX = 0F;
        Tank1m6.rotateAngleY = 0F;
        Tank1m6.rotateAngleZ = 0F;
        Tank1m6.renderWithRotation(scale);
        Tank1m7.rotateAngleX = 0F;
        Tank1m7.rotateAngleY = 0F;
        Tank1m7.rotateAngleZ = 0F;
        Tank1m7.renderWithRotation(scale);
    }
    Minecraft.getMinecraft().renderEngine.bindTexture(new ResourceLocation(((ItemArmor) gearStack.getItem()).getArmorTexture(gearStack, entityIn, EntityEquipmentSlot.CHEST, null)));
}
Also used : TextureManager(net.minecraft.client.renderer.texture.TextureManager) ScubaMaterial(net.tropicraft.core.common.item.scuba.api.ScubaMaterial) ResourceLocation(net.minecraft.util.ResourceLocation) ItemArmor(net.minecraft.item.ItemArmor) IScubaGear(net.tropicraft.core.common.item.scuba.api.IScubaGear) ItemStack(net.minecraft.item.ItemStack)

Aggregations

TextureManager (net.minecraft.client.renderer.texture.TextureManager)1 ItemArmor (net.minecraft.item.ItemArmor)1 ItemStack (net.minecraft.item.ItemStack)1 ResourceLocation (net.minecraft.util.ResourceLocation)1 IScubaGear (net.tropicraft.core.common.item.scuba.api.IScubaGear)1 ScubaMaterial (net.tropicraft.core.common.item.scuba.api.ScubaMaterial)1