use of riskyken.armourersWorkshop.common.skin.data.SkinPointer in project Armourers-Workshop by RiskyKen.
the class GuiGlobalLibraryPanelSkinInfo method drawPreviewBox.
public void drawPreviewBox(Skin skin, int boxX, int boxY, int boxWidth, int boxHeight, int mouseX, int mouseY, float partialTickTime) {
drawGradientRect(boxX, boxY, boxX + boxWidth, boxY + boxHeight, 0x22888888, 0x22CCCCCC);
if (skin != null) {
int iconSize = Math.min(boxWidth, boxHeight);
ScaledResolution scaledResolution = new ScaledResolution(mc, mc.displayWidth, mc.displayHeight);
float scale = 10 - scaledResolution.getScaleFactor();
GL11.glPushMatrix();
GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
GL11.glTranslatef(boxX + boxWidth / 2, boxY + boxHeight / 2, 500.0F);
GL11.glScalef((float) (-scale), (float) scale, (float) scale);
GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(20.0F, 1.0F, 0.0F, 0.0F);
float rotation = (float) ((double) System.currentTimeMillis() / 10 % 360);
GL11.glRotatef(rotation, 0.0F, 1.0F, 0.0F);
RenderHelper.enableStandardItemLighting();
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glEnable(GL11.GL_NORMALIZE);
GL11.glEnable(GL11.GL_COLOR_MATERIAL);
ModRenderHelper.enableAlphaBlend();
SkinItemRenderHelper.renderSkinAsItem(skin, new SkinPointer(skin), true, false, boxWidth, boxHeight);
GL11.glPopAttrib();
GL11.glPopMatrix();
}
}
use of riskyken.armourersWorkshop.common.skin.data.SkinPointer in project Armourers-Workshop by RiskyKen.
the class SkinModelRenderer method getPlayerCustomArmour.
public Skin getPlayerCustomArmour(Entity entity, ISkinType skinType, int slotIndex) {
if (!(entity instanceof AbstractClientPlayer)) {
return null;
}
AbstractClientPlayer player = (AbstractClientPlayer) entity;
EntityEquipmentData equipmentData = playerEquipmentMap.get(new PlayerPointer(player));
// Look for skinned armourer.
if (skinType.getVanillaArmourSlotId() >= 0 && skinType.getVanillaArmourSlotId() < 4 && slotIndex == 0) {
int slot = 3 - skinType.getVanillaArmourSlotId();
ItemStack armourStack = player.getCurrentArmor(slot);
if (SkinNBTHelper.stackHasSkinData(armourStack)) {
SkinPointer sp = SkinNBTHelper.getSkinPointerFromStack(armourStack);
return getCustomArmourItemData(sp);
}
}
// No skinned armour found checking the equipment wardrobe.
if (equipmentData == null) {
return null;
}
if (!equipmentData.haveEquipment(skinType, slotIndex)) {
return null;
}
ISkinPointer skinPointer = equipmentData.getSkinPointer(skinType, slotIndex);
return getCustomArmourItemData(skinPointer);
}
use of riskyken.armourersWorkshop.common.skin.data.SkinPointer in project Armourers-Workshop by RiskyKen.
the class SkinModelRenderer method getPlayerDyeData.
public ISkinDye getPlayerDyeData(Entity entity, ISkinType skinType, int slotIndex) {
if (!(entity instanceof AbstractClientPlayer)) {
return null;
}
AbstractClientPlayer player = (AbstractClientPlayer) entity;
EntityEquipmentData equipmentData = playerEquipmentMap.get(new PlayerPointer(player));
// Look for skinned armourer.
if (skinType.getVanillaArmourSlotId() >= 0 && skinType.getVanillaArmourSlotId() < 4 && slotIndex == 0) {
int slot = 3 - skinType.getVanillaArmourSlotId();
ItemStack armourStack = player.getCurrentArmor(slot);
if (SkinNBTHelper.stackHasSkinData(armourStack)) {
SkinPointer sp = SkinNBTHelper.getSkinPointerFromStack(armourStack);
return sp.getSkinDye();
}
}
// No skinned armour found checking the equipment wardrobe.
if (equipmentData == null) {
return null;
}
if (!equipmentData.haveEquipment(skinType, slotIndex)) {
return null;
}
ISkinDye skinDye = equipmentData.getSkinPointer(skinType, slotIndex).getSkinDye();
return skinDye;
}
use of riskyken.armourersWorkshop.common.skin.data.SkinPointer in project Armourers-Workshop by RiskyKen.
the class SkinModelRenderer method renderEquipmentPartFromStack.
public boolean renderEquipmentPartFromStack(Entity entity, ItemStack stack, ModelBiped modelBiped, byte[] extraColours, double distance, boolean doLodLoading) {
SkinPointer skinPointer = SkinNBTHelper.getSkinPointerFromStack(stack);
if (skinPointer == null) {
return false;
}
Skin data = getCustomArmourItemData(skinPointer);
return renderEquipmentPart(entity, modelBiped, data, skinPointer.getSkinDye(), extraColours, distance, doLodLoading);
}
use of riskyken.armourersWorkshop.common.skin.data.SkinPointer in project Armourers-Workshop by RiskyKen.
the class EquipmentRenderHandler method requestSkinModelFromSever.
@Override
public void requestSkinModelFromSever(ItemStack stack) {
if (!SkinNBTHelper.stackHasSkinData(stack)) {
return;
}
SkinPointer skinPointer = SkinNBTHelper.getSkinPointerFromStack(stack);
requestSkinModelFromSever(skinPointer);
}
Aggregations