Jump to content

Mob doesn't render correct


joost_96

Recommended Posts

when i test my mob it looks lik this:

https://www.dropbox.com/s/r86khmwmaazdzj9/2012-11-19_16.55.49.png

i dont know what is wrong it doesn't gives me any errors

 

and i just techne to make the model but i dont think that is the problem because it works with somebody else that used modloader

 

this are some classes that are relevant

EntitySanta

 

import net.minecraft.src.EntityAISwimming;
import net.minecraft.src.EntityAIWander;
import net.minecraft.src.EntityAgeable;
import net.minecraft.src.EntityAnimal;
import net.minecraft.src.EntityMob;
import net.minecraft.src.World;

public class EntitySanta extends EntityMob
{

public EntitySanta(World par1World) {
	super(par1World);
	this.texture = "/ChristmasMod/Santa.png";
	this.moveSpeed = 0.25F;
	this.tasks.addTask(0, new EntityAISwimming(this));
	this.tasks.addTask(0, new EntityAIWander(this, 0.25F));
}
protected boolean isAIEnabled()
{
	return true;
}
protected String getLivingSound()
{
	return "mob.zombie.say";
}

protected String getHurtSound()
{
	return "mob.zombie.hurt";
}

protected String getDeathSound()
{
	return "mob.zombie.death";
}

protected void playStepSound(int par1, int par2, int par3, int par4)
{
	this.worldObj.playSoundAtEntity(this, "mob.zombie.step", 0.15F, 1.0F);
}

@Override
public int getMaxHealth() {
	return 20;
}

}

 

CommonProxy

 


import net.minecraft.src.EnumRarity;

public class CommonProxy 

{
public void registerRender() {


}
  
}

 

MainMod file

 

import java.awt.Color;
import java.util.EnumSet;

import net.minecraft.server.MinecraftServer;
import net.minecraft.src.*;
import net.minecraftforge.client.MinecraftForgeClient;
import cpw.mods.fml.common.FMLCommonHandler;
import cpw.mods.fml.common.Mod;
import cpw.mods.fml.common.Side;
import cpw.mods.fml.common.TickType;
import cpw.mods.fml.common.network.NetworkMod;
import cpw.mods.fml.common.Mod.Init;
import cpw.mods.fml.common.event.FMLInitializationEvent;
import cpw.mods.fml.common.registry.EntityRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.common.registry.LanguageRegistry;
import cpw.mods.fml.common.registry.TickRegistry;
import cpw.mods.fml.common.SidedProxy;
import net.minecraftforge.common.EnumHelper;

@Mod(modid = "ChristmasMod", name = "ChristmasMod", version = "0.3")
@NetworkMod(clientSideRequired = true, serverSideRequired = false)

public class ChristmasMod {


//lots of public static block of some blocks

@SidedProxy(clientSide = "ChristmasMod.client.ClientProxy", serverSide = "ChristmasMod.common.CommonProxy")
public static CommonProxy proxy;
@Init
public void load(FMLInitializationEvent event)
{
	proxy.registerRender();

	LanguageRegistry.instance().addStringLocalization("entity.Santa.name", "en_US", "Santa");
	EntityRegistry.registerGlobalEntityID(EntitySanta.class, "Santa", ModLoader.getUniqueEntityId(), 11 ,115);

//lots of block register stuff
}
}

 

ClientProxy

 

import ChristmasMod.common.CommonProxy;
import ChristmasMod.common.EntitySanta;
import net.minecraft.src.RenderLiving;
import net.minecraftforge.client.MinecraftForgeClient;
import cpw.mods.fml.client.registry.RenderingRegistry;

public class ClientProxy extends CommonProxy {

   @Override
   public void registerRender()
   {
       
   
	MinecraftForgeClient.preloadTexture("/ChristmasMod/terrain.png");
	MinecraftForgeClient.preloadTexture("/ChristmasMod/item.png");
	MinecraftForgeClient.preloadTexture("/ChristmasMod/SSuit_1.png");
	MinecraftForgeClient.preloadTexture("/ChristmasMod/SSuit_2.png");
	MinecraftForgeClient.preloadTexture("/ChristmasMod/Santa.png");

	RenderingRegistry.registerEntityRenderingHandler(EntitySanta.class, new RenderLiving(new ModelSanta(), 0.5F));

}

}

 

ModelSanta

 

// Date: 19-11-2012 18:50:03
// Template version 1.1
// Java generated by Techne
// Keep in mind that you still need to fill in some blanks
// - ZeuX






package ChristmasMod.client;

import net.minecraft.src.Entity;
import net.minecraft.src.MathHelper;
import net.minecraft.src.ModelBase;
import net.minecraft.src.ModelRenderer;

public class ModelSanta extends ModelBase
{
  //fields
    ModelRenderer head;
    ModelRenderer body;
    ModelRenderer rightarm;
    ModelRenderer leftarm;
    ModelRenderer rightleg;
    ModelRenderer leftleg;
    ModelRenderer Neck;
    ModelRenderer Shape1;
  
  public ModelSanta()
  {
    textureWidth = 128;
    textureHeight = 64;
    
      head = new ModelRenderer(this, 0, 0);
      head.addBox(-4F, -9F, -4F, 8, 8, ;
      head.setRotationPoint(0F, 0F, 1F);
      head.setTextureSize(128, 64);
      head.mirror = true;
      setRotation(head, 0F, 0F, 0F);
      body = new ModelRenderer(this, 0, 44);
      body.addBox(-4F, 0F, -2F, 8, 12, 7);
      body.setRotationPoint(0F, 0F, -1F);
      body.setTextureSize(128, 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(128, 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(128, 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(128, 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(128, 64);
      leftleg.mirror = true;
      setRotation(leftleg, 0F, 0F, 0F);
      Neck = new ModelRenderer(this, 32, 0);
      Neck.addBox(0F, 0F, 0F, 6, 1, 5);
      Neck.setRotationPoint(-3F, -1F, -2F);
      Neck.setTextureSize(128, 64);
      Neck.mirror = true;
      setRotation(Neck, 0F, 0F, 0F);
      Shape1 = new ModelRenderer(this, 16, 16);
      Shape1.addBox(0F, 0F, 0F, 8, 2, 0);
      Shape1.setRotationPoint(-4F, -1F, -3F);
      Shape1.setTextureSize(128, 64);
      Shape1.mirror = true;
      setRotation(Shape1, 0F, 0F, 0F);
  }
  
  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);
    head.render(f5);
    body.render(f5);
    rightarm.render(f5);
    leftarm.render(f5);
    rightleg.render(f5);
    leftleg.render(f5);
    Neck.render(f5);
    Shape1.render(f5);
  }
  
  private void setRotation(ModelRenderer model, float x, float y, float z)
  {
    model.rotateAngleX = x;
    model.rotateAngleY = y;
    model.rotateAngleZ = z;
  }
  
  public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5)
  {
  super.setRotationAngles(f, f1, f2, f3, f4, f5, null);
  rightleg.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.0F * f1;
  leftleg.rotateAngleX = MathHelper.cos(f * 0.6662F + (float)Math.PI) * 1.0F * f1;
  rightarm.rotateAngleX = MathHelper.cos(f * 1.3324F) * 1.0F * f1;
  leftarm.rotateAngleX = MathHelper.cos(f * 1.3324F + (float)Math.PI) * 1.0F * f1;
  }
}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.