use of riskyken.armourersWorkshop.api.common.skin.data.ISkinPointer in project Armourers-Workshop by RiskyKen.
the class SkinDataHandler method readSkinPointerFromCompound.
@Override
public ISkinPointer readSkinPointerFromCompound(NBTTagCompound compound) {
if (!SkinNBTHelper.compoundHasSkinData(compound)) {
return null;
}
SkinPointer sp = new SkinPointer();
sp.readFromCompound(compound);
return sp;
}
use of riskyken.armourersWorkshop.api.common.skin.data.ISkinPointer in project Armourers-Workshop by RiskyKen.
the class GuiDyeTable method drawGuiContainerForegroundLayer.
@Override
protected void drawGuiContainerForegroundLayer(int mouseX, int mouseY) {
GuiHelper.renderLocalizedGuiName(this.fontRendererObj, this.xSize, tileEntity.getInventoryName());
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 46, this.ySize - 96 + 2, 4210752);
Slot slot = (Slot) inventorySlots.inventorySlots.get(45);
ItemStack skinStack = slot.getStack();
ISkinPointer skinPointer = SkinNBTHelper.getSkinPointerFromStack(skinStack);
if (skinPointer != null) {
GL11.glPushMatrix();
GL11.glColor4f(1F, 1F, 1F, 1F);
RenderHelper.enableStandardItemLighting();
float boxX = 242.5F;
float boxY = 102;
float scale = 11F;
GL11.glTranslatef((float) boxX, (float) boxY, 500.0F);
GL11.glScalef(-scale, scale, scale);
float rotation = (float) ((double) System.currentTimeMillis() / 10 % 360);
float fade = (float) ((double) System.currentTimeMillis() / 400 % Math.PI * 2);
float change = (float) Math.sin(fade);
float alpha = change * 50;
// ModLogger.log(alpha);
GL11.glRotatef(-20, 1, 0, 0);
GL11.glRotatef(rotation, 0, 1, 0);
// GL11.glEnable(GL11.GL_ALPHA_TEST);
// GL11.glEnable(GL11.GL_DEPTH_TEST);
// ModRenderHelper.enableAlphaBlend();
// GL11.glDisable(GL11.GL_CULL_FACE);
// GL11.glDisable(GL11.GL_DEPTH_TEST);
drawRect(guiLeft, guiTop, guiLeft + 50, guiTop + 50, 0xFFFFFFFF);
int dyeSlot = mouseOverDyeSlot(mouseX, mouseY);
dyeSlot = -1;
if (dyeSlot != -1) {
GL11.glPushMatrix();
// GL11.glEnable(GL11.GL_CULL_FACE);
SkinItemRenderHelper.renderSkinAsItem(skinPointer, true, false, 140, 176);
// ItemStackRenderHelper.renderItemModelFromSkinPointer(skinPointer, true, false);
GL11.glPopMatrix();
GL11.glPopMatrix();
Color c = new Color(198, 198, 198, (int) (240));
RenderHelper.disableStandardItemLighting();
GL11.glDisable(GL11.GL_DEPTH_TEST);
drawRect(152, 20, 250, 95, c.getRGB());
GL11.glColor4f(1, 1, 1, 1);
GL11.glEnable(GL11.GL_DEPTH_TEST);
RenderHelper.enableStandardItemLighting();
GL11.glPushMatrix();
GL11.glTranslatef((float) boxX, (float) boxY, 200.0F);
GL11.glScalef(-scale, scale, scale);
GL11.glRotatef(-20, 1, 0, 0);
GL11.glRotatef(rotation, 0, 1, 0);
for (int i = 0; i < 8; i++) {
if (i != dyeSlot) {
skinPointer.getSkinDye().addDye(i, rolloverDyes[dyeSlot].getDyeColour(i));
}
}
GL11.glColor3f(1F, 1F, 1F);
SkinItemRenderHelper.renderSkinAsItem(skinPointer, true, false, 140, 176);
} else {
ModRenderHelper.enableAlphaBlend();
SkinItemRenderHelper.renderSkinAsItem(skinPointer, true, false, 140, 176);
}
GL11.glPopMatrix();
}
GL11.glDisable(GL11.GL_DEPTH_TEST);
}
use of riskyken.armourersWorkshop.api.common.skin.data.ISkinPointer in project Armourers-Workshop by RiskyKen.
the class SkinnableEntityCreeperRenderer method renderEquipmentType.
private void renderEquipmentType(EntityLivingBase entity, RendererLivingEntity renderer, ISkinType skinType, IEntityEquipment equipmentData) {
if (equipmentData.haveEquipment(skinType, 0)) {
ISkinPointer skinPointer = equipmentData.getSkinPointer(skinType, 0);
Skin skin = ClientSkinCache.INSTANCE.getSkin(skinPointer);
if (skin == null) {
return;
}
GL11.glEnable(GL11.GL_NORMALIZE);
float scale = 0.0625F;
for (int i = 0; i < skin.getParts().size(); i++) {
SkinPartRenderer.INSTANCE.renderPart(skin.getParts().get(i), scale, skinPointer.getSkinDye(), null, false);
}
GL11.glDisable(GL11.GL_NORMALIZE);
}
}
use of riskyken.armourersWorkshop.api.common.skin.data.ISkinPointer in project Armourers-Workshop by RiskyKen.
the class SkinnableEntityGhastRenderer method renderEquipmentType.
private void renderEquipmentType(EntityLivingBase entity, RendererLivingEntity renderer, ISkinType skinType, IEntityEquipment equipmentData) {
if (equipmentData.haveEquipment(skinType, 0)) {
ISkinPointer skinPointer = equipmentData.getSkinPointer(skinType, 0);
Skin skin = ClientSkinCache.INSTANCE.getSkin(skinPointer);
if (skin == null) {
return;
}
GL11.glEnable(GL11.GL_NORMALIZE);
float scale = 1F / 16F;
for (int i = 0; i < skin.getParts().size(); i++) {
SkinPartRenderer.INSTANCE.renderPart(skin.getParts().get(i), scale, skinPointer.getSkinDye(), null, false);
}
GL11.glDisable(GL11.GL_NORMALIZE);
}
}
use of riskyken.armourersWorkshop.api.common.skin.data.ISkinPointer 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