Jump to content

Mob invisible, makes sounds, has shadow, has hitbox, just can't see it.


Recommended Posts

Posted

Try trimming your render hutch file down to

	

    package infectModding.mob.render;
     
    import infectModding.mob.Hunch;
    import infectModding.mob.entity.EntityHunch;
    import net.minecraft.client.model.ModelBase;
    import net.minecraft.client.renderer.entity.RenderLiving;
    import net.minecraft.entity.Entity;
    import net.minecraft.entity.EntityLiving;
    import net.minecraft.util.ResourceLocation;
     
    public class RenderHunch extends RenderLiving {
    private static final ResourceLocation EntityTexture = new ResourceLocation("Fakelocationtogetthedefaulttexturetomakesureyourtextureisnottheproblem")//"eternisles:textures/mobs/hunch.png");
            @Override
            protected ResourceLocation getEntityTexture(Entity entity) {
                   
                    return EntityTexture;
            }
     
    }

And use a different model when defining the renderer.

The shortened version you provide has no constructor, so it won't run. Shortening it while keeping the constructor doesn't change it from being invisible either. I changed the texture to a non-existent location, however it still appears invisible and not with the white default missing texture.

 

As for changing the model, I tried changing it to the ModelBiped but it just crashes. I'm not too keen on working with it to make it work with this model, since it won't be used afterwards.

Posted

Found your problem.

 

Your model has a problem and renders 1.5 blocks bellow where it should

 

In your renderHunch do

  public void doRender(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9){
{
super.doRender(par1EntityLiving,par2,par4+1.5,par6,par8,par9)
}

 

And it should work.

 

Edit: oops, doesn't work with in the models render code, sorry, you'll have to do it in your renderer's code

Posted

Found your problem.

 

Your model has a problem and renders 1.5 blocks bellow where it should

 

In your renderHunch do

  public void doRender(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9){
{
super.doRender(par1EntityLiving,par2,par4+1.5,par6,par8,par9)
}

 

And it should work.

 

Edit: oops, doesn't work with in the models render code, sorry, you'll have to do it in your renderer's code

Should I remove all my old methods?

 

I tried just adding the line in and it didn't fix the invisible bug, I also tried removing all the original methods and it didn't fix it.

 

My current render file is this:

http://pastebin.com/Htfw0CQD

 

I also am wondering, could there be an issue with my egg (it appears as normal, but maybe it is spawning the mob wrong since I changed the way the ID was done with that correction above).

 

Here is my egg code:

 

 

private static int startEntityId = 300;

private void registerEntityEgg(Class<? extends Entity> entity, int primaryColor, int secondaryColor) {
	int id = getUniqueEntityId();
	EntityList.IDtoClassMapping.put(id, entity);
	EntityList.entityEggs.put(id, new EntityEggInfo(id, primaryColor, secondaryColor));


}

private int getUniqueEntityId() {

	do {
		startEntityId++;
	}
	while(EntityList.getStringFromID(startEntityId) != null);
	return startEntityId++;
}

Posted

From your Hunch file:

 

import com.sun.xml.internal.stream.Entity;

Thats not the right entity!

Wow, and someone on a previous forum was so adamant that I change that from the import net.minecraft.entity.Entity; one..

 

Well I changed it back and I have an interesting new issue. The model appears as two of the model stacked upon one another.

 

Edit; Fixed, removed redundant code.

 

Posted

           public void doRender(EntityLiving par1EntityLiving, double par2, double par4, double par6, float par8, float par9){
                  super.doRender(par1EntityLiving,par2,par4+1.5,par6,par8,par9);
              renderHunch((EntityHunch)par1EntityLiving, par2, par4, par6, par8, par9);
             
           }

 

You are rendering it twice. If the bottom model is at ground level, then remove

 super.doRender(par1EntityLiving,par2,par4+1.5,par6,par8,par9);

, otherwise, remove

 renderHunch((EntityHunch)par1EntityLiving, par2, par4, par6, par8, par9);

 

Also, did you make any changes to the egg since you last used it successfully? because changing an import should not effect code from another part of the mod.

Posted

Yeah I forgot I had the redundant rendering and just fixed that as you replied, so it renders with the right texture and all. Only problem is he is floating in the air a bit (about his height up) and the hitbox is in the area below.  Testing the fix you posted atm.

 

Also the egg problem was I was using an old egg not the correct one.

 

 

edit: Fixed

 

Thank you so much! :D

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.