Jump to content

Stalker

Members
  • Posts

    4
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

Stalker's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  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(); } }
×
×
  • Create New...

Important Information

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