Jump to content

Recommended Posts

Posted

hello guys,

I have made a mob. I have registered which model it must take but it is a white cube.

And I dont understand what I am doing wrong.

Please help.

 

Here are the classes that do something.

 

main class:

@Mod(modid = R.m, name = R.m ,version = R.v)

public class Main {
@EventHandler
public void PreInit(FMLPreInitializationEvent preEvent){
	Tblocks.load();
	Tblocks.RegisterItems();
	proxy.RegisterRenderThings();

}
@SidedProxy(clientSide = "terriblethings.main.ClientProxy", serverSide = "terriblethings.main.ServerProxy")
public static ServerProxy proxy;

@EventHandler
public void Init(FMLInitializationEvent event){
	Tworldgen.load();
	EntityHandler.RegisterMonsters(EntityEnderhunter.class, "enderhunter");

}
@EventHandler
public void postInit(FMLPostInitializationEvent event){

}
public static int i;
public static int j;
public static int k;

}

 

Here is a class I use to write shorter in other classes:

public class R {

public static final String m = "terriblethings";
public static final String v = "1.7.2.0.0.1 Alpha";
public static final String t = R.m + ":";

}

 

Here is the clientproxy:

public class ClientProxy extends ServerProxy{

public void registerRenderThings(){
	RenderingRegistry.registerEntityRenderingHandler(EntityEnderhunter.class, new RenderEnderhunter(new ModelMinotaur(), 0.3F));

}

}

 

here is the serverproxy:

public class ServerProxy {
public void RegisterRenderThings(){

}

}

My entity handler:

public class EntityHandler {
public static void RegisterMonsters(Class entityClass, String name){
	int entityId = EntityRegistry.findGlobalUniqueEntityId();
	long x = name.hashCode();
	Random random = new Random(x);
	int mainColor = random.nextInt() * 16777215;
	int subColor = random.nextInt() * 16777215;
	EntityRegistry.registerGlobalEntityID(entityClass, name, entityId);
	EntityRegistry.addSpawn(entityClass, 50, 2, 4, EnumCreatureType.monster, BiomeGenBase.birchForest, BiomeGenBase.birchForestHills, BiomeGenBase.coldTaiga, BiomeGenBase.coldTaigaHills, BiomeGenBase.forest, BiomeGenBase.forestHills, BiomeGenBase.jungle, BiomeGenBase.jungleEdge, BiomeGenBase.jungleHills, BiomeGenBase.megaTaiga, BiomeGenBase.megaTaigaHills, BiomeGenBase.roofedForest, BiomeGenBase.taiga, BiomeGenBase.taigaHills);
	EntityRegistry.registerModEntity(entityClass, name, entityId, "terriblethings", 64, 1, true);
	EntityList.entityEggs.put(Integer.valueOf(entityId), new EntityList.EntityEggInfo(entityId, mainColor, subColor));
}

}

 

here is my mob class:

public class EntityEnderhunter extends EntityMob{

public EntityEnderhunter(World world) {
	super(world);
}
protected void applyEntityAttributes(){
	super.applyEntityAttributes();
	this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(5.0D);
	this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(64.0D);
	this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(10.0D);
	this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(1.0D);
	this.getEntityAttribute(SharedMonsterAttributes.knockbackResistance).setBaseValue(0.5D);
}

}

 

here is the render class:

public class RenderEnderhunter extends RenderLiving {

private static final ResourceLocation texture = new ResourceLocation(R.t + "textures/model/enderhunter.png");

protected ModelMinotaur modelEntity;

public RenderEnderhunter(ModelBase par1ModelBase, float par2) {
	super(par1ModelBase, par2);
	modelEntity = ((ModelMinotaur) mainModel);
}
public void renderEnderhunter(EntityEnderhunter entity, double x, double y, double z, float u, float v){
	super.doRender(entity, x, y, z, u, v);
}
public void doRenderLiving(EntityLiving entityLiving, double x, double y, double z, float u, float v){
	renderEnderhunter((EntityEnderhunter)entityLiving, x, y, z, u, v);
}
public void doRender(Entity entity, double x, double y, double z, float u, float v){
	renderEnderhunter((EntityEnderhunter)entity, x, y, z, u, v);
}

@Override
protected ResourceLocation getEntityTexture(Entity var1) {
	return texture;
}



}

and here is the model class:

public class ModelMinotaur extends ModelBase
{
  //fields
    ModelRenderer RightLeg;
    ModelRenderer LeftLeg;
    ModelRenderer Body;
    ModelRenderer LeftShoulder;
    ModelRenderer RightShoulder;
    ModelRenderer LeftArm;
    ModelRenderer RightArm;
    ModelRenderer Head;
    ModelRenderer RightHorn;
    ModelRenderer LeftHorn;
  
  public ModelMinotaur()
  {
    textureWidth = 256;
    textureHeight = 128;
    
      RightLeg = new ModelRenderer(this, 0, 0);
      RightLeg.addBox(0F, 0F, 0F, 8, 24, ;
      RightLeg.setRotationPoint(0F, 0F, -4F);
      RightLeg.setTextureSize(256, 128);
      RightLeg.mirror = true;
      setRotation(RightLeg, 0F, 0F, 0F);
      LeftLeg = new ModelRenderer(this, 8, 40);
      LeftLeg.addBox(0F, 0F, 0F, 8, 24, ;
      LeftLeg.setRotationPoint(-8F, 0F, -4F);
      LeftLeg.setTextureSize(256, 128);
      LeftLeg.mirror = true;
      setRotation(LeftLeg, 0F, 0F, 0F);
      Body = new ModelRenderer(this, 188, 39);
      Body.addBox(0F, 0F, 0F, 16, 24, ;
      Body.setRotationPoint(-8F, -24F, -4F);
      Body.setTextureSize(256, 128);
      Body.mirror = true;
      setRotation(Body, 0F, 0F, 0F);
      LeftShoulder = new ModelRenderer(this, 0, 88);
      LeftShoulder.addBox(0F, 0F, 0F, 10, 8, 10);
      LeftShoulder.setRotationPoint(-18F, -24F, -5F);
      LeftShoulder.setTextureSize(256, 128);
      LeftShoulder.mirror = true;
      setRotation(LeftShoulder, 0F, 0F, 0F);
      RightShoulder = new ModelRenderer(this, 48, 88);
      RightShoulder.addBox(0F, 0F, 0F, 10, 8, 10);
      RightShoulder.setRotationPoint(8F, -24F, -5F);
      RightShoulder.setTextureSize(256, 128);
      RightShoulder.mirror = true;
      setRotation(RightShoulder, 0F, 0F, 0F);
      LeftArm = new ModelRenderer(this, 36, 0);
      LeftArm.addBox(0F, 0F, 0F, 8, 16, ;
      LeftArm.setRotationPoint(-17F, -16F, -4F);
      LeftArm.setTextureSize(256, 128);
      LeftArm.mirror = true;
      setRotation(LeftArm, 0F, 0F, 0F);
      RightArm = new ModelRenderer(this, 76, 0);
      RightArm.addBox(0F, 0F, 0F, 8, 16, ;
      RightArm.setRotationPoint(9F, -16F, -4F);
      RightArm.setTextureSize(256, 128);
      RightArm.mirror = true;
      setRotation(RightArm, 0F, 0F, 0F);
      Head = new ModelRenderer(this, 180, 0);
      Head.addBox(0F, 0F, 0F, 16, 16, 16);
      Head.setRotationPoint(-8F, -40F, -8F);
      Head.setTextureSize(256, 128);
      Head.mirror = true;
      setRotation(Head, 0F, 0F, 0F);
      RightHorn = new ModelRenderer(this, 139, 0);
      RightHorn.addBox(0F, 0F, 0F, 4, 8, 4);
      RightHorn.setRotationPoint(8F, -44F, -2F);
      RightHorn.setTextureSize(256, 128);
      RightHorn.mirror = true;
      setRotation(RightHorn, 0F, 0F, 0F);
      LeftHorn = new ModelRenderer(this, 120, 0);
      LeftHorn.addBox(0F, 0F, 0F, 4, 8, 4);
      LeftHorn.setRotationPoint(-12F, -44F, -2F);
      LeftHorn.setTextureSize(256, 128);
      LeftHorn.mirror = true;
      setRotation(LeftHorn, 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, entity);
    RightLeg.render(f5);
    LeftLeg.render(f5);
    Body.render(f5);
    LeftShoulder.render(f5);
    RightShoulder.render(f5);
    LeftArm.render(f5);
    RightArm.render(f5);
    Head.render(f5);
    RightHorn.render(f5);
    LeftHorn.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, Entity entity)
  {
    super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
  }

}

 

Does anybody understand what I am doing wrong?

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.