Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (โ‹ฎ) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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?

Your resource location is wrong, it is supposed to be

private static final ResourceLocation texture = new ResourceLocation(MODID, "textures/entity/magic_Pro.png");

  • Author

Your resource location is wrong, it is supposed to be

private static final ResourceLocation texture = new ResourceLocation(MODID, "textures/entity/magic_Pro.png");

Did this and nothing changed : http://pastebin.com/KVPLDVxq

How do you do?

  • Author

Why are you using the U and V coordinates from an IIcon when you are drawing with your own texture? That makes no sense.

I'm pretty new IIcon. What do the U and V coordinates and what can I do about them?

How do you do?

  • Author

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?

  • Author

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?

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions โ†’ Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.