so im creating a throwable entity and i have created a custom model for it but I have no idea how to do this, I mean I know you use IRenderFactory but not how to use it.
Heres my code:
EntityRendererPlasmaBolt:
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GL12;
import com.lightningea.minecraftheroes.entity.EntityPlasmaBolt;
import com.lightningea.minecraftheroes.models.ModelLightningBall;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelBoat;
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.client.registry.IRenderFactory;
public class EntityRendererPlasmaBolt extends Render{
private static final ResourceLocation texture = new ResourceLocation("shm:textures/entity/lightning.png");
private ModelBase model;
public EntityRendererPlasmaBolt(RenderManager rendermanagerIn) {
// We use the vanilla zombie model here and we simply
// retexture it. Of course you can make your own model
super(rendermanagerIn);
}
@Override
public ResourceLocation getEntityTexture(Entity entity)
{
return texture;
}
public void doRender(Entity entity, double x, double y, double z, float entityYaw, float partialTicks)
{
//RenderEntityLightningBolt
GL11.glPushMatrix();
GL11.glTranslated(x, y, z);
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glScalef(0.5F, 0.5F, 0.5F);
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
GL11.glPopMatrix();
this.bindTexture(texture);
}
Ok wow, I guess I didn't look at the op too hard :P. First you will need to register your renderer using RenderingRegistry#registerEntityRenderingHandler in your client proxy. In your renderer class, set the type of the model variable to the class for your custom model. Then, in the blank space in your doRender method, add the model#render to make the renderer actually render your model.
so im creating a throwable entity and i have created a custom model for it but I have no idea how to do this, I mean I know you use IRenderFactory but not how to use it.
Heres my code:
EntityRendererPlasmaBolt:
ModelLightningBall:
I didn't want to do this but...Bump
[deleted]
He wants it in 3D. He said he created a model lol.
Anyway, wait.... where's your code to registering your entity and render (if you have one)?
Ok wow, I guess I didn't look at the op too hard :P. First you will need to register your renderer using RenderingRegistry#registerEntityRenderingHandler in your client proxy. In your renderer class, set the type of the model variable to the class for your custom model. Then, in the blank space in your doRender method, add the model#render to make the renderer actually render your model.