@Override
      public boolean mousePressed(
          int slotIndex, int x, int y, int mouseEvent, int relativeX, int relativeY) {
        if (selectedMod != slotIndex) {
          selectedMod = slotIndex;

          mc.getSoundHandler()
              .playSound(
                  PositionedSoundRecord.createPositionedSoundRecord(
                      new ResourceLocation("gui.button.press"), 1.0F));
          return true;
        }

        return false;
      }
示例#2
0
    protected void func_148132_a(int p_148132_1_, int p_148132_2_) {
      this.field_148218_l = -1;

      if (p_148132_1_ >= 79 && p_148132_1_ < 115) {
        this.field_148218_l = 0;
      } else if (p_148132_1_ >= 129 && p_148132_1_ < 165) {
        this.field_148218_l = 1;
      } else if (p_148132_1_ >= 179 && p_148132_1_ < 215) {
        this.field_148218_l = 2;
      }

      if (this.field_148218_l >= 0) {
        this.func_148212_h(this.field_148218_l);
        this.mc
            .getSoundHandler()
            .playSound(
                PositionedSoundRecord.createPositionedSoundRecord(
                    new ResourceLocation("gui.button.press"), 1.0F));
      }
    }
示例#3
0
 public void playPressSound(SoundHandler soundHandlerIn) {
   soundHandlerIn.playSound(
       PositionedSoundRecord.createPositionedSoundRecord(
           new ResourceLocation("gui.button.press"), 1.0F));
 }