Jump to content

[1.7.10][Unsolved] Custom Projectile Texture Not Working


FlashBash21

Recommended Posts

I've been working on a wand like item for a little bit now. I have everything done accept the texture of the projectile it shoots. I've been trying and trying but nothing seems to work. I've been able to get it to shoot the wand itself like a projectile but I can't get it to work with my custom one. I don't want it 3D or anything. Here is my RenderWandBolt class: http://pastebin.com/MAq59FEY

How do you do?

Link to comment
Share on other sites

U and V Coordinates are the X and Y coordinates in your Texture. You need to decide which part of your texture you want to draw.

You don't need an IIcon here at all, since you are not trying to draw an Item or Block texture.

So I removed all things IIcon from my render class, and then I put the internals func_77026_a into doRender(I don't know if your supposed to do that, when I removed the IIcon the entity wouldn't appear at all so I put it in doRender) and it appeared, but whenever I face a certain direction it would turn black, and the other directions it would be black.

How do you do?

Link to comment
Share on other sites

You need to specifiy U/V Coordinates when you are rendering with a texture. Use addVertexWithUV for that.

I did this and it fixed the problem with the projectile turning black at certain angles. But I know little to none about tesselators(and OpenGL, in case its important right here), so when I added the arguments it told me to add, I didn't know what to put in there.  here is the what I have in the tesselator     
float f4 = 1.0F;
        float f5 = 0.5F;
        float f6 = 0.25F;
        GL11.glRotatef(180.0F - this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
        GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
        tessellator.startDrawingQuads();
        tessellator.setNormal(0.0F, 1.0F, 0.0F);
        tessellator.addVertexWithUV((double)(0.0F - f5), (double)(0.0F - f6), 0.0D, p4, p4);
        tessellator.addVertexWithUV((double)(f4 - f5), (double)(0.0F - f6), 0.0D, p4, p4);
        tessellator.addVertexWithUV((double)(f4 - f5), (double)(f4 - f6), 0.0D, p4, p4);
        tessellator.addVertexWithUV((double)(0.0F - f5), (double)(f4 - f6), 0.0D, p4, p4);
        tessellator.draw();

It added the two p4's at the end and I don't know what to replace that with. Also the consol was telling me that my texture path was wrong so I changed it from

Constants.MODID, ":textures/entity/magic_Pro.png"

to

Constants.MODID, "textures/entity/magic_Pro.png"

the texture path fixed and now the projectile blinks(flashes from purple to a darker purple, which are two colors of my projectile texture). Also thanks for spending your time helping me with this.

How do you do?

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.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.