use of net.minecraft.client.model.ModelBiped in project ImmersiveEngineering by BluSunrize.
the class IEBipedLayerRenderer method doRenderLayer.
@Override
public void doRenderLayer(EntityLivingBase living, float limbSwing, float prevLimbSwing, float partialTicks, float rotation, float yaw, float pitch, float scale) {
if (!living.getItemStackFromSlot(EntityEquipmentSlot.HEAD).isEmpty() && ItemNBTHelper.hasKey(living.getItemStackFromSlot(EntityEquipmentSlot.HEAD), "IE:Earmuffs")) {
ItemStack earmuffs = ItemNBTHelper.getItemStack(living.getItemStackFromSlot(EntityEquipmentSlot.HEAD), Lib.NBT_Earmuffs);
if (!earmuffs.isEmpty()) {
GlStateManager.pushMatrix();
ModelBiped model = IEContent.itemEarmuffs.getArmorModel(living, earmuffs, EntityEquipmentSlot.HEAD, null);
ClientUtils.bindTexture(IEContent.itemEarmuffs.getArmorTexture(earmuffs, living, EntityEquipmentSlot.HEAD, "overlay"));
model.render(living, limbSwing, prevLimbSwing, rotation, yaw, pitch, scale);
int colour = ((IColouredItem) earmuffs.getItem()).getColourForIEItem(earmuffs, 0);
GlStateManager.color((colour >> 16 & 255) / 255f, (colour >> 8 & 255) / 255f, (colour & 255) / 255f);
ClientUtils.bindTexture(IEContent.itemEarmuffs.getArmorTexture(earmuffs, living, EntityEquipmentSlot.HEAD, null));
model.render(living, limbSwing, prevLimbSwing, rotation, yaw, pitch, scale);
GlStateManager.popMatrix();
}
}
if (!living.getItemStackFromSlot(EntityEquipmentSlot.CHEST).isEmpty() && ItemNBTHelper.hasKey(living.getItemStackFromSlot(EntityEquipmentSlot.CHEST), "IE:Powerpack")) {
ItemStack powerpack = ItemNBTHelper.getItemStack(living.getItemStackFromSlot(EntityEquipmentSlot.CHEST), Lib.NBT_Powerpack);
addWornPowerpack(living, powerpack);
}
if (POWERPACK_PLAYERS.containsKey(living.getUniqueID())) {
Pair<ItemStack, Integer> entry = POWERPACK_PLAYERS.get(living.getUniqueID());
renderPowerpack(entry.getLeft(), living, limbSwing, prevLimbSwing, partialTicks, rotation, yaw, pitch, scale);
int time = entry.getValue() - 1;
if (time <= 0)
POWERPACK_PLAYERS.remove(living.getUniqueID());
else
POWERPACK_PLAYERS.put(living.getUniqueID(), Pair.of(entry.getLeft(), time));
}
}
use of net.minecraft.client.model.ModelBiped in project BetterStorage by copygirl.
the class RenderFrienderman method shouldRenderPass.
@Override
protected int shouldRenderPass(EntityEnderman entity, int slot, float partialTicks) {
if (slot == 0) {
setRenderPassModel(mainModel);
return super.shouldRenderPass(entity, slot, partialTicks);
} else if (slot != 1)
return -1;
ItemStack stack = entity.getEquipmentInSlot(EquipmentSlot.CHEST);
if (stack == null)
return -1;
Item item = stack.getItem();
if (!(item instanceof ItemArmor))
return -1;
ItemArmor itemarmor = (ItemArmor) item;
TextureManager textureManager = Minecraft.getMinecraft().getTextureManager();
textureManager.bindTexture(RenderBiped.getArmorResource(entity, stack, slot, null));
ModelBiped modelBiped = ForgeHooksClient.getArmorModel(entity, stack, slot, null);
setRenderPassModel(modelBiped);
if (modelBiped != null) {
modelBiped.onGround = mainModel.onGround;
modelBiped.isRiding = mainModel.isRiding;
modelBiped.isChild = mainModel.isChild;
}
int color = itemarmor.getColor(stack);
if (color != -1) {
RenderUtils.setColorFromInt(color);
if (stack.isItemEnchanted())
return 31;
return 16;
}
GL11.glColor3f(1.0F, 1.0F, 1.0F);
return (stack.isItemEnchanted() ? 15 : 1);
}
use of net.minecraft.client.model.ModelBiped in project Hyperium by HyperiumClient.
the class TwoPartLayerBipedArmor method initArmor.
protected void initArmor() {
modelLeggings = new ModelBiped(0.5F);
modelArmor = new ModelBiped(1.0F);
}
Aggregations