net.minecraft.client.Minecraft.getSoundHandler()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(186)

本文整理了Java中net.minecraft.client.Minecraft.getSoundHandler()方法的一些代码示例,展示了Minecraft.getSoundHandler()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Minecraft.getSoundHandler()方法的具体详情如下:
包路径:net.minecraft.client.Minecraft
类名称:Minecraft
方法名:getSoundHandler

Minecraft.getSoundHandler介绍

暂无

代码示例

代码示例来源:origin: Vazkii/Botania

private void back() {
  if(backButton.enabled) {
    actionPerformed(backButton);
    backButton.playPressSound(mc.getSoundHandler());
  }
}

代码示例来源:origin: Vazkii/Botania

private void back() {
  if(backButton.enabled) {
    actionPerformed(backButton);
    backButton.playPressSound(mc.getSoundHandler());
  }
}

代码示例来源:origin: Vazkii/Botania

private void prevPage() {
  if(leftButton.enabled) {
    actionPerformed(leftButton);
    leftButton.playPressSound(mc.getSoundHandler());
  }
}

代码示例来源:origin: Vazkii/Botania

private void back() {
  if(backButton.enabled) {
    actionPerformed(backButton);
    backButton.playPressSound(mc.getSoundHandler());
  }
}

代码示例来源:origin: Vazkii/Botania

private void back() {
  if(backButton.enabled) {
    actionPerformed(backButton);
    backButton.playPressSound(mc.getSoundHandler());
  }
}

代码示例来源:origin: Vazkii/Botania

private void nextPage() {
  if(rightButton.enabled) {
    actionPerformed(rightButton);
    rightButton.playPressSound(mc.getSoundHandler());
  }
}

代码示例来源:origin: Vazkii/Botania

@Override
@SideOnly(Side.CLIENT)
public void readSpawnData(ByteBuf additionalData) {
  playerCount = additionalData.readInt();
  hardMode = additionalData.readBoolean();
  source = BlockPos.fromLong(additionalData.readLong());
  long msb = additionalData.readLong();
  long lsb = additionalData.readLong();
  bossInfoUUID = new UUID(msb, lsb);
  Minecraft.getMinecraft().getSoundHandler().playSound(new DopplegangerMusic(this));
}

代码示例来源:origin: Vazkii/Botania

private void prevPage() {
  if(leftButton.enabled) {
    actionPerformed(leftButton);
    leftButton.playPressSound(mc.getSoundHandler());
    updateNote();
  }
}

代码示例来源:origin: Vazkii/Botania

private void nextPage() {
  if(rightButton.enabled) {
    actionPerformed(rightButton);
    rightButton.playPressSound(mc.getSoundHandler());
    updateNote();
  }
}

代码示例来源:origin: Vazkii/Botania

@Override
protected void keyTyped(char par1, int par2) throws IOException {
  handleNoteKey(par1, par2);
  if(!notesEnabled && closeScreenOnInvKey() && mc.gameSettings.keyBindInventory.getKeyCode() == par2) {
    mc.displayGuiScreen(null);
    mc.setIngameFocus();
  }
  if(konamiTime == 0 && par2 == KONAMI_CODE[konamiIndex]) {
    konamiIndex++;
    if(konamiIndex >= KONAMI_CODE.length) {
      mc.getSoundHandler().playSound(PositionedSoundRecord.getMasterRecord(ModSounds.way, 1.0F));
      konamiIndex = 0;
      konamiTime = 240;
    }
  } else konamiIndex = 0;
  super.keyTyped(par1, par2);
}

代码示例来源:origin: TerraFirmaCraft/TerraFirmaCraft

@Override
protected void actionPerformed(GuiButton button)
{
  if (button instanceof GuiButtonKnapping)
  {
    ((GuiButtonKnapping) button).onClick();
    button.playPressSound(mc.getSoundHandler());
  }
}

代码示例来源:origin: AntiqueAtlasTeam/AntiqueAtlas

/** Called when the user left-clicks on this component. */
@SuppressWarnings("unchecked")
void onClick() {
  if (clickSound != null) {
    mc.getSoundHandler().playSound(PositionedSoundRecord.getMasterRecord(clickSound, 1.0F));//.playSound(new PositionedSoundRecord(clickSound, 1.0F));
  }
  for (IButtonListener listener : listeners) {
    listener.onClick(this);
  }
}

代码示例来源:origin: Zyin055/zyinhud

/**
 * Plays a zyinhud sound with the given resource name.
 * @param name
 */
public static void PlaySound(String name)
{
  mc.getSoundHandler().playSound(PositionedSoundRecord.create(new ResourceLocation("zyinhud:" + name), 1.0F));
}

代码示例来源:origin: AppliedEnergistics/Applied-Energistics-2

.getSoundHandler()
.playSound( new PositionedSoundRecord( block.getSoundType()
    .getBreakSound(), SoundCategory.BLOCKS, ( block.getSoundType().getVolume() + 1.0F ) / 2.0F, block.getSoundType()

代码示例来源:origin: ForestryMC/ForestryMC

@SideOnly(Side.CLIENT)
  public static void playSoundEvent(SoundEvent soundIn, float pitchIn) {
    Minecraft minecraft = Minecraft.getMinecraft();
    SoundHandler soundHandler = minecraft.getSoundHandler();
    PositionedSoundRecord sound = PositionedSoundRecord.getMasterRecord(soundIn, pitchIn);
    soundHandler.playSound(sound);
  }
}

代码示例来源:origin: SleepyTrousers/EnderIO

@SideOnly(Side.CLIENT)
private void playSound() {
 final MachineSound activeSound_nullchecked = activeSound;
 if (activeSound_nullchecked != null) {
  FMLClientHandler.instance().getClient().getSoundHandler().playSound(activeSound_nullchecked);
 }
}

代码示例来源:origin: thraaawn/CompactMachines

@Override
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException {
  super.mouseClicked(mouseX, mouseY, mouseButton);
  for(GuiButton button : adminButtons) {
    if (button.mousePressed(this.mc, mouseX, mouseY)) {
      button.playPressSound(this.mc.getSoundHandler());
      this.actionPerformed(button);
    }
  }
}

代码示例来源:origin: McJtyMods/DeepResonance

private static void playSound(World worldObj, BlockPos pos, SoundEvent soundType) {
  GeneratorSound sound = new GeneratorSound(soundType, worldObj, pos);
  stopSound(worldObj, pos);
  Minecraft.getMinecraft().getSoundHandler().playSound(sound);
  GlobalCoordinate g = new GlobalCoordinate(pos, worldObj.provider.getDimension());
  sounds.put(g, sound);
}

代码示例来源:origin: SleepyTrousers/EnderIO

@Override
protected void mouseClicked(int x, int y, int button) throws IOException {
 if (button == 1 && vanillaFurnaceButton.isMouseOver() && !mode.isSimple()) {
  // um, why do we need this?
  Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.getMasterRecord(SoundEvents.UI_BUTTON_CLICK, 1.0F));
  actionPerformed(vanillaFurnaceButton, 1);
 }
 super.mouseClicked(x, y, button);
}

代码示例来源:origin: Electrical-Age/ElectricalAge

@Override
public void imouseClicked(int x, int y, int code) {
  if (mousePressed(Minecraft.getMinecraft(), x, y)) {
    Minecraft.getMinecraft().getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
    onMouseClicked();
    if (observer != null) {
      observer.guiObjectEvent(this);
    }
  }
}

相关文章