use of riskyken.armourersWorkshop.client.model.skin.AbstractModelSkin in project Armourers-Workshop by RiskyKen.
the class SkinnableEntityZombieRenderer method renderEquipmentType.
private void renderEquipmentType(EntityLivingBase entity, RendererLivingEntity renderer, ISkinType skinType, IEntityEquipment equipmentData) {
float scale = 0.0625F;
if (renderer instanceof RenderZombie) {
RenderZombie rz = (RenderZombie) renderer;
boolean isZombieVillager = false;
isZombieVillager = rz.modelBipedMain instanceof ModelZombieVillager;
if (!equipmentData.haveEquipment(skinType, 0)) {
return;
}
ISkinPointer skinPointer = equipmentData.getSkinPointer(skinType, 0);
Skin skin = ClientSkinCache.INSTANCE.getSkin(skinPointer);
if (skin == null) {
return;
}
AbstractModelSkin model = SkinModelRenderer.INSTANCE.getModelForEquipmentType(skinType);
GL11.glPushMatrix();
if (isZombieVillager & skinType == SkinTypeRegistry.skinHead) {
GL11.glTranslated(0, -2.0F * scale, 0);
}
if (skinType == SkinTypeRegistry.skinLegs | skinType == SkinTypeRegistry.skinFeet) {
GL11.glTranslated(0, 0, 0.1F * scale);
}
// GL11.glEnable(GL11.GL_POLYGON_OFFSET_FILL);
// GL11.glPolygonOffset(-1F, -1F);
model.render(entity, rz.modelBipedMain, skin, false, skinPointer.getSkinDye(), null, false, 0, false);
// GL11.glDisable(GL11.GL_POLYGON_OFFSET_FILL);
GL11.glPopMatrix();
}
}
use of riskyken.armourersWorkshop.client.model.skin.AbstractModelSkin in project Armourers-Workshop by RiskyKen.
the class AbstractModItemArmour method getArmorModel.
@Override
@SideOnly(Side.CLIENT)
public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack stack, int armorSlot) {
if (!SkinNBTHelper.stackHasSkinData(stack)) {
return null;
}
SkinPointer skinData = SkinNBTHelper.getSkinPointerFromStack(stack);
AbstractModelSkin targetModel = null;
SkinModelRenderer emr = SkinModelRenderer.INSTANCE;
Skin data = emr.getCustomArmourItemData(skinData);
if (data == null) {
return null;
}
targetModel = emr.getModelForEquipmentType(data.getSkinType());
if (targetModel == null) {
return null;
}
targetModel.npcSkinData = data;
targetModel.npcDyeData = skinData.getSkinDye();
return targetModel;
}
use of riskyken.armourersWorkshop.client.model.skin.AbstractModelSkin in project Armourers-Workshop by RiskyKen.
the class SkinnableEntitySkeletonRenderer method renderEquipmentType.
private void renderEquipmentType(EntityLivingBase entity, RendererLivingEntity renderer, ISkinType skinType, IEntityEquipment equipmentData) {
float scale = 0.0625F;
if (renderer instanceof RenderSkeleton) {
RenderSkeleton rs = (RenderSkeleton) renderer;
if (!equipmentData.haveEquipment(skinType, 0)) {
return;
}
ISkinPointer skinPointer = equipmentData.getSkinPointer(skinType, 0);
Skin skin = ClientSkinCache.INSTANCE.getSkin(skinPointer);
if (skin == null) {
return;
}
AbstractModelSkin model = SkinModelRenderer.INSTANCE.getModelForEquipmentType(skinType);
GL11.glPushMatrix();
model.render(entity, rs.modelBipedMain, skin, false, skinPointer.getSkinDye(), null, false, 0, false);
GL11.glPopMatrix();
}
}
Aggregations