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.

Stalker

Members
  • Joined

  • Last visited

  1. That's what I thought. But I haven't found anything else. It's even used for GUI buttons :-/ EDIT: Apparently it only works with a Stereo sound file. If you use a Mono sound, it will be positioned.
  2. Hi, I'm currently struggling with how Sounds work in MC. In my mod I have a player fire a gun and I want him to hear a 2D sound and everyone else to hear a 3D sound at that position. I got packets and everything working, the problem is, I don't know how to create an actual 2D sound (i.e. a position-independent sound that just plays for one player - like background music). I looked at how it's done in a GUI and tried this method (as a lot of threads here suggested): Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147673_a(new ResourceLocation(soundname))); The problem is, this: If I turn around while firing, I can clearly hear a difference in the sound depending on the angle I'm currently looking, which means it's not actually a 2D sound. Does anyone know something about that? Is there a way to play 2D sounds? Does it only work with a Stereo sound file?
  3. Hi, I'm relatively new to MC modding, so I probably made some stupid mistakes there. So here's my question: I have a gun, that renders a muzzle flash (just a view aligned quad) when firing, which all works fine. The muzzle flash is affected by sky/world lighting, but I want it to be at full brightness at all times, just like the GUI or particles. Right now my code is executed from the gun item's renderer (which probably isn't the best way to do it) How can I tell the tesselator to ignore lighting? I have tried to disable gl_LIGHTING, or setting the tesselator's brightness but it didn't work. Also, would it be better to do this in the GUI? If so, would it be possible to render this quad behind the gun model? public void doRender(float progress, float offsetX, float offsetY, float offsetZ, float scale) { System.out.println("RenderMuzzleFlash"); int currentFrame = (int)((float)numSprites*progress); if (currentFrame < numSprites) { int col = currentFrame % cols; int row = (currentFrame / cols); float u = 1.f/cols; float v = 1.f/rows; float U1 = col*u; float V1 = row*v; float U2 = (col+1)*u; float V2 = (row+1)*v; Minecraft.getMinecraft().getTextureManager().bindTexture(fxTexture); GL11.glPushMatrix(); GL11.glTranslatef(0.f, 0.f, 0.f); GL11.glRotatef(0, 0, 0, 0); GL11.glScalef(scale, scale, scale); //GL11.glDisable(GL11.GL_DIFFUSE); //GL11.glDisable(GL11.GL_LIGHTING); Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.addVertexWithUV(offsetX, offsetY, offsetZ+scale, (double)U1, (double)V1); tessellator.addVertexWithUV(offsetX+scale, offsetY, offsetZ+scale, (double)U2, (double)V1); tessellator.addVertexWithUV(offsetX+scale, offsetY, offsetZ, (double)U2, (double)V2); tessellator.addVertexWithUV(offsetX, offsetY, offsetZ, (double)U1, (double)V2); //tessellator.setBrightness(15); //GL11.glColor3f(1, 1, 1); tessellator.setColorOpaque(255, 255, 255); tessellator.draw(); //GL11.glEnable(GL11.GL_DIFFUSE); //GL11.glEnable(GL11.GL_LIGHTING); GL11.glPopMatrix(); } }

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.