Jump to content

Recommended Posts

Posted (edited)

My custom entities are sometimes rendered correctly, but most of the time invisible. By this I mean: I can see them, they wander a bit, they are invisble and eventually they reappear. Im am sure that they're are still there in the meantime, because they still make sounds and some of my mobs which have AI to attack each other still do so and hence drop items.

 

That is what I call in preInit of my ClientProxy:

        RenderingRegistry.registerEntityRenderingHandler(EntityGargoyle.class, new EntityGargoyleRF());

 

That's the implementation of IRenderFactory:

 

Spoiler

package anagkai.biodiversity.entities.renderer;

import anagkai.biodiversity.entities.EntityGargoyle;
import anagkai.biodiversity.entities.models.ModelGargoyle;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraftforge.fml.client.registry.IRenderFactory;

public class EntityGargoyleRF implements IRenderFactory<EntityGargoyle>{

	@Override
	public RenderGargoyle createRenderFor(RenderManager manager) {
		return new RenderGargoyle(manager, new ModelGargoyle(), 1F);
	}

}

 

That's my render class:

Spoiler

package anagkai.biodiversity.entities.renderer;

import anagkai.biodiversity.entities.models.ModelAnt;
import anagkai.biodiversity.entities.models.ModelGargoyle;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.entity.RenderLiving;
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 RenderGargoyle extends RenderLiving {
public RenderGargoyle(RenderManager manager, ModelGargoyle model, float size) {
super(manager, model, size);
}
@Override
protected ResourceLocation getEntityTexture(Entity entity) {
return new ResourceLocation("biodiversity:textures/gargoyle.png");
}
}

 

 

The only problem is that the entities are often invisible. When they aren't they're rendered correctly with model and texture.

 

Any help is appreciated.

 

EDIT: Strangely, I can "trap" the invisible entities in small holes so they become visible again or when I spawn them in a small hole they stay visible for a longer time.

 

Edited by Anagkai
Posted

That is in a separate class for my entities, the static method inside is called in preInit of my main mode file.

 

		EntityRegistry.registerModEntity(EntityGargoyle.class, "biodiversityGargoyle", 0, Biodiversity.MODID, 1, 1, true, 0x262626, 0x666666);

 

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.