use of riskyken.armourersWorkshop.common.skin.data.SkinPart in project Armourers-Workshop by RiskyKen.
the class ModelSkinChest method render.
@Override
public void render(Entity entity, Skin armourData, boolean showSkinPaint, ISkinDye skinDye, byte[] extraColour, boolean itemRender, double distance, boolean doLodLoading) {
if (armourData == null) {
return;
}
ArrayList<SkinPart> parts = armourData.getParts();
if (entity != null && entity instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) entity;
this.isSneak = player.isSneaking();
this.isRiding = player.isRiding();
this.heldItemRight = 0;
if (player.getHeldItem() != null) {
this.heldItemRight = 1;
}
}
if (ClientProxy.isJrbaClientLoaded()) {
this.isChild = false;
}
ApiRegistrar.INSTANCE.onRenderEquipment(entity, SkinTypeRegistry.skinChest);
RenderHelper.enableGUIStandardItemLighting();
if (armourData.hasPaintData() & showSkinPaint) {
if (extraColour == null) {
extraColour = PaintingHelper.getLocalPlayerExtraColours();
}
SkinModelTexture st = ClientSkinPaintCache.INSTANCE.getTextureForSkin(armourData, skinDye, extraColour);
st.bindTexture();
GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_ALPHA_TEST);
bipedBody.render(SCALE);
bipedLeftArm.render(SCALE);
bipedRightArm.render(SCALE);
GL11.glPopAttrib();
}
boolean override = SkinProperties.PROP_ARMOUR_OVERRIDE.getValue(armourData.getProperties());
for (int i = 0; i < parts.size(); i++) {
SkinPart part = parts.get(i);
GL11.glPushMatrix();
if (isChild) {
float f6 = 2.0F;
GL11.glScalef(1.0F / f6, 1.0F / f6, 1.0F / f6);
GL11.glTranslatef(0.0F, 24.0F * SCALE, 0.0F);
}
ApiRegistrar.INSTANCE.onRenderEquipmentPart(entity, part.getPartType());
if (part.getPartType().getPartName().equals("base")) {
renderChest(part, SCALE, skinDye, extraColour, itemRender, distance, doLodLoading);
} else if (part.getPartType().getPartName().equals("leftArm")) {
renderLeftArm(part, SCALE, skinDye, extraColour, itemRender, distance, doLodLoading, override);
} else if (part.getPartType().getPartName().equals("rightArm")) {
renderRightArm(part, SCALE, skinDye, extraColour, itemRender, distance, doLodLoading, override);
}
GL11.glPopMatrix();
}
GL11.glColor3f(1F, 1F, 1F);
}
use of riskyken.armourersWorkshop.common.skin.data.SkinPart in project Armourers-Workshop by RiskyKen.
the class ModelSkinFeet method render.
@Override
public void render(Entity entity, Skin armourData, boolean showSkinPaint, ISkinDye skinDye, byte[] extraColour, boolean itemRender, double distance, boolean doLodLoading) {
if (armourData == null) {
return;
}
ArrayList<SkinPart> parts = armourData.getParts();
if (entity != null && entity instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) entity;
this.isSneak = player.isSneaking();
this.isRiding = player.isRiding();
this.heldItemRight = 0;
if (player.getHeldItem() != null) {
this.heldItemRight = 1;
}
}
if (ClientProxy.isJrbaClientLoaded()) {
this.isChild = false;
}
ApiRegistrar.INSTANCE.onRenderEquipment(entity, SkinTypeRegistry.skinFeet);
RenderHelper.enableGUIStandardItemLighting();
if (armourData.hasPaintData() & showSkinPaint) {
if (extraColour == null) {
extraColour = PaintingHelper.getLocalPlayerExtraColours();
}
SkinModelTexture st = ClientSkinPaintCache.INSTANCE.getTextureForSkin(armourData, skinDye, extraColour);
st.bindTexture();
GL11.glPushMatrix();
GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_ALPHA_TEST);
if (itemRender) {
GL11.glTranslated(0, -12 * SCALE, 0);
}
bipedLeftLeg.render(SCALE);
bipedRightLeg.render(SCALE);
GL11.glPopAttrib();
GL11.glPopMatrix();
}
for (int i = 0; i < parts.size(); i++) {
SkinPart part = parts.get(i);
GL11.glPushMatrix();
if (isChild) {
float f6 = 2.0F;
GL11.glScalef(1.0F / f6, 1.0F / f6, 1.0F / f6);
GL11.glTranslatef(0.0F, 24.0F * SCALE, 0.0F);
}
ApiRegistrar.INSTANCE.onRenderEquipmentPart(entity, part.getPartType());
if (part.getPartType().getPartName().equals("leftFoot")) {
renderLeftFoot(part, SCALE, skinDye, extraColour, itemRender, distance, doLodLoading);
} else if (part.getPartType().getPartName().equals("rightFoot")) {
renderRightFoot(part, SCALE, skinDye, extraColour, itemRender, distance, doLodLoading);
}
GL11.glPopMatrix();
}
GL11.glColor3f(1F, 1F, 1F);
}
use of riskyken.armourersWorkshop.common.skin.data.SkinPart in project Armourers-Workshop by RiskyKen.
the class ModelSkinLegs method render.
@Override
public void render(Entity entity, Skin armourData, boolean showSkinPaint, ISkinDye skinDye, byte[] extraColour, boolean itemRender, double distance, boolean doLodLoading) {
if (armourData == null) {
return;
}
ArrayList<SkinPart> parts = armourData.getParts();
if (entity != null && entity instanceof EntityPlayer) {
EntityPlayer player = (EntityPlayer) entity;
this.isSneak = player.isSneaking();
this.isRiding = player.isRiding();
this.heldItemRight = 0;
if (player.getHeldItem() != null) {
this.heldItemRight = 1;
}
}
if (ClientProxy.isJrbaClientLoaded()) {
this.isChild = false;
}
ApiRegistrar.INSTANCE.onRenderEquipment(entity, SkinTypeRegistry.skinLegs);
RenderHelper.enableGUIStandardItemLighting();
if (armourData.hasPaintData() & showSkinPaint) {
if (extraColour == null) {
extraColour = PaintingHelper.getLocalPlayerExtraColours();
}
SkinModelTexture st = ClientSkinPaintCache.INSTANCE.getTextureForSkin(armourData, skinDye, extraColour);
st.bindTexture();
GL11.glPushMatrix();
GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_ALPHA_TEST);
if (itemRender) {
GL11.glTranslated(0, -12 * SCALE, 0);
}
bipedLeftLeg.render(SCALE);
bipedRightLeg.render(SCALE);
GL11.glPopAttrib();
GL11.glPopMatrix();
}
for (int i = 0; i < parts.size(); i++) {
SkinPart part = parts.get(i);
GL11.glPushMatrix();
if (isChild) {
float f6 = 2.0F;
GL11.glScalef(1.0F / f6, 1.0F / f6, 1.0F / f6);
GL11.glTranslatef(0.0F, 24.0F * SCALE, 0.0F);
}
ApiRegistrar.INSTANCE.onRenderEquipmentPart(entity, part.getPartType());
if (part.getPartType().getPartName().equals("leftLeg")) {
renderLeftLeg(part, SCALE, skinDye, extraColour, itemRender, distance, doLodLoading);
} else if (part.getPartType().getPartName().equals("rightLeg")) {
renderRightLeg(part, SCALE, skinDye, extraColour, itemRender, distance, doLodLoading);
} else if (part.getPartType().getPartName().equals("skirt")) {
renderSkirt(part, SCALE, skinDye, extraColour, itemRender, distance, doLodLoading);
}
GL11.glPopMatrix();
}
GL11.glColor3f(1F, 1F, 1F);
}
use of riskyken.armourersWorkshop.common.skin.data.SkinPart in project Armourers-Workshop by RiskyKen.
the class SkinPartSerializer method loadSkinPart.
public static SkinPart loadSkinPart(DataInputStream stream, int version) throws IOException, InvalidCubeTypeException {
ISkinPartType skinPart = null;
SkinCubeData cubeData = null;
ArrayList<CubeMarkerData> markerBlocks = null;
if (version < 6) {
skinPart = SkinTypeRegistry.INSTANCE.getSkinPartFromLegacyId(stream.readByte());
if (skinPart == null) {
ModLogger.log(Level.ERROR, "Skin part was null");
throw new IOException("Skin part was null");
}
} else {
String regName = null;
if (version > 12) {
regName = StreamUtils.readString(stream, Charsets.US_ASCII);
} else {
regName = stream.readUTF();
}
if (regName.equals("armourers:skirt.base")) {
regName = "armourers:legs.skirt";
}
if (regName.equals("armourers:bow.base")) {
regName = "armourers:bow.frame1";
}
if (regName.equals("armourers:arrow.base")) {
regName = "armourers:bow.arrow";
}
skinPart = SkinTypeRegistry.INSTANCE.getSkinPartFromRegistryName(regName);
if (skinPart == null) {
ModLogger.log(Level.ERROR, "Skin part was null - reg name: " + regName + " version: " + version);
throw new IOException("Skin part was null - reg name: " + regName + " version: " + version);
}
}
cubeData = new SkinCubeData();
cubeData.readFromStream(stream, version, skinPart);
markerBlocks = new ArrayList<CubeMarkerData>();
if (version > 8) {
int markerCount = stream.readInt();
for (int i = 0; i < markerCount; i++) {
markerBlocks.add(new CubeMarkerData(stream, version));
}
}
return new SkinPart(cubeData, skinPart, markerBlocks);
}
use of riskyken.armourersWorkshop.common.skin.data.SkinPart in project Armourers-Workshop by RiskyKen.
the class BlockSkinnable method isBedFoot.
@Override
public boolean isBedFoot(IBlockAccess world, int x, int y, int z) {
Skin skin = getSkin(world, x, y, z);
if (skin != null) {
for (int i = 0; i < skin.getPartCount(); i++) {
SkinPart part = skin.getParts().get(i);
part.getMarkerCount();
}
}
return false;
}
Aggregations