Jump to content

[1.8]Mob RenderProblem


a84759

Recommended Posts

I have tested 1.7.X and thats works but not 1.8 heres the render thing, i nulled it so it dident couse trouble when running.

 

    public RenderUndead(ModelBase par1ModelBase, float par2) {

super(null,par1ModelBase, par2); 

 

the null is there the problem is.

Link to comment
Share on other sites

still it dosent work i am getting an error here in the proxy file

 

RenderingRegistry.registerEntityRenderingHandler(EntityUndead.class, new RenderUndead(new Undead(), 0));

 

on registerEntityRendringHandler

 

What error???

Link to comment
Share on other sites

Captain-Picard-Facepalm.jpg

WHAT IS ERROR????????????

registerEntityRenderingHandler IS WHERE IS ERROR!!!!

WHAT IS ERROR MEANS: WHAT ECLIPSE WRITES YOU WHEN YOU PUT YOUR MOUSE ON registerEntityRenderingHandler !!!!!

FOR EXAMPLE:

The method registerEntityRenderingHandler(Class<? extends Entity>, Render) in the type RenderingRegistry is not applicable for the arguments ()

Link to comment
Share on other sites

package a84759.mod.Mobs;

import a84759.mod.Refrence;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation;

public class RenderUndead extends Render{

private static final ResourceLocation mobTextures = new ResourceLocation(Refrence.MOD_ID + ":textures/entity/Undead.png");



public RenderUndead(ModelBase par1ModelBase, float par2) {
super(Minecraft.getMinecraft().getRenderManager());
}
       
protected ResourceLocation getEntityTexture(EntityUndeadMob entity){
    return mobTextures;
  }
    @Override
protected ResourceLocation getEntityTexture(Entity entity){
return this.getEntityTexture((EntityUndeadMob)entity);
}
}
[/Code]

-------

[Code]// Date: 04.03.2015 18:26:25
// Template version 1.1
// Java generated by Techne
// Keep in mind that you still need to fill in some blanks
// - ZeuX






package a84759.mod.Mobs;

import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.entity.Entity;
import net.minecraft.util.MathHelper;

public class Undead extends ModelBase
{
  //fields
    ModelRenderer Shape1;
    ModelRenderer Shape2;
    ModelRenderer Shape4;
    ModelRenderer Shape5;
    ModelRenderer Shape3;
    ModelRenderer Shape6;
 
  public Undead()
  {
    textureWidth = 64;
    textureHeight = 32;
   
      Shape1 = new ModelRenderer(this, 0, 0);
      Shape1.addBox(0F, 0F, 0F, 1, 5, 2);
      Shape1.setRotationPoint(0F, 19F, 0F);
      Shape1.setTextureSize(64, 32);
      Shape1.mirror = true;
      setRotation(Shape1, 0F, 0F, 0F);
      Shape2 = new ModelRenderer(this, 0, 0);
      Shape2.addBox(0F, 0F, 0F, 1, 5, 2);
      Shape2.setRotationPoint(-3F, 19F, 0F);
      Shape2.setTextureSize(64, 32);
      Shape2.mirror = true;
      setRotation(Shape2, 0F, 0F, 0F);
      Shape4 = new ModelRenderer(this, 0, 0);
      Shape4.addBox(0F, 0F, 0F, 2, 2, 2);
      Shape4.setRotationPoint(-2F, 12F, 0F);
      Shape4.setTextureSize(64, 32);
      Shape4.mirror = true;
      setRotation(Shape4, 0F, 0F, 0F);
      Shape5 = new ModelRenderer(this, 0, 0);
      Shape5.addBox(0F, 0F, 0F, 4, 5, 2);
      Shape5.setRotationPoint(-3F, 14F, 0F);
      Shape5.setTextureSize(64, 32);
      Shape5.mirror = true;
      setRotation(Shape5, 0F, 0F, 0F);
      Shape3 = new ModelRenderer(this, 0, 0);
      Shape3.addBox(0F, 0F, 0F, 1, 4, 2);
      Shape3.setRotationPoint(1F, 14F, 0F);
      Shape3.setTextureSize(64, 32);
      Shape3.mirror = true;
      setRotation(Shape3, 0F, 0F, 0F);
      Shape6 = new ModelRenderer(this, 0, 0);
      Shape6.addBox(0F, 0F, 0F, 1, 4, 2);
      Shape6.setRotationPoint(-4F, 14F, 0F);
      Shape6.setTextureSize(64, 32);
      Shape6.mirror = true;
      setRotation(Shape6, 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);
    Shape1.render(f5);
    Shape2.render(f5);
    Shape4.render(f5);
    Shape5.render(f5);
    Shape3.render(f5);
    Shape6.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);
    float f6 = (180F / (float)Math.PI);
    this.Shape1.rotateAngleX = MathHelper.cos(f * 0.6662F) * 1.4F * f1; 
    this.Shape2.rotateAngleX = MathHelper.cos(f * 0.6662F + (float)Math.PI) * 1.4F * f1; 
    }

}
[/Code]

------

[Code]package a84759.mod.Mobs;

import a84759.mod.RandomStuffMod;
import a84759.mod.Refrence;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
import net.minecraft.entity.EnumCreatureType;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
import net.minecraftforge.fml.common.registry.EntityRegistry;

public abstract class EntityUndead extends Entity{

public EntityUndead(World worldIn) {
super(worldIn);
}
public static void register(){
registerEntity();
}
public static void registerEntity(){
createEntity(EntityUndeadMob.class, "Undead", 0x151517, 0xFAFAFA);
}
public static void createEntity(Class entityClass, String entityName, int solidColor, int spotColor){
int randomid = EntityRegistry.findGlobalUniqueEntityId();
EntityRegistry.registerGlobalEntityID(entityClass, entityName, randomid);
EntityRegistry.registerModEntity(entityClass, entityName, randomid, RandomStuffMod.modInstance , 64, 1, true);
EntityRegistry.addSpawn(entityClass, 2, 0, 1, EnumCreatureType.CREATURE, BiomeGenBase.plains);

createEgg(randomid, solidColor, spotColor);
}
private static void createEgg(int randomId, int solidColor, int spotColor){
EntityList.entityEggs.put(Integer.valueOf(randomId), new EntityList.EntityEggInfo(randomId, solidColor, spotColor));
}


}

[/Code]

------

[Code]package a84759.mod.Mobs;

import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIAttackOnCollide;
import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.entity.ai.EntityAIHurtByTarget;
import net.minecraft.entity.ai.EntityAILookIdle;
import net.minecraft.entity.ai.EntityAIMoveThroughVillage;
import net.minecraft.entity.ai.EntityAIMoveTowardsRestriction;
import net.minecraft.entity.ai.EntityAINearestAttackableTarget;
import net.minecraft.entity.ai.EntityAISwimming;
import net.minecraft.entity.ai.EntityAIWander;
import net.minecraft.entity.ai.EntityAIWatchClosest;
import net.minecraft.entity.monster.EntityIronGolem;
import net.minecraft.entity.monster.EntityMob;
import net.minecraft.entity.monster.EntityPigZombie;
import net.minecraft.entity.monster.EntityZombie;
import net.minecraft.entity.passive.EntityVillager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.pathfinding.PathNavigateGround;
import net.minecraft.world.World;

public class EntityUndeadMob extends EntityMob{

public EntityUndeadMob(World par1World) {
super(par1World);
((PathNavigateGround)this.getNavigator()).func_179688_b(true);
this.setSize(0.8F, 1.95F);
this.tasks.addTask(0, new EntityAIWander(this, 1.0D));
this.tasks.addTask(1, new EntityAIAttackOnCollide(this, EntityPlayer.class, 1.0D, false));
this.tasks.addTask(2, new EntityAISwimming(this));
this.tasks.addTask(3, new EntityAIMoveTowardsRestriction(this, 1.0D));
this.tasks.addTask(4, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
this.tasks.addTask(5, new EntityAILookIdle(this));
this.applyEntityAI();
}
protected void applyEntityAI(){
        this.tasks.addTask(4, new EntityAIAttackOnCollide(this, EntityVillager.class, 1.0D, true));
        this.tasks.addTask(4, new EntityAIAttackOnCollide(this, EntityIronGolem.class, 1.0D, true));
        this.tasks.addTask(6, new EntityAIMoveThroughVillage(this, 1.0D, false));
        this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, true, new Class[] {EntityPigZombie.class}));
        this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, true));
        this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityVillager.class, false));
        this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityIronGolem.class, true));

}


public boolean isAIEnabled(){
return true;
}
protected void applyEntityAttributes(){
super.applyEntityAttributes();
this.getEntityAttribute(SharedMonsterAttributes.maxHealth).setBaseValue(20D);
this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).setBaseValue(0.23000000417232513D);
this.getEntityAttribute(SharedMonsterAttributes.attackDamage).setBaseValue(3.0D);
this.getEntityAttribute(SharedMonsterAttributes.followRange).setBaseValue(35.0D);
}


}


[/Code]

Link to comment
Share on other sites

Are you extending RenderLiving and passing it model ? If not, make RenderUndead extend RenderLiving, and pass it render manager as first param, model as second and shadow size as third... When done, re try.

If still not working re post RenderUndead code and screen of what it looks like...

Link to comment
Share on other sites

Aaaaaaa, ok.

In constructor you need 3 params:

RenderManager, ModelBase and float. First one you can get from Minecraft.getMinecraft().getRenderManager(), but you cannot put it in super directly, so now RenderUndead constructor must also contain RenderManager param, which you can give him while constructing it in proxy... ModelBase is your model. And float is shadow size!

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.