The Meaning of Life, the Universe, and Everything.
Join Date:
7/2/2013
Posts:
217
Member Details
I am trying to get my textures to fit into my custom armor. But in Techne, when I load the textures, it loads as if its 64 by 32 until I go and push edit. Which then automatically fixes itself to 64 by 64. But when I get the textures into the game, the textures are mess up. As in its still showing as 64 by 32 and not 64 by 64.
I am trying to get my textures to fit into my custom armor. But in Techne, when I load the textures, it loads as if its 64 by 32 until I go and push edit. Which then automatically fixes itself to 64 by 64. But when I get the textures into the game, the textures are mess up. As in its still showing as 64 by 32 and not 64 by 64.
Show us your model class. Your model class is where the texture size is being declared.
ModelAmazoniteArmor:
package JohnX18x.DesertConstuction.models;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
public class ModelAmazoniteArmor extends ModelBiped
{
ModelRenderer SkullFace1;
ModelRenderer SkullFace2;
ModelRenderer SkullJaw1;
ModelRenderer SkullFace3;
ModelRenderer SkullFace4;
ModelRenderer Tooth1;
ModelRenderer Tooth2;
ModelRenderer Tooth3;
ModelRenderer Tooth4;
ModelRenderer SkullRightSide1;
ModelRenderer SkullRightSide2;
ModelRenderer SkullRightSide3;
ModelRenderer SkullLeftSide1;
ModelRenderer SkullLeftSide2;
ModelRenderer SkullLeftSide3;
ModelRenderer SkullBack1;
ModelRenderer SkullBack2;
ModelRenderer SkullBack3;
ModelRenderer SkullTop;
ModelRenderer ShoulderPad1;
ModelRenderer ShoulderPad2;
public ModelAmazoniteArmor(float expand) {
super(expand, 0, 64, 64);
SkullFace1 = new ModelRenderer(this, 23, 43);
SkullFace1.addBox(-4F, -8F, -5F, 8, 2, 1, expand);
SkullFace1.setRotationPoint(0F, 0F, 0F);
SkullFace1.setTextureSize(64, 64);
SkullFace1.mirror = true;
setRotation(SkullFace1, 0F, 0F, 0F);
SkullFace2 = new ModelRenderer(this, 27, 46);
SkullFace2.addBox(-1F, -6F, -5F, 2, 2, 1, expand);
SkullFace2.setRotationPoint(0F, 0F, 0F);
SkullFace2.setTextureSize(64, 64);
SkullFace2.mirror = true;
setRotation(SkullFace2, 0F, 0F, 0F);
SkullJaw1 = new ModelRenderer(this, 23, 49);
SkullJaw1.addBox(-4F, -4F, -5F, 8, 2, 1, expand);
SkullJaw1.setRotationPoint(0F, 0F, 0F);
SkullJaw1.setTextureSize(64, 64);
SkullJaw1.mirror = true;
setRotation(SkullJaw1, 0F, 0F, 0F);
SkullFace3 = new ModelRenderer(this, 33, 46);
SkullFace3.addBox(3F, -6F, -5F, 1, 2, 1, expand);
SkullFace3.setRotationPoint(0F, 0F, 0F);
SkullFace3.setTextureSize(64, 64);
SkullFace3.mirror = true;
setRotation(SkullFace3, 0F, 0F, 0F);
SkullFace4 = new ModelRenderer(this, 23, 46);
SkullFace4.addBox(-4F, -6F, -5F, 1, 2, 1, expand);
SkullFace4.setRotationPoint(0F, 0F, 0F);
SkullFace4.setTextureSize(64, 64);
SkullFace4.mirror = true;
setRotation(SkullFace4, 0F, 0F, 0F);
Tooth1 = new ModelRenderer(this, 23, 52);
Tooth1.addBox(-3.5F, -2F, -5F, 1, 1, 1, expand);
Tooth1.setRotationPoint(0F, 0F, 0F);
Tooth1.setTextureSize(64, 64);
Tooth1.mirror = true;
setRotation(Tooth1, 0F, 0F, 0F);
Tooth2 = new ModelRenderer(this, 35, 52);
Tooth2.addBox(2.5F, -2F, -5F, 1, 1, 1, expand);
Tooth2.setRotationPoint(0F, 0F, 0F);
Tooth2.setTextureSize(64, 64);
Tooth2.mirror = true;
setRotation(Tooth2, 0F, 0F, 0F);
Tooth3 = new ModelRenderer(this, 31, 52);
Tooth3.addBox(0.5F, -2F, -5F, 1, 1, 1, expand);
Tooth3.setRotationPoint(0F, 0F, 0F);
Tooth3.setTextureSize(64, 64);
Tooth3.mirror = true;
setRotation(Tooth3, 0F, 0F, 0F);
Tooth4 = new ModelRenderer(this, 27, 52);
Tooth4.addBox(-1.5F, -2F, -5F, 1, 1, 1, expand);
Tooth4.setRotationPoint(0F, 0F, 0F);
Tooth4.setTextureSize(64, 64);
Tooth4.mirror = true;
setRotation(Tooth4, 0F, 0F, 0F);
SkullRightSide1 = new ModelRenderer(this, 16, 49);
SkullRightSide1.addBox(-5F, -8F, -4F, 1, 6, 2, expand);
SkullRightSide1.setRotationPoint(0F, 0F, 0F);
SkullRightSide1.setTextureSize(64, 64);
SkullRightSide1.mirror = true;
setRotation(SkullRightSide1, 0F, 0F, 0F);
SkullRightSide2 = new ModelRenderer(this, 16, 43);
SkullRightSide2.addBox(-5F, -8F, -2F, 1, 4, 2, expand);
SkullRightSide2.setRotationPoint(0F, 0F, 0F);
SkullRightSide2.setTextureSize(64, 64);
SkullRightSide2.mirror = true;
setRotation(SkullRightSide2, 0F, 0F, 0F);
SkullRightSide3 = new ModelRenderer(this, 6, 43);
SkullRightSide3.addBox(-5F, -8F, 0F, 1, 7, 4, expand);
SkullRightSide3.setRotationPoint(0F, 0F, 0F);
SkullRightSide3.setTextureSize(64, 64);
SkullRightSide3.mirror = true;
setRotation(SkullRightSide3, 0F, 0F, 0F);
SkullLeftSide1 = new ModelRenderer(this, 42, 43);
SkullLeftSide1.addBox(4F, -8F, 0F, 1, 6, 2, expand);
SkullLeftSide1.setRotationPoint(0F, 0F, -4F);
SkullLeftSide1.setTextureSize(64, 64);
SkullLeftSide1.mirror = true;
setRotation(SkullLeftSide1, 0F, 0F, 0F);
SkullLeftSide2 = new ModelRenderer(this, 48, 43);
SkullLeftSide2.addBox(4F, -8F, -2F, 1, 4, 2, expand);
SkullLeftSide2.setRotationPoint(0F, 0F, 0F);
SkullLeftSide2.setTextureSize(64, 64);
SkullLeftSide2.mirror = true;
setRotation(SkullLeftSide2, 0F, 0F, 0F);
SkullLeftSide3 = new ModelRenderer(this, 54, 43);
SkullLeftSide3.addBox(4F, -8F, 0F, 1, 7, 4, expand);
SkullLeftSide3.setRotationPoint(0F, 0F, 0F);
SkullLeftSide3.setTextureSize(64, 64);
SkullLeftSide3.mirror = true;
setRotation(SkullLeftSide3, 0F, 0F, 0F);
SkullBack1 = new ModelRenderer(this, 37, 33);
SkullBack1.addBox(-3F, -8F, 4F, 6, 8, 1, expand);
SkullBack1.setRotationPoint(0F, 0F, 0F);
SkullBack1.setTextureSize(64, 64);
SkullBack1.mirror = true;
setRotation(SkullBack1, 0F, 0F, 0F);
SkullBack2 = new ModelRenderer(this, 33, 33);
SkullBack2.addBox(3F, 1F, 4F, 1, 7, 1, expand);
SkullBack2.setRotationPoint(0F, -9F, 0F);
SkullBack2.setTextureSize(64, 64);
SkullBack2.mirror = true;
setRotation(SkullBack2, 0F, 0F, 0F);
SkullBack3 = new ModelRenderer(this, 51, 33);
SkullBack3.addBox(-4F, -8F, 4F, 1, 7, 1, expand);
SkullBack3.setRotationPoint(0F, 0F, 0F);
SkullBack3.setTextureSize(64, 64);
SkullBack3.mirror = true;
setRotation(SkullBack3, 0F, 0F, 0F);
SkullTop = new ModelRenderer(this, 0, 33);
SkullTop.addBox(-4F, -9F, -4F, 8, 1, 8, expand);
SkullTop.setRotationPoint(0F, 0F, 0F);
SkullTop.setTextureSize(64, 64);
SkullTop.mirror = true;
setRotation(SkullTop, 0F, 0F, 0F);
ShoulderPad1 = new ModelRenderer(this, 46, 55);
ShoulderPad1.addBox(-9F, -1F, -2.5F, 4, 4, 5, expand);
ShoulderPad1.setRotationPoint(0F, 0F, 0F);
ShoulderPad1.setTextureSize(64, 64);
ShoulderPad1.mirror = true;
setRotation(ShoulderPad1, 0F, 0F, 0F);
ShoulderPad2 = new ModelRenderer(this, 27, 55);
ShoulderPad2.addBox(5F, -1F, -2.5F, 4, 4, 5, expand);
ShoulderPad2.setRotationPoint(0F, 0F, 0F);
ShoulderPad2.setTextureSize(64, 64);
ShoulderPad2.mirror = true;
setRotation(ShoulderPad2, 0F, 0F, 0F);
SkullFace1.addChild(SkullFace2);
SkullFace1.addChild(SkullFace3);
SkullFace1.addChild(SkullFace4);
SkullFace2.addChild(SkullJaw1);
SkullJaw1.addChild(Tooth1);
SkullJaw1.addChild(Tooth2);
SkullJaw1.addChild(Tooth3);
SkullJaw1.addChild(Tooth4);
SkullFace3.addChild(SkullLeftSide1);
SkullLeftSide1.addChild(SkullLeftSide2);
SkullLeftSide2.addChild(SkullLeftSide3);
SkullFace4.addChild(SkullRightSide1);
SkullRightSide1.addChild(SkullRightSide2);
SkullRightSide2.addChild(SkullRightSide3);
SkullFace1.addChild(SkullTop);
SkullTop.addChild(SkullBack1);
SkullBack1.addChild(SkullBack2);
SkullBack1.addChild(SkullBack3);
this.bipedHead.addChild(SkullFace1);
this.bipedRightArm.addChild(ShoulderPad1);
this.bipedLeftArm.addChild(ShoulderPad2);
}
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);
}
private void setRotation(ModelRenderer model, float x, float y, float z)
{
model.rotateAngleX = x;
model.rotateAngleY = y;
model.rotateAngleZ = z;
}
}
Is someone going to tell me what wrong with my model? Cause I been waiting for hours.
call ModelBase#textureWidth and ModelBase#textureHeight below your super. set them to your texture image.
What do you mean by that? I put textureWidth and textureHeight below the super. It doesn't change anything.
textureWidth = 64;
textureHeight = 64;
Are you sure that this is right?
Are you sure your texture file is 64 by 64?
Yes both of my textures are 64 by 64
Can you show your armor class then
Here then:
ackage JohnX18x.DesertConstuction.armor;
import JohnX18x.DesertConstruction.resources.References;
import JohnX18x.DesertConstruction.resources.Resource;
import JohnX18x.DesertConstuction.proxy.ProxyClient;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction;
import net.minecraft.item.ItemArmor;
import net.minecraft.item.ItemStack;
public class ItemAmazoniteArmor extends ItemArmor{
public ItemAmazoniteArmor(ArmorMaterial material, int render_idx, int type) {
super(material, render_idx, type);
this.setMaxStackSize(1);
}
@Override
public String getUnlocalizedName(){
return String.format("item.%s%s", Resource.RESOURCE_PREFIX, getUnwrappedUnlocalizedName(super.getUnlocalizedName()));
}
@Override
public String getUnlocalizedName(ItemStack itemstack){
return String.format("item.%s%s", Resource.RESOURCE_PREFIX, getUnwrappedUnlocalizedName(super.getUnlocalizedName()));
}
protected String getUnwrappedUnlocalizedName(String unlocalizedName){
return unlocalizedName.substring(unlocalizedName.indexOf('.') + 1);
}
@Override
@SideOnly(Side.CLIENT)
public void registerIcons(IIconRegister iconRegister){
this.itemIcon = iconRegister.registerIcon(this.getUnlocalizedName().substring(this.getUnlocalizedName().indexOf('.') + 1));
}
@Override
@SideOnly(Side.CLIENT)
public ModelBiped getArmorModel (EntityLivingBase entityLiving, ItemStack itemstack, int armorSlot){
ModelBiped armorModel = ProxyClient.armorModels.get(this);
if(armorModel != null){
armorModel.bipedHead.showModel = armorSlot == 0;
armorModel.bipedHeadwear.showModel = false;
armorModel.bipedBody.showModel = armorSlot == 1 || armorSlot == 2;
armorModel.bipedRightArm.showModel = armorSlot == 1;
armorModel.bipedLeftArm.showModel = armorSlot == 1;
armorModel.bipedRightLeg.showModel = armorSlot == 2 || armorSlot == 3;
armorModel.bipedLeftLeg.showModel = armorSlot == 2 || armorSlot == 3;
armorModel.isSneak = entityLiving.isSneaking();
armorModel.isRiding = entityLiving.isRiding();
armorModel.isChild = entityLiving.isChild();
armorModel.heldItemRight = 0;
armorModel.aimedBow = false;
EntityPlayer player = (EntityPlayer)entityLiving;
ItemStack held_item = player.getEquipmentInSlot(0);
if (held_item != null){
armorModel.heldItemRight = 1;
if (player.getItemInUseCount() > 0){
EnumAction enumaction = held_item.getItemUseAction();
if (enumaction == EnumAction.bow){
armorModel.aimedBow = true;
}else if (enumaction == EnumAction.block){
armorModel.heldItemRight = 3;
}
}
}
}
return armorModel;
}
@Override
public String getArmorTexture(ItemStack stack, Entity entity, int slot, String layer){
String name = this.getUnwrappedUnlocalizedName(super.getUnlocalizedName());
name = name.substring(0, name.indexOf('_'));
return String.format("%s:textures/models/armor/%s_layer_%d.png", References.mod_id, name, slot == 2 ? 2 : 1);
}
}