use of net.minecraft.client.audio.SoundHandler in project ForestryMC by ForestryMC.
the class SoundUtil method playSoundEvent.
@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);
}
use of net.minecraft.client.audio.SoundHandler in project BetterRain by OreCruncher.
the class DynSurroundConfigGui method generateSoundList.
protected void generateSoundList(final ConfigCategory cat) {
cat.setRequiresMcRestart(false);
cat.setRequiresWorldRestart(false);
final SoundHandler handler = Minecraft.getMinecraft().getSoundHandler();
final List<String> sounds = new ArrayList<String>();
for (final Object resource : handler.sndRegistry.getKeys()) sounds.add(resource.toString());
Collections.sort(sounds);
for (final String sound : sounds) {
final Property prop = new Property(sound, "false", Property.Type.BOOLEAN);
prop.setDefaultValue(false);
prop.setRequiresMcRestart(false);
prop.setRequiresWorldRestart(false);
prop.set(SoundRegistry.isSoundBlocked(sound));
cat.put(sound, prop);
}
}
use of net.minecraft.client.audio.SoundHandler in project BetterRain by OreCruncher.
the class SoundBlockHandler method soundConfigReload.
@SubscribeEvent
public void soundConfigReload(final SoundConfigEvent.Reload event) {
this.soundsToBlock.clear();
this.soundCull.clear();
final SoundHandler handler = Minecraft.getMinecraft().getSoundHandler();
for (final Object resource : handler.sndRegistry.getKeys()) {
final String rs = resource.toString();
if (SoundRegistry.isSoundBlocked(rs)) {
ModLog.debug("Blocking sound '%s'", rs);
this.soundsToBlock.add(rs);
} else if (SoundRegistry.isSoundCulled(rs)) {
ModLog.debug("Culling sound '%s'", rs);
this.soundCull.put(rs, -ModOptions.soundCullingThreshold);
}
}
}
use of net.minecraft.client.audio.SoundHandler in project Armourers-Workshop by RiskyKen.
the class GuiList method mouseClicked.
public boolean mouseClicked(int mouseX, int mouseY, int button) {
if (!this.visible) {
return false;
}
for (int i = 0; i < listItems.size(); i++) {
int yLocation = y - scrollAmount + 2 + i * slotHeight;
if (mouseY >= y & mouseY <= y + height - 2) {
if (listItems.get(i).mousePressed(fontRenderer, x + 2, yLocation, mouseX, mouseY, button, width)) {
SoundHandler sh = mc.getSoundHandler();
sh.playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
selectedIndex = i;
return true;
}
}
}
return false;
}
use of net.minecraft.client.audio.SoundHandler in project BetterRain by OreCruncher.
the class ProxyClient method postInit.
@Override
public void postInit(final FMLPostInitializationEvent event) {
super.postInit(event);
if (ModOptions.enableDebugLogging) {
final SoundHandler handler = Minecraft.getMinecraft().getSoundHandler();
final List<String> sounds = new ArrayList<String>();
for (final Object resource : handler.sndRegistry.getKeys()) sounds.add(resource.toString());
Collections.sort(sounds);
ModLog.info("*** SOUND REGISTRY ***");
for (final String sound : sounds) ModLog.info(sound);
ModLog.info("*** REGISTERED BLOCK NAMES ***");
final GenerateBlockReport report = new GenerateBlockReport();
for (final String entry : report.getBlockNames()) {
ModLog.info(entry);
}
ForgeDictionary.dumpOreNames();
}
}
Aggregations