nickpops98 Posted January 21, 2014 Share Posted January 21, 2014 Hi everyone, I was working on two new throwable entities in forge and I am trying to use the snowball and fireball rendering but I cannot see the two entities while they are in the air. However it has nothing to do with my entities as they perform as they are supposed to on impact. (Expolosion, potion effects...) Any help on how I could fix this so the entities actually render would be great. Main Class package nickpops98.modName; // Imports required @Mod( modid = Reference.MOD_ID, name = Reference.MOD_NAME, version = Reference.VERSION) public class modName { } @EventHandler public void Load(FMLInitializationEvent event) { // [<] Entity Settings EntityRegistry.registerGlobalEntityID(EntityLavaball.class, "Lavaball", 4); EntityRegistry.registerGlobalEntityID(EntityBlindshot.class, "Blindshot", 5); RenderingRegistry.registerEntityRenderingHandler(EntityLavaball.class, new RenderFireball(1.0F)); RenderingRegistry.registerEntityRenderingHandler(EntityBlindshot.class, new RenderSnowball(Item.enderPearl)); // [>] } Entity Lavaball package nickpops98.modName.entity.projectile; // Imports required public class EntityLavaball extends EntityThrowable { public EntityLavaball(World par1World) { super(par1World); this.isImmuneToFire = true; this.setFire(1000); } public EntityLavaball(World par1World, EntityLivingBase par2EntityLivingBase) { super(par1World, par2EntityLivingBase); } public EntityLavaball(World par1World, double par2, double par4, double par6) { super(par1World, par2, par4, par6); } /** * Called when this EntityThrowable hits a block or entity. */ protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { this.worldObj.newExplosion((Entity)null, this.posX, this.posY, this.posZ, 0.8F, true, true); this.setDead(); } } Entity Blindshot package nickpops98.modName.entity.projectile; // Imports requiredpublic class EntityBlindshot extends EntityThrowable { public EntityBlindshot(World par1World) { super(par1World); this.isImmuneToFire = true; this.setFire(1000); } public EntityBlindshot(World par1World, EntityLivingBase par2EntityLivingBase) { super(par1World, par2EntityLivingBase); } public EntityBlindshot(World par1World, double par2, double par4, double par6) { super(par1World, par2, par4, par6); } /** * Called when this EntityThrowable hits a block or entity. */ protected void onImpact(MovingObjectPosition par1MovingObjectPosition) { if(par1MovingObjectPosition.typeOfHit == EnumMovingObjectType.ENTITY) ((EntityLivingBase) par1MovingObjectPosition.entityHit).addPotionEffect(new PotionEffect(Potion.blindness.id, 300, 1)); } } Thanks in advance! Quote Link to comment Share on other sites More sharing options...
TheGreyGhost Posted January 21, 2014 Share Posted January 21, 2014 Hi I don't see an obvious problem but some thoughts... I've been told it's better to use EntityRegistry.registerModEntity instead of registerGlobalEntityID. (But I doubt this is causing your rendering problem) I'd suggest that you put a breakpoint into RenderManager.renderEntityWithPosYaw render = this.getEntityRenderObject(par1Entity); // breakpoint here if (render != null && this.renderEngine != null) { or alternatively if (par1Entity instanceof EntityLavaball) { System.out.println("rendering EntityLavaball"); // breakpoint here } render = this.getEntityRenderObject(par1Entity); if (render != null && this.renderEngine != null) { then trace into it to see why your desired renderer isn't being retrieved. Or alternatively, if it's being retrieved, why the render code isn't working. -TGG Quote Link to comment Share on other sites More sharing options...
nickpops98 Posted January 22, 2014 Author Share Posted January 22, 2014 I did as you said and I can now see that for some reason my entities are not being passed through to RenderManager. Any thoughts on why this is happening. Quote Link to comment Share on other sites More sharing options...
TheGreyGhost Posted January 22, 2014 Share Posted January 22, 2014 Hi I did as you said and I can now see that for some reason my entities are not being passed through to RenderManager. I'm not sure what you mean by that. do you mean that when you got to the line render = this.getEntityRenderObject(par1Entity); your par1Entity is the EntityLavaball, render was set to null? or do you mean that renderEntityWithPosYaw was never called for your EntityLavaball at all? -TGG Quote Link to comment Share on other sites More sharing options...
nickpops98 Posted January 22, 2014 Author Share Posted January 22, 2014 I'm pretty sure it was never called. Quote Link to comment Share on other sites More sharing options...
TheGreyGhost Posted January 22, 2014 Share Posted January 22, 2014 Hi Hmmm ok In RenderGlobal.renderEntities, add the following line this.theWorld.theProfiler.endStartSection("entities"); for (i = 0; i < list.size(); ++i) { entity = (Entity)list.get(i); if (entity instanceof EntityLavaball) { System.out.println("rendering EntityLavaball"); // breakpoint here } when it breaks, see if you can trace through and see why it isn't getting to RenderManager.instance.renderEntity(entity, par3); -TGG 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.