DragonessAtHeart Posted January 30, 2016 Share Posted January 30, 2016 Okay guys. All of you smart people have helped me get this far. Why is my entity invisible? I'm not getting a texture not found error, and at first it was using some sort of block map texture file. But now I get a shadow, and nothing else. It moves and everything. What am I doing wrong? package com.dragonessatheart.firstmod; import net.minecraft.client.Minecraft; import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.entity.RendererLivingEntity; import net.minecraft.client.renderer.entity.layers.LayerWolfCollar; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLivingBase; import com.dragonessatheart.firstmod.EntityGiantLizard; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; //@SideOnly(Side.CLIENT) public class RenderGiantLizard extends Render<EntityGiantLizard> { //rLivingEntity { private static final ResourceLocation giantLizardTextures = new ResourceLocation(Reference.MODID + ":textures/entity/giantlizard.png"); public RenderGiantLizard(RenderManager renderManager)//, ModelBase model, float shadowSize) //, float scale, String texturePath) { super(renderManager);//, model, shadowSize); shadowSize = 1F; } protected static ModelBase modelGiantLizard = new ModelGiantLizard(); public void renderGiantLizard(EntityGiantLizard entitygiantlizard, double x, double y, double z, float rotationYaw, float partialTicks) { GlStateManager.pushMatrix(); GlStateManager.translate((float) x, (float) y, (float) z); //parameters = angle, x(horiz), y(vert), z(back forth)? GlStateManager.rotate(180.0F - rotationYaw, 0.0F, 1.0F, 0.0F); //last one is the scale bindEntityTexture(entitygiantlizard); modelGiantLizard.render(entitygiantlizard, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 1.0F); GlStateManager.popMatrix(); super.doRender(entitygiantlizard, x, y, z, rotationYaw, partialTicks); } public boolean bindEntityTexture(EntityGiantLizard entity) { if (giantLizardTextures == null) { System.err.println("Texture problem :<"); } return super.bindEntityTexture(entity); } /** * Returns the location of an entity's texture. Doesn't seem to be called unless you call Render.bindEntityTexture. */ protected ResourceLocation getEntityTexture(EntityGiantLizard entity) { if (giantLizardTextures == null) { System.err.println("Texture problem :<"); } //return this.getEntityTexture((EntityGiantLizard)entity); return giantLizardTextures; } //--------------------------------------------------------------------------------------------------------------------------------------------------- //this one takes EntityGiantLizard and does super with the EntityLiving public void doRender(EntityGiantLizard entity, double x, double y, double z, float entityYaw, float partialTicks) { renderGiantLizard(entity, x, y, z, partialTicks, partialTicks); super.doRender((EntityGiantLizard)entity, x, y, z, entityYaw, partialTicks); } /** * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic * (Render<T extends Entity>) and this method has signature public void func_76986_a(T entity, double d, double d1, * double d2, float f, float f1). But JAD is pre 1.5 so doe */ //this one takes EntityLiving and then does this with EntityGiantLizard public void doRender(EntityLiving entity, double x, double y, double z, float entityYaw, float partialTicks) { this.doRender((EntityGiantLizard)entity, x, y, z, entityYaw, partialTicks); } /** * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic * (Render<T extends Entity>) and this method has signature public void func_76986_a(T entity, double d, double d1, * double d2, float f, float f1). But JAD is pre 1.5 so doe */ public void doRender(EntityLivingBase entity, double x, double y, double z, float entityYaw, float partialTicks) { this.doRender((EntityGiantLizard)entity, x, y, z, entityYaw, partialTicks); } /** * Actually renders the given argument. This is a synthetic bridge method, always casting down its argument and then * handing it off to a worker function which does the actual work. In all probabilty, the class Render is generic * (Render<T extends Entity>) and this method has signature public void func_76986_a(T entity, double d, double d1, * double d2, float f, float f1). But JAD is pre 1.5 so doe public void doRender(EntityGiantLizard entity, double x, double y, double z, float entityYaw, float partialTicks) { doRender((EntityGiantLizard)entity, x, y, z, entityYaw, partialTicks); } */ //end RenderGiantLizard } Quote Link to comment Share on other sites More sharing options...
DragonessAtHeart Posted January 31, 2016 Author Share Posted January 31, 2016 Anyone? Quote Link to comment Share on other sites More sharing options...
DragonessAtHeart Posted January 31, 2016 Author Share Posted January 31, 2016 How do I know which method to keep? Quote Link to comment Share on other sites More sharing options...
DragonessAtHeart Posted January 31, 2016 Author Share Posted January 31, 2016 Do you know of any good tutorials for adding a mob to 1.8 and how to register and render it? I clearly need a bit more direction but I'm not sure how to get it. Quote Link to comment Share on other sites More sharing options...
DragonessAtHeart Posted February 1, 2016 Author Share Posted February 1, 2016 Okay, I don't see anything else that Eclipse is yelling at me about so? How is this? The entity is still invisible. No crash, no missing texture file, I'm just confused. import net.minecraft.client.model.ModelBase; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.entity.Render; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class NewRenderGiantLizard extends Render<EntityGiantLizard> { public ResourceLocation giantLizardTexture = new ResourceLocation(Reference.MODID+":textures/entity/giantlizard.png"); protected NewRenderGiantLizard(RenderManager renderManager) { super(renderManager); shadowSize = 0.5F; } public void doRender(EntityGiantLizard entity, double x, double y, double z, float entityYaw, float partialTicks) { super.doRender(entity, x, y, z, entityYaw, partialTicks); } @Override protected ResourceLocation getEntityTexture(EntityGiantLizard entity) { return giantLizardTexture; } } Thanks very much in advance. I'd really like to learn how to do this. Quote Link to comment Share on other sites More sharing options...
DragonessAtHeart Posted February 1, 2016 Author Share Posted February 1, 2016 Please, tell me how to make it do something. Should I be calling it somewhere I'm not? Quote Link to comment Share on other sites More sharing options...
coolAlias Posted February 1, 2016 Share Posted February 1, 2016 Please, tell me how to make it do something. The render code in your very first post did something... why did you take it all out? Diesieben only said to remove the redundant #doRender methods, not strip out the entire contents of the one method you kept. Quote http://i.imgur.com/NdrFdld.png[/img] Link to comment Share on other sites More sharing options...
DragonessAtHeart Posted February 1, 2016 Author Share Posted February 1, 2016 Oh. I thought he said to start over because it was a mess. Quote Link to comment Share on other sites More sharing options...
DragonessAtHeart Posted February 1, 2016 Author Share Posted February 1, 2016 I have done that and am still messing something up. I really wish I could say I understood completely what my code is doing, but I really don't. I hope you don't kick me off of the forums but this is why I am here. Because I don't know what the code is doing and I'm having a lot of trouble figuring it out. The examples in vanilla forge 1.8.9 that I have seem to use different methods than the ones you are telling me here. At least registering seems to be different. I don't want to give up. When I get home I'm going to take the cow and trace through every call that seems to have to do with rendering to see if I can't figure things out more. Thanks for all of your help. Let me know if you think of other reasons why the rendering just is very broken. Quote Link to comment Share on other sites More sharing options...
starwarsmace Posted February 1, 2016 Share Posted February 1, 2016 I have done that and am still messing something up. I really wish I could say I understood completely what my code is doing, but I really don't. I hope you don't kick me off of the forums but this is why I am here. Because I don't know what the code is doing and I'm having a lot of trouble figuring it out. The examples in vanilla forge 1.8.9 that I have seem to use different methods than the ones you are telling me here. At least registering seems to be different. I don't want to give up. When I get home I'm going to take the cow and trace through every call that seems to have to do with rendering to see if I can't figure things out more. Thanks for all of your help. Let me know if you think of other reasons why the rendering just is very broken. To really understand what your code is doing, you should look at all the functions called. Then look at the source code for those functions, go back till you understand what all the functions that are called inside that function. Then do the same for all the other ones. Quote I'm back from being gone for... I think its been about a year. I'm pretty sure nobody remembers me, but hello anybody who does! Link to comment Share on other sites More sharing options...
DragonessAtHeart Posted February 1, 2016 Author Share Posted February 1, 2016 That's what I meant. I've been trying to do that, but it just is difficult if you can't figure out what one function is doing and it breaks the flow. 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.