Jadar Posted March 11, 2013 Share Posted March 11, 2013 Hey guys, I'm trying to render one of my entities that I know is in the world. When the entity class extends EntityLiving it renders properly, but when it extends my EntityBase class it doesn't render properly, though the doUpdate method is being called. Is there something I'm missing? Quote Link to comment Share on other sites More sharing options...
ashtonr12 Posted March 11, 2013 Share Posted March 11, 2013 Its easier for people to tell where your mistake is when we can look at your code ourselves i understand if you dont want people to steal your ideas so maybe replace the names? but more people will offer to help or at atleast take a look if there is some example code, Quote Use examples, i have aspergers. Examples make sense to me. Link to comment Share on other sites More sharing options...
Jadar Posted March 11, 2013 Author Share Posted March 11, 2013 Well its open source so that's not a problem. I'm making vehicles for this mod, and I made the model in Techne, and I made the entity. Right now it extends EntityLyoko which is mainly used for mobs. EntityLyoko extends EntityLiving. I want to make a new class for the vehicles to extend called EntityVehicle that has all the code for mounting and steering, etc. I made it extend Entity, and get all the methods and whatnot in it. The render class i use for the entity extends RenderLiving. The only thing it changes is the texture. It renders fine when the entity extends EntityLiving but when it extends my class it won't render at all. Although the doUpdate method triggers, so I know its there. EntityVehicle: public class EntityVehicle extends Entity { protected String texture = "/matt/lyoko/mob/overboard.png"; public EntityVehicle(World par1World) { super(par1World); this.preventEntitySpawning = true; } @Override protected void entityInit() { this.dataWatcher.addObject(17, new Integer(0)); this.dataWatcher.addObject(18, new Integer(1)); this.dataWatcher.addObject(19, new Integer(0)); } public AxisAlignedBB getCollisionBox(Entity par1Entity) { return par1Entity.boundingBox; } public AxisAlignedBB getBoundingBox() { return this.boundingBox; } public boolean canBeCollidedWith() { return true; } public boolean canBePushed() { return true; } public EntityVehicle(World par1World, double x, double y, double z) { this(par1World); this.setPosition(x, y + (double)this.yOffset, z); this.motionX = 0.0D; this.motionY = 0.0D; this.motionZ = 0.0D; this.prevPosX = x; this.prevPosY = y; this.prevPosZ = z; } @SideOnly(Side.CLIENT) /** * Returns the texture's file path as a String. */ public String getTexture() { return this.texture; } @Override protected void readEntityFromNBT(NBTTagCompound par1) { } @Override protected void writeEntityToNBT(NBTTagCompound par1) { } public boolean interact(EntityPlayer par1EntityPlayer) { if (this.riddenByEntity != null && this.riddenByEntity instanceof EntityPlayer && this.riddenByEntity != par1EntityPlayer) { return true; } else { if (!this.worldObj.isRemote) { par1EntityPlayer.mountEntity(this); } return true; } } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.