Jump to content

[1.7.10] Entity is not rendering


EmperorZelos

Recommended Posts

I am working on making a spear weapon and I can't make my model be rendered. In the initial code I have

 

RenderingRegistry.registerEntityRenderingHandler(ProjectileSpear.class, new RenderSpear(new ModelSpear(), 0));

 

I have used things to check that it is being registered, both debugging and such so I know this one is executed, it is executed along with another mob model I have which IS being rendered properly. This is my render file

 

package aerosteam.renderer.mob;

import org.lwjgl.opengl.GL11;

import aerosteam.AeroSteam;
import aerosteam.mobs.MobThief;
import aerosteam.model.mobs.ModelThief;
import aerosteam.model.various.ModelBullet;
import aerosteam.model.various.ModelSpear;
import aerosteam.projectiles.ProjectileBullet;
import aerosteam.projectiles.ProjectileSpear;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.entity.Render;
import net.minecraft.client.renderer.entity.RenderLiving;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;

public class RenderSpear extends Render {

private static final ResourceLocation textureStone = new ResourceLocation(AeroSteam.MODID + ":" + "textures/model/SpearStone.png");
private static final ResourceLocation textureWooden = new ResourceLocation(AeroSteam.MODID + ":" + "textures/model/SpearWooden.png");

protected ModelSpear modelEntity;

public RenderSpear(ModelBase model, float f) {
	super();
	modelEntity=((ModelSpear) model);
	System.out.println("Register Spear");
}


public void doRender(Entity entity, double x, double y, double z, float u, float v){
	System.out.println("Spear is rendering");
	GL11.glPushMatrix();
		GL11.glTranslatef((float)x+0.0F,(float)y-0.875F,(float)z+0.0F);
		this.bindTexture(textureStone);
		GL11.glPushMatrix();
			this.modelEntity.renderModel(0.0625F*1F);
		GL11.glPopMatrix();
	GL11.glPopMatrix();
}
public void renderSpear(ProjectileSpear entityarrow, double d, double d1, double d2, float f, float f1)
/*     */   {
	System.out.println("Spear is rendering-2");
/*  18 */     
/*     */   }
public void func_76986_a(Entity entity, double d, double d1, double d2, float f, float f1)
/*     */   {
/*  99 */     renderSpear((ProjectileSpear)entity, d, d1, d2, f, f1);
/*     */   }
@Override
protected ResourceLocation getEntityTexture(Entity p_110775_1_) {
	System.out.println("Spear texture");
	return textureStone;
}
}

 

As you can see I have it giving text to write when certain things are meant to appear, sadly only "register spear" is the one showing up, none of the others are beign activated strangely enough. What am I doing wrong here?

Link to comment
Share on other sites

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.