Implemented wiiv's new cloak models. Also fixed render issues regarding them and the flugel tiara.

This commit is contained in:
Vasco Lavos committed 2016-09-29 21:06:53 +01:00
1 parent f6653b40be
commit 87266364c8
12 files changed
+93 -61

No files matched your search

@@ -103,6 +103,8 @@ public final class LibResources {
public static final String MODEL_KNOCKBACK_BELT = PREFIX_MODEL + "knockbackBelt.png";
public static final String MODEL_HOLY_CLOAK = PREFIX_MODEL + "holyCloak.png";
public static final String MODEL_UNHOLY_CLOAK = PREFIX_MODEL + "unholyCloak.png";
public static final String MODEL_HOLY_CLOAK_GLOW = PREFIX_MODEL + "holyCloakGlow.png";
public static final String MODEL_UNHOLY_CLOAK_GLOW = PREFIX_MODEL + "unholyCloakGlow.png";
public static final String MODEL_CORPOREA_INDEX = PREFIX_MODEL + "corporeaIndex.png";
public static final String MODEL_INVISIBLE_ARMOR = PREFIX_MODEL + "invisibleArmor.png";
public static final String MODEL_PINK_WITHER = PREFIX_MODEL + "pinkWither.png";
@@ -0,0 +1,46 @@
package vazkii.botania.client.model;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
/**
* armor_cloak - wiiv
* Created using Tabula 4.1.1
*/
public class ModelCloak extends ModelBase {
public ModelRenderer armRpauldron;
public ModelRenderer armLpauldron;
public ModelRenderer helm;
public ModelCloak() {
textureWidth = 64;
textureHeight = 64;
armLpauldron = new ModelRenderer(this, 0, 15);
armLpauldron.mirror = true;
armLpauldron.setRotationPoint(0.0F, 0.0F, -0.0F);
armLpauldron.addBox(-1.0F, 0.0F, -5.0F, 9, 20, 9, 0.0F);
setRotateAngle(armLpauldron, 0.08726646259971647F, -0.2617993877991494F, -0.17453292519943295F);
armRpauldron = new ModelRenderer(this, 0, 15);
armRpauldron.setRotationPoint(0.0F, 0.0F, 0.0F);
armRpauldron.addBox(-8.0F, 0.0F, -5.0F, 9, 20, 9, 0.0F);
setRotateAngle(armRpauldron, 0.08726646259971647F, 0.2617993877991494F, 0.17453292519943295F);
helm = new ModelRenderer(this, 0, 0);
helm.setRotationPoint(0.0F, 0.0F, 0.0F);
helm.addBox(-4.5F, -3.0F, -5.5F, 9, 4, 11, 0.0F);
setRotateAngle(helm, 0.2617993877991494F, 0.0F, 0.0F);
}
public void render(float f5) {
armLpauldron.render(f5);
armRpauldron.render(f5);
helm.render(f5);
}
public void setRotateAngle(ModelRenderer modelRenderer, float x, float y, float z) {
modelRenderer.rotateAngleX = x;
modelRenderer.rotateAngleY = y;
modelRenderer.rotateAngleZ = z;
}
}
@@ -354,6 +354,10 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem, IBaub
int light = 15728880;
int lightmapX = light % 65536;
int lightmapY = light / 65536;
float lbx = OpenGlHelper.lastBrightnessX;
float lby = OpenGlHelper.lastBrightnessY;
switch(meta) {
case 1 : { // Jibril
h = 0.4F;
@@ -451,6 +455,8 @@ public class ItemFlightTiara extends ItemBauble implements IManaUsingItem, IBaub
GlStateManager.color(1F, 1F, 1F);
GlStateManager.popMatrix();
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lbx, lby);
}
} else if(meta == 1) // Jibril's Halo
renderHalo(player, partialTicks);
@@ -14,8 +14,10 @@ import baubles.api.BaubleType;
import baubles.common.container.InventoryBaubles;
import baubles.common.lib.PlayerHandler;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.EntityEquipmentSlot;
@@ -30,6 +32,7 @@ import net.minecraftforge.fml.relauncher.SideOnly;
import vazkii.botania.api.item.IBaubleRender;
import vazkii.botania.api.sound.BotaniaSoundEvents;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.client.model.ModelCloak;
import vazkii.botania.common.Botania;
import vazkii.botania.common.core.helper.ItemNBTHelper;
import vazkii.botania.common.lib.LibItemNames;
@@ -37,8 +40,10 @@ import vazkii.botania.common.lib.LibItemNames;
public class ItemHolyCloak extends ItemBauble implements IBaubleRender {
private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_HOLY_CLOAK);
private static final ResourceLocation textureGlow = new ResourceLocation(LibResources.MODEL_HOLY_CLOAK_GLOW);
@SideOnly(Side.CLIENT)
private static ModelBiped model;
private static ModelCloak model;
private static final String TAG_COOLDOWN = "cooldown";
private static final String TAG_IN_EFFECT = "inEffect";
@@ -121,25 +126,40 @@ public class ItemHolyCloak extends ItemBauble implements IBaubleRender {
}
@SideOnly(Side.CLIENT)
ResourceLocation getRenderTexture() {
ResourceLocation getCloakTexture() {
return texture;
}
@SideOnly(Side.CLIENT)
ResourceLocation getCloakGlowTexture() {
return textureGlow;
}
@Override
@SideOnly(Side.CLIENT)
public void onPlayerBaubleRender(ItemStack stack, EntityPlayer player, RenderType type, float partialTicks) {
if(type == RenderType.BODY) {
Minecraft.getMinecraft().renderEngine.bindTexture(getRenderTexture());
Helper.rotateIfSneaking(player);
boolean armor = player.getItemStackFromSlot(EntityEquipmentSlot.CHEST) != null;
GlStateManager.translate(0F, armor ? -0.07F : -0.01F, 0F);
float s = 0.1F;
float s = 1F / 16F;
GlStateManager.scale(s, s, s);
if(model == null)
model = new ModelBiped();
model.bipedBody.render(1F);
model = new ModelCloak();
GlStateManager.enableLighting();
GlStateManager.enableRescaleNormal();
Minecraft.getMinecraft().renderEngine.bindTexture(getCloakTexture());
model.render(1F);
int light = 15728880;
int lightmapX = light % 65536;
int lightmapY = light / 65536;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lightmapX, lightmapY);
Minecraft.getMinecraft().renderEngine.bindTexture(getCloakGlowTexture());
model.render(1F);
}
}
@@ -21,6 +21,8 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundCategory;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraftforge.event.entity.living.LivingHurtEvent;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import vazkii.botania.api.sound.BotaniaSoundEvents;
import vazkii.botania.client.lib.LibResources;
import vazkii.botania.common.Botania;
@@ -31,6 +33,7 @@ import java.util.List;
public class ItemUnholyCloak extends ItemHolyCloak {
private static final ResourceLocation texture = new ResourceLocation(LibResources.MODEL_UNHOLY_CLOAK);
private static final ResourceLocation textureGlow = new ResourceLocation(LibResources.MODEL_UNHOLY_CLOAK_GLOW);
public ItemUnholyCloak() {
super(LibItemNames.UNHOLY_CLOAK);
@@ -61,9 +64,14 @@ public class ItemUnholyCloak extends ItemHolyCloak {
return false;
}
@Override
ResourceLocation getRenderTexture() {
@SideOnly(Side.CLIENT)
ResourceLocation getCloakTexture() {
return texture;
}
@SideOnly(Side.CLIENT)
ResourceLocation getCloakGlowTexture() {
return textureGlow;
}
}