It has been solved.
Hello there, Japanga the main developer of the "Game of Thrones Mod: Winter is Coming to Minecraft" Mod here, i've encountered an issue with my mod.
I'm attempting to make a biped NPC that utilizes a custom biped model but can still have weapons and armor rendered on it, simple right? Well almost everything is going perfect except for a rather apparent texture bug that occurs with the head(pictures below)
Does anyone quite know how to fix this? Here's my code if anyone is needing to look at it to help pinpoint the issue:
ModelCapeBiped:
// Date: 10/29/2014 12:17:10 PM
// Template version 1.1
// Java generated by Techne
// Keep in mind that you still need to fill in some blanks
// - ZeuX
Problem is only with helmet texture or with model too?
The helmet works fine, it's a problem with the model, all the other parts of the body look fine but the issue seems to only be present with the head, leading me to believe it's an issue involving the headwear texture space that's causing it.
(Edit: the legs also appear to have some texture issues, so it appears to be a general entire texture issue rather than the head)
Hello there, Japanga the main developer of the "Game of Thrones Mod: Winter is Coming to Minecraft" Mod here, i've encountered an issue with my mod.
I'm attempting to make a biped NPC that utilizes a custom biped model but can still have weapons and armor rendered on it, simple right? Well almost everything is going perfect except for a rather apparent texture bug that occurs with the head(pictures below)
Does anyone quite know how to fix this? Here's my code if anyone is needing to look at it to help pinpoint the issue:
ModelCapeBiped:
// Template version 1.1
// Java generated by Techne
// Keep in mind that you still need to fill in some blanks
// - ZeuX
package gameofthrones.entity;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.util.MathHelper;
public class ModelCapeBiped extends ModelBiped
{
ModelRenderer head;
ModelRenderer body;
ModelRenderer rightarm;
ModelRenderer leftarm;
ModelRenderer rightleg;
ModelRenderer leftleg;
ModelRenderer cloak;
public boolean isSneak;
/** Records whether the model should be rendered aiming a bow. */
public boolean aimedBow;
public ModelCapeBiped()
{
textureWidth = 64;
textureHeight = 64;
head = new ModelRenderer(this, 0, 0);
head.addBox(-4F, -8F, -4F, 8, 8, 8);
head.setRotationPoint(0F, 0F, 0F);
head.setTextureSize(64, 64);
head.mirror = true;
setRotation(head, 0F, 0F, 0F);
body = new ModelRenderer(this, 16, 16);
body.addBox(-4F, 0F, -2F, 8, 12, 4);
body.setRotationPoint(0F, 0F, 0F);
body.setTextureSize(64, 64);
body.mirror = true;
setRotation(body, 0F, 0F, 0F);
rightarm = new ModelRenderer(this, 40, 16);
rightarm.addBox(-3F, -2F, -2F, 4, 12, 4);
rightarm.setRotationPoint(-5F, 2F, 0F);
rightarm.setTextureSize(64, 64);
rightarm.mirror = true;
setRotation(rightarm, 0F, 0F, 0F);
leftarm = new ModelRenderer(this, 40, 16);
leftarm.addBox(-1F, -2F, -2F, 4, 12, 4);
leftarm.setRotationPoint(5F, 2F, 0F);
leftarm.setTextureSize(64, 64);
leftarm.mirror = true;
setRotation(leftarm, 0F, 0F, 0F);
rightleg = new ModelRenderer(this, 0, 16);
rightleg.addBox(-2F, 0F, -2F, 4, 12, 4);
rightleg.setRotationPoint(-2F, 12F, 0F);
rightleg.setTextureSize(64, 64);
rightleg.mirror = true;
setRotation(rightleg, 0F, 0F, 0F);
leftleg = new ModelRenderer(this, 0, 16);
leftleg.addBox(-2F, 0F, -2F, 4, 12, 4);
leftleg.setRotationPoint(2F, 12F, 0F);
leftleg.setTextureSize(64, 64);
leftleg.mirror = true;
setRotation(leftleg, 0F, 0F, 0F);
cloak = new ModelRenderer(this, 0, 34);
cloak.addBox(0F, 0F, 0F, 12, 21, 1);
cloak.setRotationPoint(-6F, 0F, 2F);
cloak.setTextureSize(64, 64);
cloak.mirror = true;
setRotation(cloak, 0.1487144F, 0F, 0F);
}
@Override
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
{
super.render(entity, f, f1, f2, f3, f4, f5);
setRotationAngles(f, f1, f2, f3, f4, f5, entity);
head.render(f5);
body.render(f5);
rightarm.render(f5);
leftarm.render(f5);
rightleg.render(f5);
leftleg.render(f5);
cloak.render(f5);
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
@Override
public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity)
{
super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity);
this.head.rotateAngleY = par4 / (180F / (float)Math.PI);
this.head.rotateAngleX = par5 / (180F / (float)Math.PI);
this.rightarm.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 2.0F * par2 * 0.5F;
this.leftarm.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 2.0F * par2 * 0.5F;
this.rightarm.rotateAngleZ = 0.0F;
this.leftarm.rotateAngleZ = 0.0F;
this.rightleg.rotateAngleX = MathHelper.cos(par1 * 0.6662F) * 1.4F * par2;
this.leftleg.rotateAngleX = MathHelper.cos(par1 * 0.6662F + (float)Math.PI) * 1.4F * par2;
this.rightleg.rotateAngleY = 0.0F;
this.leftleg.rotateAngleY = 0.0F;
if (this.heldItemLeft != 0)
{
this.leftarm.rotateAngleX = this.leftarm.rotateAngleX * 0.5F - ((float)Math.PI / 10F) * (float)this.heldItemLeft;
}
if (this.heldItemRight != 0)
{
this.rightarm.rotateAngleX = this.rightarm.rotateAngleX * 0.5F - ((float)Math.PI / 10F) * (float)this.heldItemRight;
}
}
}
RenderGoldcloak:
import org.lwjgl.opengl.GL11;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.entity.RenderBiped;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT)
public class RenderGoldCloak extends RenderBiped
{
privatestaticfinal ResourceLocation Your_Texture = new ResourceLocation("got:textures/entity/GoldCloak.png"); //refers to:assets/yourmod/textures/entity/yourtexture.png
public RenderGoldCloak(ModelCapeBiped par1ModelBase, float par2)
{
super(par1ModelBase, par2);
}
protected ResourceLocation getEntityTexture(Entity par1Entity)
{
returnYour_Texture;
}
@Override
protected ResourceLocation func_110775_a(Entity entity) {
// TODO Auto-generated method stub
returnYour_Texture;
}
}
Thank you for you're time and if you know a solution please let me know.
The helmet works fine, it's a problem with the model, all the other parts of the body look fine but the issue seems to only be present with the head, leading me to believe it's an issue involving the headwear texture space that's causing it.
(Edit: the legs also appear to have some texture issues, so it appears to be a general entire texture issue rather than the head)