Posted November 25, 201212 yr I know this has probably been answered somewhere else, but I have done hours of research and cannot find a working solution. Here is the problem: I made a custom bow, and a custom arrow, however the custom arrow is using the original arrow texture right now. But the problem is that when I shoot the arrow, I know it really shoots because it hurts mobs and I can pick it up, but it is invisible. I messed around some. Now I have: In my Entities in my main class file I have: EntityRegistry.registerGlobalEntityID(EntityPebble.class, "Pebble", EntityRegistry.findGlobalUniqueEntityId()); EntityRegistry.registerModEntity(EntityPebble.class, "Pebble", 1, this, 128, 1, false); In my rendering registry I put RenderingRegistry.registerEntityRenderingHandler(EntityPebble.class, new RenderLiving(new ModelPebble(), 0F)); Which yields an ebt.common.EntityPebble cannot be cast to net.minecraft.src.EntityLiving error. When I change RenderingRegistry.registerEntityRenderingHandler(EntityPebble.class, new RenderLiving(new ModelPebble(), 0F)); to RenderingRegistry.registerEntityRenderingHandler(EntityPebble.class, new ebt.client.render.RenderPebble()); I get a arrow like texture, but it says "missing". To clarify I do NOT want a folded texture, I want a cube like texture, and that is what the ModelPebble file is set to be. Thanks in advance, all help is appreciated.
November 26, 201212 yr Author I have it set to shoot a custom arrow and entity, but using the default arrow's texture. Could it be because two things are using the default texture? I don't exactly understand your question.
November 26, 201212 yr Author I tried directing it to the correct texture but it's still invisible. Everything works except for not being able to see it. And help?
November 26, 201212 yr The only explanation is you didn't render the arrow at all or you rendered it incorrectly. Creator of Jobo's ModLoader If I helped you could you please click the thank you button and applaud my karma.
November 27, 201212 yr we have to see your rendering code Creator of Jobo's ModLoader If I helped you could you please click the thank you button and applaud my karma.
November 27, 201212 yr Author RenderPebble package ebt.client.render; import net.minecraft.src.Entity; import net.minecraft.src.ModelBase; import net.minecraft.src.Render; import net.minecraft.src.Tessellator; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; import ebt.common.EntityPebble; import ebt.common.ModelPebble; public class RenderPebble extends Render { protected ModelBase ModelPShot; public RenderPebble() { this.shadowSize = 0.1F; this.ModelPShot = new ModelPebble(); } public void renderPShot(EntityPebble var1, double var2, double var4, double var6, float var8, float var9) { if (var1.prevRotationYaw != 0.0F || var1.prevRotationPitch != 0.0F) { //this.modelPShot.render(var1, 0F, 0F, 0F, 11, 2, 2); this.loadTexture("/ebt.client/resources/Pebble.png"); GL11.glPushMatrix(); GL11.glTranslatef((float)var2, (float)var4, (float)var6); GL11.glRotatef(var1.prevRotationYaw + (var1.rotationYaw - var1.prevRotationYaw) * var9 - 90.0F, 0.0F, 1.0F, 0.0F); GL11.glRotatef(var1.prevRotationPitch + (var1.rotationPitch - var1.prevRotationPitch) * var9, 0.0F, 0.0F, 1.0F); Tessellator var10 = Tessellator.instance; byte var11 = 0; float var12 = 0.0F; float var13 = 0.5F; float var14 = (float)(0 + var11 * 10) / 32.0F; float var15 = (float)(5 + var11 * 10) / 32.0F; float var16 = 0.0F; float var17 = 0.15625F; float var18 = (float)(5 + var11 * 10) / 32.0F; float var19 = (float)(10 + var11 * 10) / 32.0F; float var20 = 0.05625F; GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glRotatef(45.0F, 1.0F, 0.0F, 0.0F); GL11.glScalef(var20, var20, var20); GL11.glTranslatef(-4.0F, 0.0F, 0.0F); GL11.glNormal3f(var20, 0.0F, 0.0F); var10.startDrawingQuads(); var10.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)var16, (double)var18); var10.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double)var17, (double)var18); var10.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double)var17, (double)var19); var10.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double)var16, (double)var19); var10.draw(); GL11.glNormal3f(-var20, 0.0F, 0.0F); var10.startDrawingQuads(); var10.addVertexWithUV(-7.0D, 2.0D, -2.0D, (double)var16, (double)var18); var10.addVertexWithUV(-7.0D, 2.0D, 2.0D, (double)var17, (double)var18); var10.addVertexWithUV(-7.0D, -2.0D, 2.0D, (double)var17, (double)var19); var10.addVertexWithUV(-7.0D, -2.0D, -2.0D, (double)var16, (double)var19); var10.draw(); for (int var23 = 0; var23 < 4; ++var23) { GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); GL11.glNormal3f(0.0F, 0.0F, var20); var10.startDrawingQuads(); var10.addVertexWithUV(-8.0D, -2.0D, 0.0D, (double)var12, (double)var14); var10.addVertexWithUV(8.0D, -2.0D, 0.0D, (double)var13, (double)var14); var10.addVertexWithUV(8.0D, 2.0D, 0.0D, (double)var13, (double)var15); var10.addVertexWithUV(-8.0D, 2.0D, 0.0D, (double)var12, (double)var15); var10.draw(); } GL11.glDisable(GL12.GL_RESCALE_NORMAL); GL11.glPopMatrix(); } } public void doRender(Entity var1, double var2, double var4, double var6, float var8, float var9) { this.renderPShot((EntityPebble)var1, var2, var4, var6, var8, var9); } }
November 27, 201212 yr Author I added this line of code in my clientproxy: RenderingRegistry.instance().registerEntityRenderingHandler(EntityPebble.class, new RenderPebble()); This line of code in my main mod file: EntityRegistry.registerModEntity(EntityPebble.class, "Pebble", 1, this, 250, 5, false); Now the end of my main mod file looks like this: //Entities// EntityRegistry.registerGlobalEntityID(EntityPebble.class, "Pebble", EntityRegistry.findGlobalUniqueEntityId()); EntityRegistry.registerModEntity(EntityPebble.class, "Pebble", 1, this, 250, 5, false); //Rendering Registry// RenderingRegistry.registerEntityRenderingHandler(EntityPebble.class, new ebt.client.render.RenderPebble()); I notice it isn't calling to my ModelPebble file, where is it supposed to do this?
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.