From c602585e6a262c8b69203b850973917ea498523a Mon Sep 17 00:00:00 2001 From: Sen Date: Tue, 18 Mar 2025 12:03:56 +0100 Subject: [PATCH] sound changes, press sounds, remove pitch --- java/src/game/audio/AudioInterface.java | 4 +- java/src/game/audio/PositionedSound.java | 43 ++++++--------- java/src/game/audio/SoundType.java | 45 +++++++--------- .../game/block/BlockBasePressurePlate.java | 4 +- java/src/game/block/BlockButton.java | 8 +-- java/src/game/block/BlockChest.java | 4 +- java/src/game/block/BlockFire.java | 2 +- java/src/game/block/BlockJukebox.java | 2 +- java/src/game/block/BlockLever.java | 2 +- java/src/game/block/BlockLiquid.java | 8 +-- java/src/game/block/BlockNote.java | 2 +- java/src/game/block/BlockNuke.java | 2 +- java/src/game/block/BlockPistonBase.java | 4 +- .../game/block/BlockRedstoneComparator.java | 2 +- java/src/game/block/BlockRedstoneTorch.java | 2 +- java/src/game/block/BlockTNT.java | 2 +- java/src/game/block/BlockTripWireHook.java | 8 +-- java/src/game/entity/Entity.java | 12 ++--- java/src/game/entity/animal/EntityBat.java | 14 ++--- .../src/game/entity/animal/EntityChicken.java | 2 +- java/src/game/entity/animal/EntityDragon.java | 2 +- java/src/game/entity/animal/EntityHorse.java | 20 +++---- .../game/entity/animal/EntityMooshroom.java | 2 +- java/src/game/entity/animal/EntityMouse.java | 6 +-- java/src/game/entity/animal/EntityRabbit.java | 2 +- java/src/game/entity/animal/EntitySheep.java | 2 +- java/src/game/entity/animal/EntityWolf.java | 2 +- .../game/entity/effect/EntityLightning.java | 4 +- .../src/game/entity/item/EntityFireworks.java | 2 +- java/src/game/entity/item/EntityItem.java | 4 +- java/src/game/entity/item/EntityTntCart.java | 2 +- java/src/game/entity/item/EntityXp.java | 4 +- java/src/game/entity/npc/EntityDarkMage.java | 2 +- java/src/game/entity/npc/EntityHaunter.java | 4 +- java/src/game/entity/npc/EntityNPC.java | 20 +++---- java/src/game/entity/npc/EntitySlime.java | 6 +-- .../game/entity/projectile/EntityArrow.java | 6 +-- .../game/entity/projectile/EntityBullet.java | 4 +- .../src/game/entity/projectile/EntityDie.java | 2 +- .../game/entity/projectile/EntityHook.java | 2 +- java/src/game/entity/types/EntityAnimal.java | 8 +-- java/src/game/entity/types/EntityLiving.java | 30 +++++------ java/src/game/gui/element/ActButton.java | 1 + java/src/game/gui/element/Element.java | 7 +++ java/src/game/init/DispenserRegistry.java | 2 +- java/src/game/item/ItemBlock.java | 2 +- java/src/game/item/ItemBow.java | 2 +- java/src/game/item/ItemBucket.java | 2 +- java/src/game/item/ItemChargedOrb.java | 2 +- java/src/game/item/ItemDie.java | 2 +- java/src/game/item/ItemDynamite.java | 2 +- java/src/game/item/ItemEgg.java | 2 +- java/src/game/item/ItemExpBottle.java | 2 +- java/src/game/item/ItemExterminator.java | 2 +- java/src/game/item/ItemFireball.java | 2 +- java/src/game/item/ItemFishingRod.java | 2 +- java/src/game/item/ItemFlintAndSteel.java | 2 +- java/src/game/item/ItemFood.java | 2 +- java/src/game/item/ItemGunBase.java | 2 +- java/src/game/item/ItemHoe.java | 2 +- java/src/game/item/ItemPotion.java | 2 +- java/src/game/item/ItemReed.java | 2 +- java/src/game/item/ItemSlab.java | 6 +-- java/src/game/item/ItemSnow.java | 2 +- java/src/game/item/ItemSnowball.java | 2 +- java/src/game/item/ItemWeatherToken.java | 2 +- .../game/network/NetHandlerPlayClient.java | 19 ++++--- .../game/network/NetHandlerPlayServer.java | 8 +-- .../src/game/packet/S29PacketSoundEffect.java | 13 +---- java/src/game/renderer/EntityRenderer.java | 4 +- .../renderer/particle/EntityFirework.java | 4 +- java/src/game/tileentity/TileEntityChest.java | 4 +- java/src/game/world/Explosion.java | 4 +- java/src/game/world/World.java | 6 +-- java/src/game/world/WorldClient.java | 52 +++++++++---------- java/src/game/world/WorldServer.java | 4 +- 76 files changed, 231 insertions(+), 251 deletions(-) diff --git a/java/src/game/audio/AudioInterface.java b/java/src/game/audio/AudioInterface.java index ea4fe36..5266b5b 100644 --- a/java/src/game/audio/AudioInterface.java +++ b/java/src/game/audio/AudioInterface.java @@ -92,11 +92,11 @@ public class AudioInterface implements Runnable { private short generate() { long mix = 0; - long attn = 0; // (32767 * 100) / 95); +// long attn = 0; // (32767 * 100) / 95); for(int z = 0; z < this.channels.length; z++) { Channel ch = this.channels[z]; if(ch.run) { - attn += (long)ch.level * (long)this.volumes[ch.type]; // (this.attn[ch.type] * 95) / 100; +// attn += (long)ch.level * (long)this.volumes[ch.type]; // (this.attn[ch.type] * 95) / 100; mix += (long)ch.buffer[ch.pos] * (long)ch.level * (((long)this.volumes[ch.type] * (long)this.volumes[0]) / 32767); if(++ch.pos >= ch.buffer.length) { ch.pos = 0; diff --git a/java/src/game/audio/PositionedSound.java b/java/src/game/audio/PositionedSound.java index 9e9d46d..53f03c2 100755 --- a/java/src/game/audio/PositionedSound.java +++ b/java/src/game/audio/PositionedSound.java @@ -2,32 +2,23 @@ package game.audio; import game.init.SoundEvent; -public class PositionedSound extends Sound -{ -// public PositionedSound(SoundEvent event, float pitch) -// { -// this(event, 0.25F, pitch, false, false, 0.0F, 0.0F, 0.0F); -// } +public class PositionedSound extends Sound { + public PositionedSound(SoundEvent event, Volume type) { + this(event, 1.0F, false, 0.0F, 0.0F, 0.0F); + this.type = type; + } - public PositionedSound(SoundEvent event) - { - this(event, 1.0F, false, 0.0F, 0.0F, 0.0F); - } + public PositionedSound(SoundEvent event, float volume, float xPosition, float yPosition, float zPosition) { + this(event, volume, true, xPosition, yPosition, zPosition); + } - public PositionedSound(SoundEvent event, float volume, float xPosition, float yPosition, float zPosition) - { - this(event, volume, true, xPosition, yPosition, zPosition); - } - - private PositionedSound(SoundEvent event, float volume, boolean attenuationType, float xPosition, float yPosition, float zPosition) - { - super(event); - this.volume = volume; -// this.pitch = pitch; - this.xPosF = xPosition; - this.yPosF = yPosition; - this.zPosF = zPosition; - this.repeat = false; - this.attenuationType = attenuationType; - } + private PositionedSound(SoundEvent event, float volume, boolean attenuationType, float xPosition, float yPosition, float zPosition) { + super(event); + this.volume = volume; + this.xPosF = xPosition; + this.yPosF = yPosition; + this.zPosF = zPosition; + this.repeat = false; + this.attenuationType = attenuationType; + } } diff --git a/java/src/game/audio/SoundType.java b/java/src/game/audio/SoundType.java index 87949b3..bb86b45 100755 --- a/java/src/game/audio/SoundType.java +++ b/java/src/game/audio/SoundType.java @@ -4,7 +4,7 @@ import game.init.SoundEvent; public class SoundType { - public static final SoundType SLIME = new SoundType(SoundEvent.SLIME_BIG, SoundEvent.SLIME_SMALL, 1.0F, 1.0F); + public static final SoundType SLIME = new SoundType(SoundEvent.SLIME_BIG, SoundEvent.SLIME_SMALL, 1.0F); // { // public Sounds getBreakSound() // { @@ -19,7 +19,7 @@ public class SoundType // return "mob.slime.small"; // } // }; - public static final SoundType ANVIL = new SoundType(SoundEvent.STONE, SoundEvent.ANVIL_LAND, SoundEvent.STONE, 0.3F, 1.0F); + public static final SoundType ANVIL = new SoundType(SoundEvent.STONE, SoundEvent.ANVIL_LAND, SoundEvent.STONE, 0.3F); // { // public Sounds getBreakSound() // { @@ -34,7 +34,7 @@ public class SoundType // return "dig.stone"; // } // }; - public static final SoundType LADDER = new SoundType(SoundEvent.WOOD, null, 1.0F, 1.0F); + public static final SoundType LADDER = new SoundType(SoundEvent.WOOD, null, 1.0F); // { // public Sounds getBreakSound() // { @@ -45,10 +45,10 @@ public class SoundType // return null; // } // }; - public static final SoundType SNOW = new SoundType(SoundEvent.SNOW, 1.0F, 1.0F); - public static final SoundType SAND = new SoundType(SoundEvent.SAND, 1.0F, 1.0F); - public static final SoundType CLOTH = new SoundType(SoundEvent.CLOTH, 1.0F, 1.0F); - public static final SoundType GLASS = new SoundType(SoundEvent.GLASS, SoundEvent.STONE, SoundEvent.STONE, 1.0F, 1.0F); + public static final SoundType SNOW = new SoundType(SoundEvent.SNOW, 1.0F); + public static final SoundType SAND = new SoundType(SoundEvent.SAND, 1.0F); + public static final SoundType CLOTH = new SoundType(SoundEvent.CLOTH, 1.0F); + public static final SoundType GLASS = new SoundType(SoundEvent.GLASS, SoundEvent.STONE, SoundEvent.STONE, 1.0F); // { // public Sounds getBreakSound() // { @@ -59,42 +59,40 @@ public class SoundType // return "dig.stone"; // } // }; - public static final SoundType METAL = new SoundType(SoundEvent.STONE, 1.0F, 1.5F); - public static final SoundType PISTON = new SoundType(SoundEvent.STONE, 1.0F, 1.0F); - public static final SoundType GRASS = new SoundType(SoundEvent.GRASS /* , null */ , 1.0F, 1.0F); + public static final SoundType METAL = new SoundType(SoundEvent.STONE, 1.0F); + public static final SoundType PISTON = new SoundType(SoundEvent.STONE, 1.0F); + public static final SoundType GRASS = new SoundType(SoundEvent.GRASS /* , null */ , 1.0F); // { // public Sounds getStepSound() // { // return null; // } // }; - public static final SoundType GRAVEL = new SoundType(SoundEvent.GRAVEL, 1.0F, 1.0F); - public static final SoundType WOOD = new SoundType(SoundEvent.WOOD, 1.0F, 1.0F); - public static final SoundType STONE = new SoundType(SoundEvent.STONE, 1.0F, 1.0F); + public static final SoundType GRAVEL = new SoundType(SoundEvent.GRAVEL, 1.0F); + public static final SoundType WOOD = new SoundType(SoundEvent.WOOD, 1.0F); + public static final SoundType STONE = new SoundType(SoundEvent.STONE, 1.0F); private final SoundEvent breakSound; private final SoundEvent placeSound; private final SoundEvent stepSound; private final float volume; -// private final float frequency; - private SoundType(SoundEvent breakSound, SoundEvent placeSound, SoundEvent stepSound, float volume, float frequency) + private SoundType(SoundEvent breakSound, SoundEvent placeSound, SoundEvent stepSound, float volume) { this.breakSound = breakSound; this.placeSound = placeSound; this.stepSound = stepSound; this.volume = volume; -// this.frequency = frequency; } - private SoundType(SoundEvent breakPlaceSound, SoundEvent stepSound, float volume, float frequency) + private SoundType(SoundEvent breakPlaceSound, SoundEvent stepSound, float volume) { - this(breakPlaceSound, breakPlaceSound, stepSound, volume, frequency); + this(breakPlaceSound, breakPlaceSound, stepSound, volume); } - private SoundType(SoundEvent sound, float volume, float frequency) + private SoundType(SoundEvent sound, float volume) { - this(sound, sound, sound, volume, frequency); + this(sound, sound, sound, volume); } public SoundEvent getBreakSound() @@ -116,9 +114,4 @@ public class SoundType { return this.volume; } - - public float getFrequency() - { - return 1.0f; // this.frequency; - } -} \ No newline at end of file +} diff --git a/java/src/game/block/BlockBasePressurePlate.java b/java/src/game/block/BlockBasePressurePlate.java index 5331cd6..38057fd 100755 --- a/java/src/game/block/BlockBasePressurePlate.java +++ b/java/src/game/block/BlockBasePressurePlate.java @@ -160,11 +160,11 @@ public abstract class BlockBasePressurePlate extends Block if (!flag1 && flag) { - worldIn.playSound(SoundEvent.CLICK, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.1D, (double)pos.getZ() + 0.5D, 0.3F, 0.5F); + worldIn.playSound(SoundEvent.CLICK, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.1D, (double)pos.getZ() + 0.5D, 0.3F); } else if (flag1 && !flag) { - worldIn.playSound(SoundEvent.CLICK, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.1D, (double)pos.getZ() + 0.5D, 0.3F, 0.6F); + worldIn.playSound(SoundEvent.CLICK, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.1D, (double)pos.getZ() + 0.5D, 0.3F); } if (flag1) diff --git a/java/src/game/block/BlockButton.java b/java/src/game/block/BlockButton.java index 291a465..0dd01a7 100755 --- a/java/src/game/block/BlockButton.java +++ b/java/src/game/block/BlockButton.java @@ -188,7 +188,7 @@ public class BlockButton extends Block { worldIn.setState(pos, state.withProperty(POWERED, Boolean.valueOf(true)), 3); worldIn.markBlockRangeForRenderUpdate(pos, pos); - worldIn.playSound(SoundEvent.CLICK, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, 0.3F, 0.6F); + worldIn.playSound(SoundEvent.CLICK, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, 0.3F); this.notifyNeighbors(worldIn, pos, (Facing)state.getValue(FACING)); worldIn.scheduleUpdate(pos, this, this.tickRate(worldIn, null)); return true; @@ -244,7 +244,7 @@ public class BlockButton extends Block { worldIn.setState(pos, state.withProperty(POWERED, Boolean.valueOf(false))); this.notifyNeighbors(worldIn, pos, (Facing)state.getValue(FACING)); - worldIn.playSound(SoundEvent.CLICK, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, 0.3F, 0.5F); + worldIn.playSound(SoundEvent.CLICK, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, 0.3F); worldIn.markBlockRangeForRenderUpdate(pos, pos); } } @@ -291,7 +291,7 @@ public class BlockButton extends Block worldIn.setState(pos, state.withProperty(POWERED, Boolean.valueOf(true))); this.notifyNeighbors(worldIn, pos, (Facing)state.getValue(FACING)); worldIn.markBlockRangeForRenderUpdate(pos, pos); - worldIn.playSound(SoundEvent.CLICK, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, 0.3F, 0.6F); + worldIn.playSound(SoundEvent.CLICK, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, 0.3F); } if (!flag && flag1) @@ -299,7 +299,7 @@ public class BlockButton extends Block worldIn.setState(pos, state.withProperty(POWERED, Boolean.valueOf(false))); this.notifyNeighbors(worldIn, pos, (Facing)state.getValue(FACING)); worldIn.markBlockRangeForRenderUpdate(pos, pos); - worldIn.playSound(SoundEvent.CLICK, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, 0.3F, 0.5F); + worldIn.playSound(SoundEvent.CLICK, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, 0.3F); } if (flag) diff --git a/java/src/game/block/BlockChest.java b/java/src/game/block/BlockChest.java index 2b87357..2f3bd5e 100755 --- a/java/src/game/block/BlockChest.java +++ b/java/src/game/block/BlockChest.java @@ -448,7 +448,7 @@ public class BlockChest extends BlockContainer ilockablecontainer.setLockCode(LockCode.EMPTY_CODE); // playerIn.triggerAchievement(StatRegistry.chestUnlockedStat); playerIn.connection.addFeed(TextColor.BLUE + "%s wurde entriegelt", ilockablecontainer.getCommandName()); - playerIn.connection.sendPacket(new S29PacketSoundEffect(SoundEvent.DOOR, playerIn.posX, playerIn.posY, playerIn.posZ, 1.0F, 1.0F)); + playerIn.connection.sendPacket(new S29PacketSoundEffect(SoundEvent.DOOR, playerIn.posX, playerIn.posY, playerIn.posZ, 1.0F)); return true; } } @@ -456,7 +456,7 @@ public class BlockChest extends BlockContainer ilockablecontainer.setLockCode(new LockCode(stack.getDisplayName())); // playerIn.triggerAchievement(StatRegistry.chestLockedStat); playerIn.connection.addFeed(TextColor.ORANGE + "%s wurde verriegelt", ilockablecontainer.getCommandName()); - playerIn.connection.sendPacket(new S29PacketSoundEffect(SoundEvent.DOOR, playerIn.posX, playerIn.posY, playerIn.posZ, 1.0F, 1.0F)); + playerIn.connection.sendPacket(new S29PacketSoundEffect(SoundEvent.DOOR, playerIn.posX, playerIn.posY, playerIn.posZ, 1.0F)); return true; } } diff --git a/java/src/game/block/BlockFire.java b/java/src/game/block/BlockFire.java index b261d30..201cef6 100755 --- a/java/src/game/block/BlockFire.java +++ b/java/src/game/block/BlockFire.java @@ -372,7 +372,7 @@ public class BlockFire extends Block { if (rand.chance(24)) { - worldIn.playSound((double)((float)pos.getX() + 0.5F), (double)((float)pos.getY() + 0.5F), (double)((float)pos.getZ() + 0.5F), SoundEvent.FIRE, 1.0F + rand.floatv(), rand.floatv() * 0.7F + 0.3F); + worldIn.playSound((double)((float)pos.getX() + 0.5F), (double)((float)pos.getY() + 0.5F), (double)((float)pos.getZ() + 0.5F), SoundEvent.FIRE, 1.0F + rand.floatv()); } if (!worldIn.isBlockSolid(pos.down()) && !Blocks.fire.canCatchFire(worldIn, pos.down())) diff --git a/java/src/game/block/BlockJukebox.java b/java/src/game/block/BlockJukebox.java index 5158faf..c88f2f4 100755 --- a/java/src/game/block/BlockJukebox.java +++ b/java/src/game/block/BlockJukebox.java @@ -31,7 +31,7 @@ public class BlockJukebox extends Block // worldIn.setBlockState(pos, state, 2); // } // playerIn.triggerAchievement(StatRegistry.jukeboxClickedStat); - worldIn.playSound(worldIn.rand.pick(SoundEvent.values()), pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, 1.0f, worldIn.rand.frange(0.5f, 2.0f)); + worldIn.playSound(worldIn.rand.pick(SoundEvent.values()), pos.getX() + 0.5, pos.getY() + 0.5, pos.getZ() + 0.5, 1.0f); } // else { // File dir = new File("midi"); diff --git a/java/src/game/block/BlockLever.java b/java/src/game/block/BlockLever.java index 80f4e26..369457c 100755 --- a/java/src/game/block/BlockLever.java +++ b/java/src/game/block/BlockLever.java @@ -206,7 +206,7 @@ public class BlockLever extends Block { state = state.cycleProperty(POWERED); worldIn.setState(pos, state, 3); - worldIn.playSound(SoundEvent.CLICK, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, 0.3F, ((Boolean)state.getValue(POWERED)).booleanValue() ? 0.6F : 0.5F); + worldIn.playSound(SoundEvent.CLICK, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, 0.3F); worldIn.notifyNeighborsOfStateChange(pos, this); Facing enumfacing = ((BlockLever.EnumOrientation)state.getValue(FACING)).getFacing(); worldIn.notifyNeighborsOfStateChange(pos.offset(enumfacing.getOpposite()), this); diff --git a/java/src/game/block/BlockLiquid.java b/java/src/game/block/BlockLiquid.java index 133bf64..6a2b1e7 100755 --- a/java/src/game/block/BlockLiquid.java +++ b/java/src/game/block/BlockLiquid.java @@ -248,7 +248,7 @@ public abstract class BlockLiquid extends Block { if (rand.chance(64)) { - worldIn.playSound(d0 + 0.5D, d1 + 0.5D, d2 + 0.5D, SoundEvent.WATER, rand.floatv() * 0.25F + 0.75F, rand.floatv() * 1.0F + 0.5F); + worldIn.playSound(d0 + 0.5D, d1 + 0.5D, d2 + 0.5D, SoundEvent.WATER, rand.floatv() * 0.25F + 0.75F); } } else if (rand.chance(10)) @@ -265,12 +265,12 @@ public abstract class BlockLiquid extends Block double d4 = d1 + this.maxY; double d6 = d2 + (double)rand.floatv(); worldIn.spawnParticle(ParticleType.LAVA, d8, d4, d6, 0.0D, 0.0D, 0.0D); - worldIn.playSound(d8, d4, d6, SoundEvent.LAVA_POP, 0.2F + rand.floatv() * 0.2F, 0.9F + rand.floatv() * 0.15F); + worldIn.playSound(d8, d4, d6, SoundEvent.LAVA_POP, 0.2F + rand.floatv() * 0.2F); } if (rand.chance(200)) { - worldIn.playSound(d0, d1, d2, SoundEvent.LAVA, 0.2F + rand.floatv() * 0.2F, 0.9F + rand.floatv() * 0.15F); + worldIn.playSound(d0, d1, d2, SoundEvent.LAVA, 0.2F + rand.floatv() * 0.2F); } } @@ -360,7 +360,7 @@ public abstract class BlockLiquid extends Block double d0 = (double)pos.getX(); double d1 = (double)pos.getY(); double d2 = (double)pos.getZ(); - worldIn.playSound(SoundEvent.FIZZ, d0 + 0.5D, d1 + 0.5D, d2 + 0.5D, 0.5F, 2.6F + (worldIn.rand.floatv() - worldIn.rand.floatv()) * 0.8F); + worldIn.playSound(SoundEvent.FIZZ, d0 + 0.5D, d1 + 0.5D, d2 + 0.5D, 0.5F); for (int i = 0; i < 8; ++i) { diff --git a/java/src/game/block/BlockNote.java b/java/src/game/block/BlockNote.java index 603160f..5e01ddb 100755 --- a/java/src/game/block/BlockNote.java +++ b/java/src/game/block/BlockNote.java @@ -106,7 +106,7 @@ public class BlockNote extends BlockContainer public boolean onBlockEventReceived(World worldIn, BlockPos pos, State state, int eventID, int eventParam) { float f = (float)Math.pow(2.0D, (double)(eventParam - 12) / 12.0D); - worldIn.playSound(SoundEvent.NOTE, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, 3.0F, f); + worldIn.playSound(SoundEvent.NOTE, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, 3.0F); worldIn.spawnParticle(ParticleType.NOTE, (double)pos.getX() + 0.5D, (double)pos.getY() + 1.2D, (double)pos.getZ() + 0.5D, (double)eventParam / 24.0D, 0.0D, 0.0D); return true; } diff --git a/java/src/game/block/BlockNuke.java b/java/src/game/block/BlockNuke.java index 920ee8c..ce5e470 100755 --- a/java/src/game/block/BlockNuke.java +++ b/java/src/game/block/BlockNuke.java @@ -54,7 +54,7 @@ public class BlockNuke extends Block { EntityNuke entitytntprimed = new EntityNuke(worldIn, (double)((float)pos.getX() + 0.5F), (double)pos.getY(), (double)((float)pos.getZ() + 0.5F)); worldIn.spawnEntityInWorld(entitytntprimed); - worldIn.playSoundAtEntity(entitytntprimed, SoundEvent.FUSE, 1.0F, 1.0F); + worldIn.playSoundAtEntity(entitytntprimed, SoundEvent.FUSE, 1.0F); } } diff --git a/java/src/game/block/BlockPistonBase.java b/java/src/game/block/BlockPistonBase.java index 80335aa..689abd6 100755 --- a/java/src/game/block/BlockPistonBase.java +++ b/java/src/game/block/BlockPistonBase.java @@ -389,7 +389,7 @@ public class BlockPistonBase extends Block } worldIn.setState(pos, state.withProperty(EXTENDED, Boolean.valueOf(true)), 2); - worldIn.playSound(SoundEvent.PISTON_OUT, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, 0.5F, worldIn.rand.floatv() * 0.25F + 0.6F); + worldIn.playSound(SoundEvent.PISTON_OUT, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, 0.5F); } else if (eventID == 1) { @@ -435,7 +435,7 @@ public class BlockPistonBase extends Block worldIn.setBlockToAir(pos.offset(enumfacing)); } - worldIn.playSound(SoundEvent.PISTON_IN, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, 0.5F, worldIn.rand.floatv() * 0.15F + 0.6F); + worldIn.playSound(SoundEvent.PISTON_IN, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, 0.5F); } return true; diff --git a/java/src/game/block/BlockRedstoneComparator.java b/java/src/game/block/BlockRedstoneComparator.java index b5b2403..6cead08 100755 --- a/java/src/game/block/BlockRedstoneComparator.java +++ b/java/src/game/block/BlockRedstoneComparator.java @@ -166,7 +166,7 @@ public class BlockRedstoneComparator extends BlockRedstoneDiode implements ITile // else // { state = state.cycleProperty(MODE); - worldIn.playSound(SoundEvent.CLICK, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, 0.3F, state.getValue(MODE) == BlockRedstoneComparator.Mode.SUBTRACT ? 0.55F : 0.5F); + worldIn.playSound(SoundEvent.CLICK, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, 0.3F); worldIn.setState(pos, state, 2); this.onStateChange(worldIn, pos, state); return true; diff --git a/java/src/game/block/BlockRedstoneTorch.java b/java/src/game/block/BlockRedstoneTorch.java index 5e0326e..81a79f3 100755 --- a/java/src/game/block/BlockRedstoneTorch.java +++ b/java/src/game/block/BlockRedstoneTorch.java @@ -133,7 +133,7 @@ public class BlockRedstoneTorch extends BlockTorch if (this.isBurnedOut(worldIn, pos, true)) { - worldIn.playSound(SoundEvent.FIZZ, (double)((float)pos.getX() + 0.5F), (double)((float)pos.getY() + 0.5F), (double)((float)pos.getZ() + 0.5F), 0.5F, 2.6F + (worldIn.rand.floatv() - worldIn.rand.floatv()) * 0.8F); + worldIn.playSound(SoundEvent.FIZZ, (double)((float)pos.getX() + 0.5F), (double)((float)pos.getY() + 0.5F), (double)((float)pos.getZ() + 0.5F), 0.5F); for (int i = 0; i < 5; ++i) { diff --git a/java/src/game/block/BlockTNT.java b/java/src/game/block/BlockTNT.java index 9a6ba9a..843a60b 100755 --- a/java/src/game/block/BlockTNT.java +++ b/java/src/game/block/BlockTNT.java @@ -88,7 +88,7 @@ public class BlockTNT extends Block { EntityTnt entitytntprimed = new EntityTnt(worldIn, (double)((float)pos.getX() + 0.5F), (double)pos.getY(), (double)((float)pos.getZ() + 0.5F), igniter, state.getValue(POWER).intValue()); worldIn.spawnEntityInWorld(entitytntprimed); - worldIn.playSoundAtEntity(entitytntprimed, SoundEvent.FUSE, 1.0F, 1.0F); + worldIn.playSoundAtEntity(entitytntprimed, SoundEvent.FUSE, 1.0F); } } } diff --git a/java/src/game/block/BlockTripWireHook.java b/java/src/game/block/BlockTripWireHook.java index 0d998c5..c1cfb43 100755 --- a/java/src/game/block/BlockTripWireHook.java +++ b/java/src/game/block/BlockTripWireHook.java @@ -237,19 +237,19 @@ public class BlockTripWireHook extends Block { if (powered && !wasPowered) { - worldIn.playSound(SoundEvent.CLICK, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.1D, (double)pos.getZ() + 0.5D, 0.4F, 0.6F); + worldIn.playSound(SoundEvent.CLICK, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.1D, (double)pos.getZ() + 0.5D, 0.4F); } else if (!powered && wasPowered) { - worldIn.playSound(SoundEvent.CLICK, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.1D, (double)pos.getZ() + 0.5D, 0.4F, 0.5F); + worldIn.playSound(SoundEvent.CLICK, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.1D, (double)pos.getZ() + 0.5D, 0.4F); } else if (attached && !wasAttached) { - worldIn.playSound(SoundEvent.CLICK, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.1D, (double)pos.getZ() + 0.5D, 0.4F, 0.7F); + worldIn.playSound(SoundEvent.CLICK, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.1D, (double)pos.getZ() + 0.5D, 0.4F); } else if (!attached && wasAttached) { - worldIn.playSound(SoundEvent.BOWHIT, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.1D, (double)pos.getZ() + 0.5D, 0.4F, 1.2F / (worldIn.rand.floatv() * 0.2F + 0.9F)); + worldIn.playSound(SoundEvent.BOWHIT, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.1D, (double)pos.getZ() + 0.5D, 0.4F); } } diff --git a/java/src/game/entity/Entity.java b/java/src/game/entity/Entity.java index 718d5a1..f8a4861 100755 --- a/java/src/game/entity/Entity.java +++ b/java/src/game/entity/Entity.java @@ -796,7 +796,7 @@ public abstract class Entity if (flag2 && this.fire > 0) { - this.playSound(SoundEvent.FIZZ, 0.7F, 1.6F + (this.rand.floatv() - this.rand.floatv()) * 0.4F); + this.playSound(SoundEvent.FIZZ, 0.7F); this.fire = -this.fireResistance; } @@ -850,19 +850,19 @@ public abstract class Entity { block$soundtype = Blocks.snow_layer.sound; if(block$soundtype.getStepSound() != null) - this.playSound(block$soundtype.getStepSound(), block$soundtype.getVolume() * 0.15F, block$soundtype.getFrequency()); + this.playSound(block$soundtype.getStepSound(), block$soundtype.getVolume() * 0.15F); } else if (!blockIn.getMaterial().isLiquid() && block$soundtype.getStepSound() != null) { - this.playSound(block$soundtype.getStepSound(), block$soundtype.getVolume() * 0.15F, block$soundtype.getFrequency()); + this.playSound(block$soundtype.getStepSound(), block$soundtype.getVolume() * 0.15F); } } - public void playSound(SoundEvent name, float volume, float pitch) + public void playSound(SoundEvent name, float volume) { // if (!this.isSilent()) // { - this.worldObj.playSoundAtEntity(this, name, volume, pitch); + this.worldObj.playSoundAtEntity(this, name, volume); // } } @@ -1004,7 +1004,7 @@ public abstract class Entity f = 1.0F; } - this.playSound(SoundEvent.SPLASH, f, 1.0F + (this.rand.floatv() - this.rand.floatv()) * 0.4F); + this.playSound(SoundEvent.SPLASH, f); float f1 = (float)ExtMath.floord(this.getEntityBoundingBox().minY); for (int i = 0; (float)i < 1.0F + this.width * 20.0F; ++i) diff --git a/java/src/game/entity/animal/EntityBat.java b/java/src/game/entity/animal/EntityBat.java index 18eab7d..ef8702f 100755 --- a/java/src/game/entity/animal/EntityBat.java +++ b/java/src/game/entity/animal/EntityBat.java @@ -51,13 +51,13 @@ public class EntityBat extends EntityLiving return 0.1F; } - /** - * Gets the pitch of living sounds in living entities. - */ - protected float getSoundPitch() - { - return super.getSoundPitch() * 0.95F; - } +// /** +// * Gets the pitch of living sounds in living entities. +// */ +// protected float getSoundPitch() +// { +// return super.getSoundPitch() * 0.95F; +// } /** * Returns the sound this mob makes while it's alive. diff --git a/java/src/game/entity/animal/EntityChicken.java b/java/src/game/entity/animal/EntityChicken.java index 423c85a..dd39420 100755 --- a/java/src/game/entity/animal/EntityChicken.java +++ b/java/src/game/entity/animal/EntityChicken.java @@ -88,7 +88,7 @@ public class EntityChicken extends EntityAnimal if (!this.worldObj.client && Config.eggTimer > 0 && !this.isChild() && !this.isChickenJockey() && --this.timeUntilNextEgg <= 0) { - this.playSound(SoundEvent.PLOP, 1.0F, (this.rand.floatv() - this.rand.floatv()) * 0.2F + 1.0F); + this.playSound(SoundEvent.PLOP, 1.0F); this.dropItem(Items.egg, 1); this.timeUntilNextEgg = this.rand.excl(Config.eggTimer, Config.eggTimer * 2); } diff --git a/java/src/game/entity/animal/EntityDragon.java b/java/src/game/entity/animal/EntityDragon.java index 178b69a..9774603 100755 --- a/java/src/game/entity/animal/EntityDragon.java +++ b/java/src/game/entity/animal/EntityDragon.java @@ -105,7 +105,7 @@ public class EntityDragon extends EntityLiving implements IEntityMultiPart if (f1 <= -0.3F && f >= -0.3F) // && !this.isSilent()) { - ((WorldClient)this.worldObj).playSound(this.posX, this.posY, this.posZ, SoundEvent.DRAGON_WINGS, 5.0F, 0.8F + this.rand.floatv() * 0.3F); + ((WorldClient)this.worldObj).playSound(this.posX, this.posY, this.posZ, SoundEvent.DRAGON_WINGS, 5.0F); } } diff --git a/java/src/game/entity/animal/EntityHorse.java b/java/src/game/entity/animal/EntityHorse.java index 5504239..e4ded49 100755 --- a/java/src/game/entity/animal/EntityHorse.java +++ b/java/src/game/entity/animal/EntityHorse.java @@ -418,7 +418,7 @@ public class EntityHorse extends EntityAnimal implements IInvBasic damageMultiplier = Math.max(0.0f, damageMultiplier - (1.65f - (float)this.worldObj.gravity * 1.65f)); if (distance > 1.0F) { - this.playSound(SoundEvent.HORSE_LAND, 0.4F, 1.0F); + this.playSound(SoundEvent.HORSE_LAND, 0.4F); } int i = ExtMath.ceilf((distance * 0.5F - 3.0F) * damageMultiplier); @@ -440,7 +440,7 @@ public class EntityHorse extends EntityAnimal implements IInvBasic { SoundType block$soundtype = block.sound; if(block$soundtype.getStepSound() != null) - this.worldObj.playSoundAtEntity(this, block$soundtype.getStepSound(), block$soundtype.getVolume() * 0.5F, block$soundtype.getFrequency() * 0.75F); + this.worldObj.playSoundAtEntity(this, block$soundtype.getStepSound(), block$soundtype.getVolume() * 0.5F); } } } @@ -637,25 +637,25 @@ public class EntityHorse extends EntityAnimal implements IInvBasic if (this.gallopTime > 5 && this.gallopTime % 3 == 0) { - this.playSound(SoundEvent.HORSE_GALLOP, block$soundtype.getVolume() * 0.15F, block$soundtype.getFrequency()); + this.playSound(SoundEvent.HORSE_GALLOP, block$soundtype.getVolume() * 0.15F); if (i == 0 && this.rand.chance(10)) { - this.playSound(SoundEvent.HORSE_BREATHE, block$soundtype.getVolume() * 0.6F, block$soundtype.getFrequency()); + this.playSound(SoundEvent.HORSE_BREATHE, block$soundtype.getVolume() * 0.6F); } } else if (this.gallopTime <= 5) { - this.playSound(SoundEvent.HORSE_WOOD, block$soundtype.getVolume() * 0.15F, block$soundtype.getFrequency()); + this.playSound(SoundEvent.HORSE_WOOD, block$soundtype.getVolume() * 0.15F); } } else if (block$soundtype == SoundType.WOOD) { - this.playSound(SoundEvent.HORSE_WOOD, block$soundtype.getVolume() * 0.15F, block$soundtype.getFrequency()); + this.playSound(SoundEvent.HORSE_WOOD, block$soundtype.getVolume() * 0.15F); } else { - this.playSound(SoundEvent.HORSE_SOFT, block$soundtype.getVolume() * 0.15F, block$soundtype.getFrequency()); + this.playSound(SoundEvent.HORSE_SOFT, block$soundtype.getVolume() * 0.15F); } } } @@ -946,7 +946,7 @@ public class EntityHorse extends EntityAnimal implements IInvBasic if (!flag && this.canCarryChest() && !this.isChested() && itemstack.getItem() == ItemRegistry.getItemFromBlock(Blocks.chest)) { this.setChested(true); - this.playSound(SoundEvent.PLOP, 1.0F, (this.rand.floatv() - this.rand.floatv()) * 0.2F + 1.0F); + this.playSound(SoundEvent.PLOP, 1.0F); flag = true; this.initHorseChest(); } @@ -1273,7 +1273,7 @@ public class EntityHorse extends EntityAnimal implements IInvBasic // if (s != null) // { - this.playSound(SoundEvent.HORSE_ANGRY, this.getSoundVolume(), this.getSoundPitch()); + this.playSound(SoundEvent.HORSE_ANGRY, this.getSoundVolume()); // } } @@ -1343,7 +1343,7 @@ public class EntityHorse extends EntityAnimal implements IInvBasic float f1 = ExtMath.cos(this.rotYaw * (float)Math.PI / 180.0F); this.motionX += (double)(-0.4F * f * this.jumpPower); this.motionZ += (double)(0.4F * f1 * this.jumpPower); - this.playSound(SoundEvent.HORSE_JUMP, 0.4F, 1.0F); + this.playSound(SoundEvent.HORSE_JUMP, 0.4F); } this.jumpPower = 0.0F; diff --git a/java/src/game/entity/animal/EntityMooshroom.java b/java/src/game/entity/animal/EntityMooshroom.java index 6b3a551..610c8bb 100755 --- a/java/src/game/entity/animal/EntityMooshroom.java +++ b/java/src/game/entity/animal/EntityMooshroom.java @@ -68,7 +68,7 @@ public class EntityMooshroom extends EntityCow } itemstack.damageItem(1, player); - this.playSound(SoundEvent.CUT, 1.0F, 1.0F); + this.playSound(SoundEvent.CUT, 1.0F); } return true; diff --git a/java/src/game/entity/animal/EntityMouse.java b/java/src/game/entity/animal/EntityMouse.java index b9db74a..f1c803f 100755 --- a/java/src/game/entity/animal/EntityMouse.java +++ b/java/src/game/entity/animal/EntityMouse.java @@ -68,9 +68,9 @@ public class EntityMouse extends EntityAnimal { return 0.3F; } - protected float getSoundPitch() { - return (this.rand.floatv() - this.rand.floatv()) * 0.2F + (this.isChild() ? 1.8F : 1.6F); - } +// protected float getSoundPitch() { +// return (this.rand.floatv() - this.rand.floatv()) * 0.2F + (this.isChild() ? 1.8F : 1.6F); +// } protected void dropFewItems(boolean hit, int looting) { int amt = this.rand.zrange(2); diff --git a/java/src/game/entity/animal/EntityRabbit.java b/java/src/game/entity/animal/EntityRabbit.java index cc8a054..ef813c3 100755 --- a/java/src/game/entity/animal/EntityRabbit.java +++ b/java/src/game/entity/animal/EntityRabbit.java @@ -106,7 +106,7 @@ public class EntityRabbit extends EntityAnimal { } else { this.setMovementSpeed(1.5D * (double)moveTypeIn.getSpeed()); - this.playSound(SoundEvent.RABBIT_JUMP, this.getSoundVolume(), ((this.rand.floatv() - this.rand.floatv()) * 0.2F + 1.0F) * 0.8F); + this.playSound(SoundEvent.RABBIT_JUMP, this.getSoundVolume()); } this.jumped = jump; } diff --git a/java/src/game/entity/animal/EntitySheep.java b/java/src/game/entity/animal/EntitySheep.java index e42bfa0..a068404 100755 --- a/java/src/game/entity/animal/EntitySheep.java +++ b/java/src/game/entity/animal/EntitySheep.java @@ -202,7 +202,7 @@ public class EntitySheep extends EntityAnimal } itemstack.damageItem(1, player); - this.playSound(SoundEvent.CUT, 1.0F, 1.0F); + this.playSound(SoundEvent.CUT, 1.0F); } return super.interact(player); diff --git a/java/src/game/entity/animal/EntityWolf.java b/java/src/game/entity/animal/EntityWolf.java index ce77c99..41a1ba8 100755 --- a/java/src/game/entity/animal/EntityWolf.java +++ b/java/src/game/entity/animal/EntityWolf.java @@ -247,7 +247,7 @@ public class EntityWolf extends EntityTameable { if (this.timeWolfIsShaking == 0.0F) { - this.playSound(SoundEvent.WOLF_SHAKE, this.getSoundVolume(), (this.rand.floatv() - this.rand.floatv()) * 0.2F + 1.0F); + this.playSound(SoundEvent.WOLF_SHAKE, this.getSoundVolume()); } this.prevTimeWolfIsShaking = this.timeWolfIsShaking; diff --git a/java/src/game/entity/effect/EntityLightning.java b/java/src/game/entity/effect/EntityLightning.java index ed61435..dd405db 100755 --- a/java/src/game/entity/effect/EntityLightning.java +++ b/java/src/game/entity/effect/EntityLightning.java @@ -47,8 +47,8 @@ public class EntityLightning extends EntityWeatherEffect if (this.lightningState == 2) { - this.worldObj.playSound(SoundEvent.THUNDER, this.posX, this.posY, this.posZ, 10000.0F, 0.8F + this.rand.floatv() * 0.2F); - this.worldObj.playSound(SoundEvent.EXPLODE, this.posX, this.posY, this.posZ, 2.0F, 0.5F + this.rand.floatv() * 0.2F); + this.worldObj.playSound(SoundEvent.THUNDER, this.posX, this.posY, this.posZ, 10000.0F); + this.worldObj.playSound(SoundEvent.EXPLODE, this.posX, this.posY, this.posZ, 2.0F); } --this.lightningState; diff --git a/java/src/game/entity/item/EntityFireworks.java b/java/src/game/entity/item/EntityFireworks.java index 10ef5d9..1598ff0 100755 --- a/java/src/game/entity/item/EntityFireworks.java +++ b/java/src/game/entity/item/EntityFireworks.java @@ -128,7 +128,7 @@ public class EntityFireworks extends Entity if (this.fireworkAge == 0) // && !this.isSilent()) { - this.worldObj.playSoundAtEntity(this, SoundEvent.LAUNCH, 3.0F, 1.0F); + this.worldObj.playSoundAtEntity(this, SoundEvent.LAUNCH, 3.0F); } ++this.fireworkAge; diff --git a/java/src/game/entity/item/EntityItem.java b/java/src/game/entity/item/EntityItem.java index ae00b58..8d52842 100755 --- a/java/src/game/entity/item/EntityItem.java +++ b/java/src/game/entity/item/EntityItem.java @@ -129,7 +129,7 @@ public class EntityItem extends Entity this.motionY = 0.20000000298023224D; this.motionX = (double)((this.rand.floatv() - this.rand.floatv()) * 0.2F); this.motionZ = (double)((this.rand.floatv() - this.rand.floatv()) * 0.2F); - this.playSound(SoundEvent.FIZZ, 0.4F, 2.0F + this.rand.floatv() * 0.4F); + this.playSound(SoundEvent.FIZZ, 0.4F); } if (!this.worldObj.client) @@ -445,7 +445,7 @@ public class EntityItem extends Entity // if (!this.isSilent()) // { - this.worldObj.playSoundAtEntity(entityIn, SoundEvent.POP, 0.2F, ((this.rand.floatv() - this.rand.floatv()) * 0.7F + 1.0F) * 2.0F); + this.worldObj.playSoundAtEntity(entityIn, SoundEvent.POP, 0.2F); // } entityIn.onItemPickup(this, i); diff --git a/java/src/game/entity/item/EntityTntCart.java b/java/src/game/entity/item/EntityTntCart.java index 4029d2c..f318b98 100755 --- a/java/src/game/entity/item/EntityTntCart.java +++ b/java/src/game/entity/item/EntityTntCart.java @@ -169,7 +169,7 @@ public class EntityTntCart extends EntityCart // if (!this.isSilent()) // { - this.worldObj.playSoundAtEntity(this, SoundEvent.FUSE, 1.0F, 1.0F); + this.worldObj.playSoundAtEntity(this, SoundEvent.FUSE, 1.0F); // } } } diff --git a/java/src/game/entity/item/EntityXp.java b/java/src/game/entity/item/EntityXp.java index 0ba6753..e83d289 100755 --- a/java/src/game/entity/item/EntityXp.java +++ b/java/src/game/entity/item/EntityXp.java @@ -110,7 +110,7 @@ public class EntityXp extends Entity implements IObjectData this.motionY = 0.20000000298023224D; this.motionX = (double)((this.rand.floatv() - this.rand.floatv()) * 0.2F); this.motionZ = (double)((this.rand.floatv() - this.rand.floatv()) * 0.2F); - this.playSound(SoundEvent.FIZZ, 0.4F, 2.0F + this.rand.floatv() * 0.4F); + this.playSound(SoundEvent.FIZZ, 0.4F); } this.pushOutOfBlocks(this.posX, (this.getEntityBoundingBox().minY + this.getEntityBoundingBox().maxY) / 2.0D, this.posZ); @@ -320,7 +320,7 @@ public class EntityXp extends Entity implements IObjectData if (this.delayBeforeCanPickup == 0 && entityIn.xpCooldown == 0) { entityIn.xpCooldown = Config.xpDelay; - this.worldObj.playSoundAtEntity(entityIn, SoundEvent.ORB, 0.1F, 0.5F * ((this.rand.floatv() - this.rand.floatv()) * 0.7F + 1.8F)); + this.worldObj.playSoundAtEntity(entityIn, SoundEvent.ORB, 0.1F); entityIn.onItemPickup(this, this.xpValue); entityIn.addExperience(this.xpValue); this.setDead(); diff --git a/java/src/game/entity/npc/EntityDarkMage.java b/java/src/game/entity/npc/EntityDarkMage.java index f631968..eb4e50f 100755 --- a/java/src/game/entity/npc/EntityDarkMage.java +++ b/java/src/game/entity/npc/EntityDarkMage.java @@ -78,7 +78,7 @@ public class EntityDarkMage extends EntityHoveringNPC { if(this.worldObj.client && this.isAttacking()) { if(this.rand.chance(24)) { // && !this.isSilent()) { ((WorldClient)this.worldObj).playSound(this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, SoundEvent.FIRE, - 1.0F + this.rand.floatv(), this.rand.floatv() * 0.7F + 0.3F); + 1.0F + this.rand.floatv()); } for(int i = 0; i < 2; ++i) { this.worldObj.spawnParticle(ParticleType.SMOKE_LARGE, this.posX + (this.rand.doublev() - 0.5D) * (double)this.width, diff --git a/java/src/game/entity/npc/EntityHaunter.java b/java/src/game/entity/npc/EntityHaunter.java index 9385010..06318a2 100755 --- a/java/src/game/entity/npc/EntityHaunter.java +++ b/java/src/game/entity/npc/EntityHaunter.java @@ -108,7 +108,7 @@ public class EntityHaunter extends EntityNPC { if (i > 0 && this.timeSinceIgnited == 0) { - this.playSound(SoundEvent.FUSE, 1.0F, 0.5F); + this.playSound(SoundEvent.FUSE, 1.0F); } this.timeSinceIgnited += i; @@ -241,7 +241,7 @@ public class EntityHaunter extends EntityNPC { if (itemstack != null && itemstack.getItem() == Items.flint_and_steel) { - this.worldObj.playSound(SoundEvent.IGNITE, this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, 1.0F, this.rand.floatv() * 0.4F + 0.8F); + this.worldObj.playSound(SoundEvent.IGNITE, this.posX + 0.5D, this.posY + 0.5D, this.posZ + 0.5D, 1.0F); player.swingItem(); if (!this.worldObj.client) diff --git a/java/src/game/entity/npc/EntityNPC.java b/java/src/game/entity/npc/EntityNPC.java index fa09c44..b6aa5a6 100755 --- a/java/src/game/entity/npc/EntityNPC.java +++ b/java/src/game/entity/npc/EntityNPC.java @@ -750,7 +750,7 @@ public abstract class EntityNPC extends EntityLiving entityarrow.setFire(100); } - this.playSound(SoundEvent.THROW, 1.0F, 1.0F / (this.getRNG().floatv() * 0.4F + 0.8F)); + this.playSound(SoundEvent.THROW, 1.0F); this.worldObj.spawnEntityInWorld(entityarrow); } else if(stack.getItem() instanceof ItemGunBase) { @@ -774,7 +774,7 @@ public abstract class EntityNPC extends EntityLiving // entityarrow.setFire(100); // } - this.playSound(SoundEvent.EXPLODE_ALT, 1.0f, 1.5f); + this.playSound(SoundEvent.EXPLODE_ALT, 1.0f); this.worldObj.spawnEntityInWorld(bullet); } else if(stack.getItem() == Items.snowball) { @@ -785,7 +785,7 @@ public abstract class EntityNPC extends EntityLiving double d3 = target.posZ - this.posZ; float f = ExtMath.sqrtd(d1 * d1 + d3 * d3) * 0.2F; entitysnowball.setThrowableHeading(d1, d2 + (double)f, d3, 1.6F, 12.0F); - this.playSound(SoundEvent.THROW, 1.0F, 1.0F / (this.getRNG().floatv() * 0.4F + 0.8F)); + this.playSound(SoundEvent.THROW, 1.0F); this.worldObj.spawnEntityInWorld(entitysnowball); } else if(stack.getItem() == Items.potion) { @@ -2152,14 +2152,14 @@ public abstract class EntityNPC extends EntityLiving this.sprintingTicksLeft = sprinting ? 600 : 0; } - public void playSound(SoundEvent name, float volume, float pitch) + public void playSound(SoundEvent name, float volume) { if(this.connection != null) - this.connection.playSound(name, volume, pitch); + this.connection.playSound(name, volume); else if(this.sendQueue != null) - ((WorldClient)this.worldObj).playSound(this.posX, this.posY, this.posZ, name, volume, pitch); + ((WorldClient)this.worldObj).playSound(this.posX, this.posY, this.posZ, name, volume); else if(this.gm == null) - super.playSound(name, volume, pitch); + super.playSound(name, volume); } public boolean isTicked() @@ -2903,7 +2903,7 @@ public abstract class EntityNPC extends EntityLiving if (levels > 0 && this.experienceLevel % 5 == 0 && (float)this.lastXPSound < (float)this.ticksExisted - 100.0F) { float f = this.experienceLevel > 30 ? 1.0F : (float)this.experienceLevel / 30.0F; - this.worldObj.playSoundAtEntity(this, SoundEvent.LEVELUP, f * 0.75F, 1.0F); + this.worldObj.playSoundAtEntity(this, SoundEvent.LEVELUP, f * 0.75F); this.lastXPSound = this.ticksExisted; } // super.addExperienceLevel(levels); @@ -3165,12 +3165,12 @@ public abstract class EntityNPC extends EntityLiving { if (itemStackIn.getItemUseAction() == ItemAction.DRINK) { - this.playSound(SoundEvent.DRINK, 0.5F, this.worldObj.rand.floatv() * 0.1F + 0.9F); + this.playSound(SoundEvent.DRINK, 0.5F); } if (itemStackIn.getItemUseAction() == ItemAction.EAT) { - this.playSound(SoundEvent.EAT, 0.5F + 0.5F * (float)this.rand.zrange(2), (this.rand.floatv() - this.rand.floatv()) * 0.2F + 1.0F); + this.playSound(SoundEvent.EAT, 0.5F + 0.5F * (float)this.rand.zrange(2)); } } diff --git a/java/src/game/entity/npc/EntitySlime.java b/java/src/game/entity/npc/EntitySlime.java index b6927d1..8a1ba50 100755 --- a/java/src/game/entity/npc/EntitySlime.java +++ b/java/src/game/entity/npc/EntitySlime.java @@ -180,7 +180,7 @@ public class EntitySlime extends EntityNPC // if (!this.isChild()) // { - this.playSound(this.jumpHeight < 0.5 ? SoundEvent.SLIME_SMALL : SoundEvent.SLIME_BIG, this.getSoundVolume(), ((this.rand.floatv() - this.rand.floatv()) * 0.2F + 1.0F) / 0.8F); + this.playSound(this.jumpHeight < 0.5 ? SoundEvent.SLIME_SMALL : SoundEvent.SLIME_BIG, this.getSoundVolume()); // } this.jumpHeight = 0.0; @@ -308,7 +308,7 @@ public class EntitySlime extends EntityNPC && this.getDistanceSqToEntity(p_175451_1_) < 0.6D * i * 0.6D * i && this.canAttack(p_175451_1_) && p_175451_1_.attackEntityFrom(DamageSource.causeMobDamage(this), this.rand.range(1, 3))) { - this.playSound(SoundEvent.SLIME_ATTACK, 1.0F, (this.rand.floatv() - this.rand.floatv()) * 0.2F + 1.0F); + this.playSound(SoundEvent.SLIME_ATTACK, 1.0F); this.applyEnchantments(this, p_175451_1_); } } @@ -662,7 +662,7 @@ public class EntitySlime extends EntityNPC // if (!this.slime.isChild()) // { - this.slime.playSound(this.slime.jumpHeight < 0.5 ? SoundEvent.SLIME_SMALL : SoundEvent.SLIME_BIG, this.slime.getSoundVolume(), ((this.slime.getRNG().floatv() - this.slime.getRNG().floatv()) * 0.2F + 1.0F) * 0.8F); + this.slime.playSound(this.slime.jumpHeight < 0.5 ? SoundEvent.SLIME_SMALL : SoundEvent.SLIME_BIG, this.slime.getSoundVolume()); // } } else diff --git a/java/src/game/entity/projectile/EntityArrow.java b/java/src/game/entity/projectile/EntityArrow.java index 1494187..84900d3 100755 --- a/java/src/game/entity/projectile/EntityArrow.java +++ b/java/src/game/entity/projectile/EntityArrow.java @@ -358,7 +358,7 @@ public class EntityArrow extends Entity implements IProjectile, IObjectData // } } - this.playSound(SoundEvent.BOWHIT, 1.0F, 1.2F / (this.rand.floatv() * 0.2F + 0.9F)); + this.playSound(SoundEvent.BOWHIT, 1.0F); // if (!(movingobjectposition.entityHit instanceof EntityAITakePlace)) // { @@ -391,7 +391,7 @@ public class EntityArrow extends Entity implements IProjectile, IObjectData this.posX -= this.motionX / (double)f5 * 0.05000000074505806D; this.posY -= this.motionY / (double)f5 * 0.05000000074505806D; this.posZ -= this.motionZ / (double)f5 * 0.05000000074505806D; - this.playSound(SoundEvent.BOWHIT, 1.0F, 1.2F / (this.rand.floatv() * 0.2F + 0.9F)); + this.playSound(SoundEvent.BOWHIT, 1.0F); this.inGround = true; this.arrowShake = 7; this.setIsCritical(false); @@ -539,7 +539,7 @@ public class EntityArrow extends Entity implements IProjectile, IObjectData if (flag) { - this.playSound(SoundEvent.POP, 0.2F, ((this.rand.floatv() - this.rand.floatv()) * 0.7F + 1.0F) * 2.0F); + this.playSound(SoundEvent.POP, 0.2F); entityIn.onItemPickup(this, 1); this.setDead(); } diff --git a/java/src/game/entity/projectile/EntityBullet.java b/java/src/game/entity/projectile/EntityBullet.java index 75758e0..452fcad 100755 --- a/java/src/game/entity/projectile/EntityBullet.java +++ b/java/src/game/entity/projectile/EntityBullet.java @@ -268,7 +268,7 @@ public class EntityBullet extends Entity implements IProjectile, IObjectData // } } - this.playSound(SoundEvent.METALHIT, 0.2F, this.rand.floatv() * 0.2F + 1.5F); + this.playSound(SoundEvent.METALHIT, 0.2F); // this.setDead(); } @@ -285,7 +285,7 @@ public class EntityBullet extends Entity implements IProjectile, IObjectData } else { - this.playSound(SoundEvent.METALHIT, 0.5F, this.rand.floatv() * 0.2F + 1.5F); + this.playSound(SoundEvent.METALHIT, 0.5F); this.setDead(); } diff --git a/java/src/game/entity/projectile/EntityDie.java b/java/src/game/entity/projectile/EntityDie.java index bdafb36..a308abd 100755 --- a/java/src/game/entity/projectile/EntityDie.java +++ b/java/src/game/entity/projectile/EntityDie.java @@ -137,7 +137,7 @@ public class EntityDie extends EntityThrowable implements IObjectData this.setDead(); else if(player.inventory.addItemStackToInventory(this.getStack())) { this.setDead(); - player.worldObj.playSoundAtEntity(player, SoundEvent.POP, 0.2F, ((player.getRNG().floatv() - player.getRNG().floatv()) * 0.7F + 1.0F) * 2.0F); + player.worldObj.playSoundAtEntity(player, SoundEvent.POP, 0.2F); player.inventoryContainer.detectAndSendChanges(); } } diff --git a/java/src/game/entity/projectile/EntityHook.java b/java/src/game/entity/projectile/EntityHook.java index c5eba13..3660022 100755 --- a/java/src/game/entity/projectile/EntityHook.java +++ b/java/src/game/entity/projectile/EntityHook.java @@ -415,7 +415,7 @@ public class EntityHook extends Entity implements IObjectData if (this.ticksCatchableDelay <= 0) { this.motionY -= 0.20000000298023224D; - this.playSound(SoundEvent.SPLASH, 0.25F, 1.0F + (this.rand.floatv() - this.rand.floatv()) * 0.4F); + this.playSound(SoundEvent.SPLASH, 0.25F); float f8 = (float)ExtMath.floord(this.getEntityBoundingBox().minY); worldserver.spawnParticle(ParticleType.WATER_BUBBLE, this.posX, (double)(f8 + 1.0F), this.posZ, (int)(1.0F + this.width * 20.0F), (double)this.width, 0.0D, (double)this.width, 0.20000000298023224D); worldserver.spawnParticle(ParticleType.WATER_WAKE, this.posX, (double)(f8 + 1.0F), this.posZ, (int)(1.0F + this.width * 20.0F), (double)this.width, 0.0D, (double)this.width, 0.20000000298023224D); diff --git a/java/src/game/entity/types/EntityAnimal.java b/java/src/game/entity/types/EntityAnimal.java index 75b8498..9db2c92 100755 --- a/java/src/game/entity/types/EntityAnimal.java +++ b/java/src/game/entity/types/EntityAnimal.java @@ -295,10 +295,10 @@ public abstract class EntityAnimal extends EntityLiving return !this.isChild(); } - protected float getSoundPitch() - { - return this.isChild() ? (this.rand.floatv() - this.rand.floatv()) * 0.2F + 1.5F : super.getSoundPitch(); - } +// protected float getSoundPitch() +// { +// return this.isChild() ? (this.rand.floatv() - this.rand.floatv()) * 0.2F + 1.5F : super.getSoundPitch(); +// } public int getTrackingRange() { return 80; diff --git a/java/src/game/entity/types/EntityLiving.java b/java/src/game/entity/types/EntityLiving.java index 331e9f3..da340e6 100755 --- a/java/src/game/entity/types/EntityLiving.java +++ b/java/src/game/entity/types/EntityLiving.java @@ -1036,7 +1036,7 @@ public abstract class EntityLiving extends Entity if (flag && s != null) { - this.playSound(s, this.getSoundVolume(), this.getSoundPitch()); + this.playSound(s, this.getSoundVolume()); } this.onDeath(source); @@ -1047,7 +1047,7 @@ public abstract class EntityLiving extends Entity if (flag && s1 != null) { - this.playSound(s1, this.getSoundVolume(), this.getSoundPitch()); + this.playSound(s1, this.getSoundVolume()); } } @@ -1061,7 +1061,7 @@ public abstract class EntityLiving extends Entity */ public void renderBrokenItemStack(ItemStack stack) { - this.playSound(SoundEvent.BREAK, 0.8F, 0.8F + this.worldObj.rand.floatv() * 0.4F); + this.playSound(SoundEvent.BREAK, 0.8F); for (int i = 0; i < 5; ++i) { @@ -1224,7 +1224,7 @@ public abstract class EntityLiving extends Entity if (i > 0) { if(Config.damageFall) { - this.playSound(i > 4 ? SoundEvent.FALL_BIG : SoundEvent.FALL_SMALL, 1.0F, 1.0F); + this.playSound(i > 4 ? SoundEvent.FALL_BIG : SoundEvent.FALL_SMALL, 1.0F); this.attackEntityFrom(DamageSource.fall, i); } int j = ExtMath.floord(this.posX); @@ -1236,7 +1236,7 @@ public abstract class EntityLiving extends Entity { SoundType block$soundtype = block.sound; if(block$soundtype.getStepSound() != null) - this.playSound(block$soundtype.getStepSound(), block$soundtype.getVolume() * 0.5F, block$soundtype.getFrequency() * 0.75F); + this.playSound(block$soundtype.getStepSound(), block$soundtype.getVolume() * 0.5F); } } } @@ -1437,7 +1437,7 @@ public abstract class EntityLiving extends Entity if (s != null) { - this.playSound(s, this.getSoundVolume(), (this.rand.floatv() - this.rand.floatv()) * 0.2F + 1.0F); + this.playSound(s, this.getSoundVolume()); } this.attackEntityFrom(DamageSource.generic, 0); @@ -1448,7 +1448,7 @@ public abstract class EntityLiving extends Entity if (s1 != null) { - this.playSound(s1, this.getSoundVolume(), (this.rand.floatv() - this.rand.floatv()) * 0.2F + 1.0F); + this.playSound(s1, this.getSoundVolume()); } this.setHealth(0); @@ -1563,13 +1563,13 @@ public abstract class EntityLiving extends Entity return 1.0F; } - /** - * Gets the pitch of living sounds in living entities. - */ - protected float getSoundPitch() - { - return (this.rand.floatv() - this.rand.floatv()) * 0.2F + 1.0F; - } +// /** +// * Gets the pitch of living sounds in living entities. +// */ +// protected float getSoundPitch() +// { +// return (this.rand.floatv() - this.rand.floatv()) * 0.2F + 1.0F; +// } /** * Dead and sleeping entities cannot move @@ -2667,7 +2667,7 @@ public abstract class EntityLiving extends Entity SoundEvent s = this.getLivingSound(); if(s != null) { - this.playSound(s, this.getSoundVolume(), this.getSoundPitch()); + this.playSound(s, this.getSoundVolume()); } } diff --git a/java/src/game/gui/element/ActButton.java b/java/src/game/gui/element/ActButton.java index 1b49e34..12c98ec 100644 --- a/java/src/game/gui/element/ActButton.java +++ b/java/src/game/gui/element/ActButton.java @@ -40,5 +40,6 @@ public class ActButton extends Element { public void mouse(Button btn, int x, int y, boolean ctrl, boolean shift) { this.func.use(this, (ctrl || (btn == Button.MOUSE_MIDDLE)) ? Mode.TERTIARY : ((shift || (btn == Button.MOUSE_RIGHT)) ? Mode.SECONDARY : Mode.PRIMARY)); this.formatText(); + this.playSound(); } } diff --git a/java/src/game/gui/element/Element.java b/java/src/game/gui/element/Element.java index fa43c30..611d697 100644 --- a/java/src/game/gui/element/Element.java +++ b/java/src/game/gui/element/Element.java @@ -3,9 +3,12 @@ package game.gui.element; import org.lwjgl.opengl.GL11; import game.Game; +import game.audio.PositionedSound; +import game.audio.Volume; import game.gui.Font; import game.gui.Gui; import game.gui.element.Dropdown.Handle; +import game.init.SoundEvent; import game.renderer.Drawing; import game.renderer.Drawing.Vec2i; import game.util.Formatter; @@ -276,4 +279,8 @@ public abstract class Element { public void drawPress() { Drawing.drawRectColor(this.pos_x, this.pos_y, this.size_x, this.size_y, this.gm.style.press); } + + public void playSound() { + this.gm.getSoundManager().playSound(new PositionedSound(SoundEvent.CLICK, Volume.GUI)); + } } diff --git a/java/src/game/init/DispenserRegistry.java b/java/src/game/init/DispenserRegistry.java index 027f3e2..eef268e 100755 --- a/java/src/game/init/DispenserRegistry.java +++ b/java/src/game/init/DispenserRegistry.java @@ -402,7 +402,7 @@ public abstract class DispenserRegistry { BlockPos blockpos = source.getBlockPos().offset(BlockDispenser.getFacing(source.getBlockMetadata())); EntityTnt entitytntprimed = new EntityTnt(world, (double)blockpos.getX() + 0.5D, (double)blockpos.getY(), (double)blockpos.getZ() + 0.5D, (EntityLiving)null, stack.getMetadata()); world.spawnEntityInWorld(entitytntprimed); - world.playSoundAtEntity(entitytntprimed, SoundEvent.FUSE, 1.0F, 1.0F); + world.playSoundAtEntity(entitytntprimed, SoundEvent.FUSE, 1.0F); --stack.stackSize; return stack; } diff --git a/java/src/game/item/ItemBlock.java b/java/src/game/item/ItemBlock.java index 3cbc1d6..0572120 100755 --- a/java/src/game/item/ItemBlock.java +++ b/java/src/game/item/ItemBlock.java @@ -84,7 +84,7 @@ public class ItemBlock extends Item this.block.onBlockPlacedBy(worldIn, pos, iblockstate1, playerIn, stack); } - worldIn.playSound(this.block.sound.getPlaceSound(), (double)((float)pos.getX() + 0.5F), (double)((float)pos.getY() + 0.5F), (double)((float)pos.getZ() + 0.5F), (this.block.sound.getVolume() + 1.0F) / 2.0F, this.block.sound.getFrequency() * 0.8F); + worldIn.playSound(this.block.sound.getPlaceSound(), (double)((float)pos.getX() + 0.5F), (double)((float)pos.getY() + 0.5F), (double)((float)pos.getZ() + 0.5F), (this.block.sound.getVolume() + 1.0F) / 2.0F); --stack.stackSize; } diff --git a/java/src/game/item/ItemBow.java b/java/src/game/item/ItemBow.java index d8d8f95..88f466c 100755 --- a/java/src/game/item/ItemBow.java +++ b/java/src/game/item/ItemBow.java @@ -71,7 +71,7 @@ public class ItemBow extends Item } stack.damageItem(1, playerIn); - worldIn.playSoundAtEntity(playerIn, SoundEvent.THROW, 1.0F, 1.0F / (itemRand.floatv() * 0.4F + 1.2F) + f * 0.5F); + worldIn.playSoundAtEntity(playerIn, SoundEvent.THROW, 1.0F); if (flag) { diff --git a/java/src/game/item/ItemBucket.java b/java/src/game/item/ItemBucket.java index 26f8482..ea99b5b 100755 --- a/java/src/game/item/ItemBucket.java +++ b/java/src/game/item/ItemBucket.java @@ -256,7 +256,7 @@ public class ItemBucket extends Item int i = pos.getX(); int j = pos.getY(); int k = pos.getZ(); - worldIn.playSound(SoundEvent.FIZZ, (double)((float)i + 0.5F), (double)((float)j + 0.5F), (double)((float)k + 0.5F), 0.5F, 2.6F + (worldIn.rand.floatv() - worldIn.rand.floatv()) * 0.8F); + worldIn.playSound(SoundEvent.FIZZ, (double)((float)i + 0.5F), (double)((float)j + 0.5F), (double)((float)k + 0.5F), 0.5F); for (int l = 0; l < 8; ++l) { diff --git a/java/src/game/item/ItemChargedOrb.java b/java/src/game/item/ItemChargedOrb.java index 8e49c3d..928e51e 100755 --- a/java/src/game/item/ItemChargedOrb.java +++ b/java/src/game/item/ItemChargedOrb.java @@ -32,7 +32,7 @@ public class ItemChargedOrb extends ItemFragile if(itemStackIn.getItemDamage() >= this.getMaxDamage()) return itemStackIn; itemStackIn.damageItem(1, playerIn); - worldIn.playSoundAtEntity(playerIn, SoundEvent.THROW, 0.5F, 0.4F / (itemRand.floatv() * 0.4F + 0.8F)); + worldIn.playSoundAtEntity(playerIn, SoundEvent.THROW, 0.5F); if (!worldIn.client) { diff --git a/java/src/game/item/ItemDie.java b/java/src/game/item/ItemDie.java index 58223da..c2f29ca 100755 --- a/java/src/game/item/ItemDie.java +++ b/java/src/game/item/ItemDie.java @@ -31,7 +31,7 @@ public class ItemDie extends Item --itemStackIn.stackSize; // } - worldIn.playSoundAtEntity(playerIn, SoundEvent.THROW, 0.5F, 0.4F / (itemRand.floatv() * 0.4F + 0.8F)); + worldIn.playSoundAtEntity(playerIn, SoundEvent.THROW, 0.5F); if (!worldIn.client) { diff --git a/java/src/game/item/ItemDynamite.java b/java/src/game/item/ItemDynamite.java index b6cec92..ffd637d 100755 --- a/java/src/game/item/ItemDynamite.java +++ b/java/src/game/item/ItemDynamite.java @@ -30,7 +30,7 @@ public class ItemDynamite extends Item --itemStackIn.stackSize; // } - worldIn.playSoundAtEntity(playerIn, SoundEvent.THROW, 0.5F, 0.4F / (itemRand.floatv() * 0.4F + 0.8F)); + worldIn.playSoundAtEntity(playerIn, SoundEvent.THROW, 0.5F); if (!worldIn.client) { diff --git a/java/src/game/item/ItemEgg.java b/java/src/game/item/ItemEgg.java index e8a384b..2f95774 100755 --- a/java/src/game/item/ItemEgg.java +++ b/java/src/game/item/ItemEgg.java @@ -22,7 +22,7 @@ public class ItemEgg extends Item --itemStackIn.stackSize; // } - worldIn.playSoundAtEntity(playerIn, SoundEvent.THROW, 0.5F, 0.4F / (itemRand.floatv() * 0.4F + 0.8F)); + worldIn.playSoundAtEntity(playerIn, SoundEvent.THROW, 0.5F); if (!worldIn.client) { diff --git a/java/src/game/item/ItemExpBottle.java b/java/src/game/item/ItemExpBottle.java index 702d547..9d5fd72 100755 --- a/java/src/game/item/ItemExpBottle.java +++ b/java/src/game/item/ItemExpBottle.java @@ -27,7 +27,7 @@ public class ItemExpBottle extends Item --itemStackIn.stackSize; // } - worldIn.playSoundAtEntity(playerIn, SoundEvent.THROW, 0.5F, 0.4F / (itemRand.floatv() * 0.4F + 0.8F)); + worldIn.playSoundAtEntity(playerIn, SoundEvent.THROW, 0.5F); if (!worldIn.client) { diff --git a/java/src/game/item/ItemExterminator.java b/java/src/game/item/ItemExterminator.java index 137d145..4b1d5e9 100755 --- a/java/src/game/item/ItemExterminator.java +++ b/java/src/game/item/ItemExterminator.java @@ -19,7 +19,7 @@ public class ItemExterminator extends ItemMagnetic { public ItemStack onItemRightClick(ItemStack stack, World world, EntityNPC player) { if(!world.client) { - world.playSoundAtEntity(player, SoundEvent.CLICK, 1.0F, 2.0F); + world.playSoundAtEntity(player, SoundEvent.CLICK, 1.0F); if(world.dimension == Space.INSTANCE) player.connection.addFeed(TextColor.RED + "Der Weltraum kann nicht zerstört werden (lol)"); else if(!((WorldServer)world).exterminate()) diff --git a/java/src/game/item/ItemFireball.java b/java/src/game/item/ItemFireball.java index 94a9d68..dc9dc57 100755 --- a/java/src/game/item/ItemFireball.java +++ b/java/src/game/item/ItemFireball.java @@ -36,7 +36,7 @@ public class ItemFireball extends Item { if (worldIn.getState(pos).getBlock().getMaterial() == Material.air) { - worldIn.playSound(SoundEvent.FIREBALL, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, 1.0F, (itemRand.floatv() - itemRand.floatv()) * 0.2F + 1.0F); + worldIn.playSound(SoundEvent.FIREBALL, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, 1.0F); worldIn.setState(pos, Blocks.fire.getState()); } diff --git a/java/src/game/item/ItemFishingRod.java b/java/src/game/item/ItemFishingRod.java index 4b67be5..ca91cc9 100755 --- a/java/src/game/item/ItemFishingRod.java +++ b/java/src/game/item/ItemFishingRod.java @@ -48,7 +48,7 @@ public class ItemFishingRod extends Item } else { - worldIn.playSoundAtEntity(playerIn, SoundEvent.THROW, 0.5F, 0.4F / (itemRand.floatv() * 0.4F + 0.8F)); + worldIn.playSoundAtEntity(playerIn, SoundEvent.THROW, 0.5F); if (!worldIn.client) { diff --git a/java/src/game/item/ItemFlintAndSteel.java b/java/src/game/item/ItemFlintAndSteel.java index f0e047a..677ca10 100755 --- a/java/src/game/item/ItemFlintAndSteel.java +++ b/java/src/game/item/ItemFlintAndSteel.java @@ -32,7 +32,7 @@ public class ItemFlintAndSteel extends Item { if (worldIn.getState(pos).getBlock().getMaterial() == Material.air) { - worldIn.playSound(SoundEvent.IGNITE, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, 1.0F, itemRand.floatv() * 0.4F + 0.8F); + worldIn.playSound(SoundEvent.IGNITE, (double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, 1.0F); worldIn.setState(pos, Blocks.fire.getState()); } diff --git a/java/src/game/item/ItemFood.java b/java/src/game/item/ItemFood.java index 4f2505b..621c5ef 100755 --- a/java/src/game/item/ItemFood.java +++ b/java/src/game/item/ItemFood.java @@ -31,7 +31,7 @@ public class ItemFood extends Item { // if(!playerIn.creative) --stack.stackSize; - worldIn.playSoundAtEntity(playerIn, SoundEvent.EAT, 0.5F, worldIn.rand.floatv() * 0.1F + 0.9F); + worldIn.playSoundAtEntity(playerIn, SoundEvent.EAT, 0.5F); playerIn.heal((int)((float)this.getHealAmount(stack) * 0.5f * (1.0f + worldIn.rand.floatv()))); this.onFoodEaten(stack, worldIn, playerIn); // playerIn.triggerAchievement(StatRegistry.objectUseStats[ItemRegistry.getIdFromItem(this)]); diff --git a/java/src/game/item/ItemGunBase.java b/java/src/game/item/ItemGunBase.java index 1fb2cd8..7eca186 100755 --- a/java/src/game/item/ItemGunBase.java +++ b/java/src/game/item/ItemGunBase.java @@ -56,7 +56,7 @@ public abstract class ItemGunBase extends Item // } stack.damageItem(1, playerIn); - worldIn.playSoundAtEntity(playerIn, SoundEvent.EXPLODE_ALT, 1.0F, 1.5F); + worldIn.playSoundAtEntity(playerIn, SoundEvent.EXPLODE_ALT, 1.0F); if(!flag) playerIn.inventory.consumeInventoryItem(this.getAmmo()); diff --git a/java/src/game/item/ItemHoe.java b/java/src/game/item/ItemHoe.java index 2b9311a..b157295 100755 --- a/java/src/game/item/ItemHoe.java +++ b/java/src/game/item/ItemHoe.java @@ -67,7 +67,7 @@ public class ItemHoe extends Item protected boolean useHoe(ItemStack stack, EntityNPC player, World worldIn, BlockPos target, State newState) { if(newState.getBlock().sound.getStepSound() != null) - worldIn.playSound(newState.getBlock().sound.getStepSound(), (double)((float)target.getX() + 0.5F), (double)((float)target.getY() + 0.5F), (double)((float)target.getZ() + 0.5F), (newState.getBlock().sound.getVolume() + 1.0F) / 2.0F, newState.getBlock().sound.getFrequency() * 0.8F); + worldIn.playSound(newState.getBlock().sound.getStepSound(), (double)((float)target.getX() + 0.5F), (double)((float)target.getY() + 0.5F), (double)((float)target.getZ() + 0.5F), (newState.getBlock().sound.getVolume() + 1.0F) / 2.0F); if (worldIn.client) { diff --git a/java/src/game/item/ItemPotion.java b/java/src/game/item/ItemPotion.java index 63e40e3..d670b82 100755 --- a/java/src/game/item/ItemPotion.java +++ b/java/src/game/item/ItemPotion.java @@ -151,7 +151,7 @@ public class ItemPotion extends Item --itemStackIn.stackSize; // } - worldIn.playSoundAtEntity(playerIn, SoundEvent.THROW, 0.5F, 0.4F / (itemRand.floatv() * 0.4F + 0.8F)); + worldIn.playSoundAtEntity(playerIn, SoundEvent.THROW, 0.5F); if (!worldIn.client) { diff --git a/java/src/game/item/ItemReed.java b/java/src/game/item/ItemReed.java index a8b38ef..c1587fc 100755 --- a/java/src/game/item/ItemReed.java +++ b/java/src/game/item/ItemReed.java @@ -65,7 +65,7 @@ public class ItemReed extends Item iblockstate1.getBlock().onBlockPlacedBy(worldIn, pos, iblockstate1, playerIn, stack); } - worldIn.playSound(this.block.sound.getPlaceSound(), (double)((float)pos.getX() + 0.5F), (double)((float)pos.getY() + 0.5F), (double)((float)pos.getZ() + 0.5F), (this.block.sound.getVolume() + 1.0F) / 2.0F, this.block.sound.getFrequency() * 0.8F); + worldIn.playSound(this.block.sound.getPlaceSound(), (double)((float)pos.getX() + 0.5F), (double)((float)pos.getY() + 0.5F), (double)((float)pos.getZ() + 0.5F), (this.block.sound.getVolume() + 1.0F) / 2.0F); --stack.stackSize; return true; } diff --git a/java/src/game/item/ItemSlab.java b/java/src/game/item/ItemSlab.java index 20909a1..ecd0042 100755 --- a/java/src/game/item/ItemSlab.java +++ b/java/src/game/item/ItemSlab.java @@ -68,7 +68,7 @@ public class ItemSlab extends ItemBlock if (worldIn.checkNoEntityCollision(this.slab.getCollisionBoundingBox(worldIn, pos, iblockstate1)) && worldIn.setState(pos, iblockstate1, 3)) { - worldIn.playSound(this.slab.sound.getPlaceSound(), (double)((float)pos.getX() + 0.5F), (double)((float)pos.getY() + 0.5F), (double)((float)pos.getZ() + 0.5F), (this.slab.sound.getVolume() + 1.0F) / 2.0F, this.slab.sound.getFrequency() * 0.8F); + worldIn.playSound(this.slab.sound.getPlaceSound(), (double)((float)pos.getX() + 0.5F), (double)((float)pos.getY() + 0.5F), (double)((float)pos.getZ() + 0.5F), (this.slab.sound.getVolume() + 1.0F) / 2.0F); --stack.stackSize; } @@ -142,7 +142,7 @@ public class ItemSlab extends ItemBlock if (worldIn.checkNoEntityCollision(this.slab.getCollisionBoundingBox(worldIn, pos, iblockstate1)) && worldIn.setState(pos, iblockstate1, 3)) { - worldIn.playSound(this.slab.sound.getPlaceSound(), (double)((float)pos.getX() + 0.5F), (double)((float)pos.getY() + 0.5F), (double)((float)pos.getZ() + 0.5F), (this.slab.sound.getVolume() + 1.0F) / 2.0F, this.slab.sound.getFrequency() * 0.8F); + worldIn.playSound(this.slab.sound.getPlaceSound(), (double)((float)pos.getX() + 0.5F), (double)((float)pos.getY() + 0.5F), (double)((float)pos.getZ() + 0.5F), (this.slab.sound.getVolume() + 1.0F) / 2.0F); --stack.stackSize; } @@ -172,7 +172,7 @@ public class ItemSlab extends ItemBlock if (worldIn.setState(pos, iblockstate1, 3)) { - worldIn.playSound(this.slab.sound.getPlaceSound(), (double)((float)pos.getX() + 0.5F), (double)((float)pos.getY() + 0.5F), (double)((float)pos.getZ() + 0.5F), (this.slab.sound.getVolume() + 1.0F) / 2.0F, this.slab.sound.getFrequency() * 0.8F); + worldIn.playSound(this.slab.sound.getPlaceSound(), (double)((float)pos.getX() + 0.5F), (double)((float)pos.getY() + 0.5F), (double)((float)pos.getZ() + 0.5F), (this.slab.sound.getVolume() + 1.0F) / 2.0F); --stack.stackSize; } diff --git a/java/src/game/item/ItemSnow.java b/java/src/game/item/ItemSnow.java index 0f224c6..156add7 100755 --- a/java/src/game/item/ItemSnow.java +++ b/java/src/game/item/ItemSnow.java @@ -55,7 +55,7 @@ public class ItemSnow extends ItemBlock if (axisalignedbb != null && worldIn.checkNoEntityCollision(axisalignedbb) && worldIn.setState(blockpos, iblockstate1, 2)) { - worldIn.playSound(this.block.sound.getPlaceSound(), (double)((float)blockpos.getX() + 0.5F), (double)((float)blockpos.getY() + 0.5F), (double)((float)blockpos.getZ() + 0.5F), (this.block.sound.getVolume() + 1.0F) / 2.0F, this.block.sound.getFrequency() * 0.8F); + worldIn.playSound(this.block.sound.getPlaceSound(), (double)((float)blockpos.getX() + 0.5F), (double)((float)blockpos.getY() + 0.5F), (double)((float)blockpos.getZ() + 0.5F), (this.block.sound.getVolume() + 1.0F) / 2.0F); --stack.stackSize; return true; } diff --git a/java/src/game/item/ItemSnowball.java b/java/src/game/item/ItemSnowball.java index 86924e8..7d1cb5e 100755 --- a/java/src/game/item/ItemSnowball.java +++ b/java/src/game/item/ItemSnowball.java @@ -22,7 +22,7 @@ public class ItemSnowball extends Item --itemStackIn.stackSize; // } - worldIn.playSoundAtEntity(playerIn, SoundEvent.THROW, 0.5F, 0.4F / (itemRand.floatv() * 0.4F + 0.8F)); + worldIn.playSoundAtEntity(playerIn, SoundEvent.THROW, 0.5F); if (!worldIn.client) { diff --git a/java/src/game/item/ItemWeatherToken.java b/java/src/game/item/ItemWeatherToken.java index 5756e99..2bc3fb7 100755 --- a/java/src/game/item/ItemWeatherToken.java +++ b/java/src/game/item/ItemWeatherToken.java @@ -21,7 +21,7 @@ public class ItemWeatherToken extends ItemMagnetic { if(worldIn.dimension.getType().weather) { // if (!playerIn.creative) --itemStackIn.stackSize; - worldIn.playSoundAtEntity(playerIn, SoundEvent.SPELL, 0.5F, 0.4F / (itemRand.floatv() * 0.4F + 0.8F)); + worldIn.playSoundAtEntity(playerIn, SoundEvent.SPELL, 0.5F); if (!worldIn.client) { WorldServer world = (WorldServer)worldIn; diff --git a/java/src/game/network/NetHandlerPlayClient.java b/java/src/game/network/NetHandlerPlayClient.java index 12f62bb..bb0a827 100755 --- a/java/src/game/network/NetHandlerPlayClient.java +++ b/java/src/game/network/NetHandlerPlayClient.java @@ -8,7 +8,6 @@ import java.util.Set; import com.google.common.collect.Maps; import game.Game; -import game.audio.PositionedSound; import game.dimension.Dimension; import game.entity.DataWatcher; import game.entity.Entity; @@ -136,7 +135,7 @@ public class NetHandlerPlayClient extends NetHandler * reset upon respawning */ private boolean doneLoadingTerrain; - private boolean travelSound; +// private boolean travelSound; private final Map playerList = Maps.newTreeMap(); // private final List> players = Lists.newArrayList(); // private boolean field_147308_k = false; @@ -643,11 +642,11 @@ public class NetHandlerPlayClient extends NetHandler this.gameController.thePlayer.prevZ = this.gameController.thePlayer.posZ; this.doneLoadingTerrain = true; // this.gameController.displayGuiScreen(null); - if(this.travelSound) { - this.gameController.getSoundManager().playSound(new PositionedSound(SoundEvent.TELEPORT)); -// this.clientWorldController.playSound(entityplayer.posX, entityplayer.posY + (double)entityplayer.getEyeHeight(), entityplayer.posZ, this.travelSound, 1.0F, 1.0F, false); - this.travelSound = false; - } +// if(this.travelSound) { +// this.gameController.getSoundManager().playSound(new PositionedSound(SoundEvent.TELEPORT)); +//// this.clientWorldController.playSound(entityplayer.posX, entityplayer.posY + (double)entityplayer.getEyeHeight(), entityplayer.posZ, this.travelSound, 1.0F, 1.0F, false); +// this.travelSound = false; +// } } } @@ -745,11 +744,11 @@ public class NetHandlerPlayClient extends NetHandler { if (entity instanceof EntityXp) { - this.clientWorldController.playSoundAtEntity(entity, SoundEvent.ORB, 0.2F, ((this.avRandomizer.floatv() - this.avRandomizer.floatv()) * 0.7F + 1.0F) * 2.0F); + this.clientWorldController.playSoundAtEntity(entity, SoundEvent.ORB, 0.2F); } else { - this.clientWorldController.playSoundAtEntity(entity, SoundEvent.POP, 0.2F, ((this.avRandomizer.floatv() - this.avRandomizer.floatv()) * 0.7F + 1.0F) * 2.0F); + this.clientWorldController.playSoundAtEntity(entity, SoundEvent.POP, 0.2F); } this.gameController.effectRenderer.addEffect(new EntityPickupFX(this.clientWorldController, entity, entitylivingbase, 0.5F)); @@ -1544,7 +1543,7 @@ public class NetHandlerPlayClient extends NetHandler // else if(packetIn.getSoundName().startsWith("music#")) { // return; // } - this.gameController.theWorld.playSound(packetIn.getX(), packetIn.getY(), packetIn.getZ(), packetIn.getSound(), packetIn.getVolume(), packetIn.getPitch()); + this.gameController.theWorld.playSound(packetIn.getX(), packetIn.getY(), packetIn.getZ(), packetIn.getSound(), packetIn.getVolume()); } // public void handleDisplay(S48PacketDisplay packetIn) diff --git a/java/src/game/network/NetHandlerPlayServer.java b/java/src/game/network/NetHandlerPlayServer.java index 70d1fa5..22ab7d8 100755 --- a/java/src/game/network/NetHandlerPlayServer.java +++ b/java/src/game/network/NetHandlerPlayServer.java @@ -695,7 +695,7 @@ public class NetHandlerPlayServer extends NetHandler implements ICrafting, Scrip if (ilockablecontainer.isLocked() && !this.entity.canOpen(ilockablecontainer.getLockCode())) // && !this.isSpectator()) { this.addFeed(TextColor.RED + "%s ist verschlossen!", chestInventory.getCommandName()); - this.sendPacket(new S29PacketSoundEffect(SoundEvent.DOOR, this.entity.posX, this.entity.posY, this.entity.posZ, 1.0F, 1.0F)); + this.sendPacket(new S29PacketSoundEffect(SoundEvent.DOOR, this.entity.posX, this.entity.posY, this.entity.posZ, 1.0F)); return; } } @@ -819,9 +819,9 @@ public class NetHandlerPlayServer extends NetHandler implements ICrafting, Scrip this.entity.getServerWorld().updateTrackedPlayer(this.entity); } - public void playSound(SoundEvent name, float volume, float pitch) + public void playSound(SoundEvent name, float volume) { - this.server.sendNearExcept(this.entity, this.entity.posX, this.entity.posY, this.entity.posZ, volume > 1.0F ? (double)(16.0F * volume) : 16.0D, this.entity.worldObj.dimension.getDimensionId(), new S29PacketSoundEffect(name, this.entity.posX, this.entity.posY, this.entity.posZ, volume, pitch)); + this.server.sendNearExcept(this.entity, this.entity.posX, this.entity.posY, this.entity.posZ, volume > 1.0F ? (double)(16.0F * volume) : 16.0D, this.entity.worldObj.dimension.getDimensionId(), new S29PacketSoundEffect(name, this.entity.posX, this.entity.posY, this.entity.posZ, volume)); } @@ -2939,7 +2939,7 @@ public class NetHandlerPlayServer extends NetHandler implements ICrafting, Scrip this.entity.openContainer.detectAndSendChanges(); if(amount <= 0) return; - this.entity.worldObj.playSoundAtEntity(this.entity, SoundEvent.POP, 0.2F, ((this.entity.worldObj.rand.floatv() - this.entity.worldObj.rand.floatv()) * 0.7F + 1.0F) * 2.0F); + this.entity.worldObj.playSoundAtEntity(this.entity, SoundEvent.POP, 0.2F); if(amount == 1) this.addFeed(TextColor.DGREEN + "* %s geschummelt", itemstack.getColoredName(TextColor.DGREEN)); diff --git a/java/src/game/packet/S29PacketSoundEffect.java b/java/src/game/packet/S29PacketSoundEffect.java index 40f8b5e..f076919 100755 --- a/java/src/game/packet/S29PacketSoundEffect.java +++ b/java/src/game/packet/S29PacketSoundEffect.java @@ -6,7 +6,6 @@ import game.init.SoundEvent; import game.network.NetHandlerPlayClient; import game.network.Packet; import game.network.PacketBuffer; -import game.util.ExtMath; public class S29PacketSoundEffect implements Packet { @@ -15,14 +14,13 @@ public class S29PacketSoundEffect implements Packet private int posY = Integer.MAX_VALUE; private int posZ; private float soundVolume; - private int soundPitch; public S29PacketSoundEffect() { this.sound = null; } - public S29PacketSoundEffect(SoundEvent sound, double soundX, double soundY, double soundZ, float volume, float pitch) + public S29PacketSoundEffect(SoundEvent sound, double soundX, double soundY, double soundZ, float volume) { this.sound = sound; if(this.sound == null) { @@ -33,8 +31,6 @@ public class S29PacketSoundEffect implements Packet this.posY = (int)(soundY * 8.0D); this.posZ = (int)(soundZ * 8.0D); this.soundVolume = volume; - this.soundPitch = (int)(pitch * 63.0F); - pitch = ExtMath.clampf(pitch, 0.0F, 255.0F); } /** @@ -48,7 +44,6 @@ public class S29PacketSoundEffect implements Packet this.posY = buf.readInt(); this.posZ = buf.readInt(); this.soundVolume = buf.readFloat(); - this.soundPitch = buf.readUnsignedByte(); } } @@ -63,7 +58,6 @@ public class S29PacketSoundEffect implements Packet buf.writeInt(this.posY); buf.writeInt(this.posZ); buf.writeFloat(this.soundVolume); - buf.writeByte(this.soundPitch); } } @@ -91,11 +85,6 @@ public class S29PacketSoundEffect implements Packet { return this.soundVolume; } - - public float getPitch() - { - return (float)this.soundPitch / 63.0F; - } public void processPacket(NetHandlerPlayClient handler) { diff --git a/java/src/game/renderer/EntityRenderer.java b/java/src/game/renderer/EntityRenderer.java index a9b02ea..f3a3dbd 100755 --- a/java/src/game/renderer/EntityRenderer.java +++ b/java/src/game/renderer/EntityRenderer.java @@ -1191,11 +1191,11 @@ public class EntityRenderer { if (d1 > (double)(blockpos.getY() + 1) && world.getPrecipitationHeight(blockpos).getY() > ExtMath.floorf((float)blockpos.getY())) { - this.gm.theWorld.playSound(d0, d1, d2, n >= j ? this.pickMoltenSound() : SoundEvent.RAIN, n >= j ? 0.2f : 0.1F, 0.5F); + this.gm.theWorld.playSound(d0, d1, d2, n >= j ? this.pickMoltenSound() : SoundEvent.RAIN, n >= j ? 0.2f : 0.1F); } else { - this.gm.theWorld.playSound(d0, d1, d2, n >= j ? this.pickMoltenSound() : SoundEvent.RAIN, n >= j ? 0.4f : 0.2F, 1.0F); + this.gm.theWorld.playSound(d0, d1, d2, n >= j ? this.pickMoltenSound() : SoundEvent.RAIN, n >= j ? 0.4f : 0.2F); } } } diff --git a/java/src/game/renderer/particle/EntityFirework.java b/java/src/game/renderer/particle/EntityFirework.java index e201fe6..24f483b 100755 --- a/java/src/game/renderer/particle/EntityFirework.java +++ b/java/src/game/renderer/particle/EntityFirework.java @@ -262,7 +262,7 @@ public class EntityFirework SoundEvent s1 = flag1 ? (flag ? SoundEvent.BLAST_LARGE_FAR : SoundEvent.BLAST_LARGE) : (flag ? SoundEvent.BLAST_SMALL_FAR : SoundEvent.BLAST_SMALL); - ((WorldClient)this.worldObj).playSound(this.posX, this.posY, this.posZ, s1, 20.0F, 0.95F + this.rand.floatv() * 0.1F); + ((WorldClient)this.worldObj).playSound(this.posX, this.posY, this.posZ, s1, 20.0F); } if (this.fireworkAge % 2 == 0 && this.fireworkExplosions != null && this.fireworkAge / 2 < this.fireworkExplosions.tagCount()) @@ -324,7 +324,7 @@ public class EntityFirework { boolean flag3 = this.isFarAway(); SoundEvent s = flag3 ? SoundEvent.TWINKLE_FAR : SoundEvent.TWINKLE; - ((WorldClient)this.worldObj).playSound(this.posX, this.posY, this.posZ, s, 20.0F, 0.9F + this.rand.floatv() * 0.15F); + ((WorldClient)this.worldObj).playSound(this.posX, this.posY, this.posZ, s, 20.0F); } this.setDead(); diff --git a/java/src/game/tileentity/TileEntityChest.java b/java/src/game/tileentity/TileEntityChest.java index 3a7ffee..e0481a8 100755 --- a/java/src/game/tileentity/TileEntityChest.java +++ b/java/src/game/tileentity/TileEntityChest.java @@ -369,7 +369,7 @@ public class TileEntityChest extends TileEntityLockable implements ITickable, II d1 += 0.5D; } - this.worldObj.playSound(SoundEvent.CHESTOPEN, d1, (double)j + 0.5D, d2, 0.5F, this.worldObj.rand.floatv() * 0.1F + 0.9F); + this.worldObj.playSound(SoundEvent.CHESTOPEN, d1, (double)j + 0.5D, d2, 0.5F); } if (this.numPlayersUsing == 0 && this.lidAngle > 0.0F || this.numPlayersUsing > 0 && this.lidAngle < 1.0F) @@ -407,7 +407,7 @@ public class TileEntityChest extends TileEntityLockable implements ITickable, II d3 += 0.5D; } - this.worldObj.playSound(SoundEvent.CHESTCLOSED, d3, (double)j + 0.5D, d0, 0.5F, this.worldObj.rand.floatv() * 0.1F + 0.9F); + this.worldObj.playSound(SoundEvent.CHESTCLOSED, d3, (double)j + 0.5D, d0, 0.5F); } if (this.lidAngle < 0.0F) diff --git a/java/src/game/world/Explosion.java b/java/src/game/world/Explosion.java index 694a439..1f74d1b 100755 --- a/java/src/game/world/Explosion.java +++ b/java/src/game/world/Explosion.java @@ -169,7 +169,7 @@ public class Explosion if(iblockstate.getBlock().getMaterial() != Material.air && iblockstate.getBlock().getExplosionResistance(null) < 60000.0f) { worldObj.setState(blockpos, Blocks.air.getState(), 3); if(rand.chance(1000)) { - worldObj.playSound(SoundEvent.EXPLODE, explosionX + x, explosionY + y, explosionZ + z, 4.0F, (1.0F + (worldObj.rand.floatv() - worldObj.rand.floatv()) * 0.2F) * 0.7F); + worldObj.playSound(SoundEvent.EXPLODE, explosionX + x, explosionY + y, explosionZ + z, 4.0F); ((WorldServer)worldObj).spawnParticle(ParticleType.EXPLOSION_HUGE, explosionX + x, explosionY + y, explosionZ + z, 0, rand.gaussian() * 0.02D, rand.gaussian() * 0.02D, rand.gaussian() * 0.02D, 1.0); } } @@ -265,7 +265,7 @@ public class Explosion */ public void doExplosionB(boolean spawnParticles, boolean altSound) { - this.worldObj.playSound(altSound ? SoundEvent.EXPLODE_ALT : SoundEvent.EXPLODE, this.explosionX, this.explosionY, this.explosionZ, 4.0F, (1.0F + (this.worldObj.rand.floatv() - this.worldObj.rand.floatv()) * 0.2F) * 0.7F); + this.worldObj.playSound(altSound ? SoundEvent.EXPLODE_ALT : SoundEvent.EXPLODE, this.explosionX, this.explosionY, this.explosionZ, 4.0F); if (this.explosionSize >= 2.0F && this.isSmoking) { diff --git a/java/src/game/world/World.java b/java/src/game/world/World.java index 9e7136c..50980c3 100755 --- a/java/src/game/world/World.java +++ b/java/src/game/world/World.java @@ -725,8 +725,8 @@ public abstract class World implements IWorldAccess { } } - public void playSoundAtEntity(Entity entityIn, SoundEvent name, float volume, float pitch) { - this.playSound(name, entityIn.posX, entityIn.posY, entityIn.posZ, volume, pitch); + public void playSoundAtEntity(Entity entityIn, SoundEvent name, float volume) { + this.playSound(name, entityIn.posX, entityIn.posY, entityIn.posZ, volume); } public boolean spawnEntityInWorld(Entity entityIn) { @@ -2131,7 +2131,7 @@ public abstract class World implements IWorldAccess { public abstract void markBlockForUpdate(BlockPos pos); protected abstract void notifyLightSet(BlockPos pos); public abstract void markBlockRangeForRenderUpdate(int x1, int y1, int z1, int x2, int y2, int z2); - public abstract void playSound(SoundEvent sound, double x, double y, double z, float volume, float pitch); + public abstract void playSound(SoundEvent sound, double x, double y, double z, float volume); protected abstract void onEntityAdded(Entity entityIn); protected abstract void onEntityRemoved(Entity entityIn); // public abstract void broadcastSound(int soundID, BlockPos pos, int data); diff --git a/java/src/game/world/WorldClient.java b/java/src/game/world/WorldClient.java index 2088246..e2150b9 100755 --- a/java/src/game/world/WorldClient.java +++ b/java/src/game/world/WorldClient.java @@ -318,7 +318,7 @@ public class WorldClient extends World } } - public void playSound(double x, double y, double z, SoundEvent sound, float volume, float ignored) + public void playSound(double x, double y, double z, SoundEvent sound, float volume) { // if(this.gm.oldStepSounds && (soundName.equals("random.swim") || soundName.equals("step.ladder"))) // return; @@ -356,7 +356,7 @@ public class WorldClient extends World return "Chunk-Cache: M " + this.chunkMapping.getNumHashElements() + ", L " + this.chunkListing.size(); } - public void playSound(SoundEvent sound, double x, double y, double z, float volume, float pitch) + public void playSound(SoundEvent sound, double x, double y, double z, float volume) { } @@ -440,9 +440,9 @@ public class WorldClient extends World // } // } - private void playSoundAtPos(BlockPos pos, SoundEvent sound, float volume, float pitch) + private void playSoundAtPos(BlockPos pos, SoundEvent sound, float volume) { - this.playSound((double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, sound, volume, pitch); + this.playSound((double)pos.getX() + 0.5D, (double)pos.getY() + 0.5D, (double)pos.getZ() + 0.5D, sound, volume); } public void playAuxSFX(EntityNPC player, int sfxType, BlockPos blockPosIn, int data) @@ -450,43 +450,43 @@ public class WorldClient extends World switch (sfxType) { case 1000: - this.playSoundAtPos(blockPosIn, SoundEvent.CLICK, 1.0F, 1.0F); + this.playSoundAtPos(blockPosIn, SoundEvent.CLICK, 1.0F); break; case 1001: - this.playSoundAtPos(blockPosIn, SoundEvent.CLICK, 1.0F, 1.2F); + this.playSoundAtPos(blockPosIn, SoundEvent.CLICK, 1.0F); break; case 1002: - this.playSoundAtPos(blockPosIn, SoundEvent.THROW, 1.0F, 1.2F); + this.playSoundAtPos(blockPosIn, SoundEvent.THROW, 1.0F); break; case 1003: - this.playSoundAtPos(blockPosIn, SoundEvent.DOOR, 1.0F, this.rand.floatv() * 0.1F + 0.9F); + this.playSoundAtPos(blockPosIn, SoundEvent.DOOR, 1.0F); break; case 1004: - this.playSoundAtPos(blockPosIn, SoundEvent.FIZZ, 0.5F, 2.6F + (this.rand.floatv() - this.rand.floatv()) * 0.8F); + this.playSoundAtPos(blockPosIn, SoundEvent.FIZZ, 0.5F); break; case 1005: - this.playSoundAtPos(blockPosIn, SoundEvent.TELEPORT, 10.0F, (this.rand.floatv() - this.rand.floatv()) * 0.2F + 1.0F); + this.playSoundAtPos(blockPosIn, SoundEvent.TELEPORT, 10.0F); break; case 1006: - this.playSoundAtPos(blockPosIn, SoundEvent.DOOR, 1.0F, this.rand.floatv() * 0.1F + 0.9F); + this.playSoundAtPos(blockPosIn, SoundEvent.DOOR, 1.0F); break; case 1007: - this.playSoundAtPos(blockPosIn, SoundEvent.SPELL, 10.0F, (this.rand.floatv() - this.rand.floatv()) * 0.2F + 0.5F); + this.playSoundAtPos(blockPosIn, SoundEvent.SPELL, 10.0F); break; case 1008: - this.playSoundAtPos(blockPosIn, SoundEvent.FIREBALL, 10.0F, (this.rand.floatv() - this.rand.floatv()) * 0.2F + 1.0F); + this.playSoundAtPos(blockPosIn, SoundEvent.FIREBALL, 10.0F); break; case 1009: - this.playSoundAtPos(blockPosIn, SoundEvent.FIREBALL, 2.0F, (this.rand.floatv() - this.rand.floatv()) * 0.2F + 1.0F); + this.playSoundAtPos(blockPosIn, SoundEvent.FIREBALL, 2.0F); break; // case 1010: @@ -502,35 +502,35 @@ public class WorldClient extends World // break; case 1013: - this.playSoundAtPos(blockPosIn, SoundEvent.TELEPORT_REV, 0.5F, (this.rand.floatv() - this.rand.floatv()) * 0.2F + 1.0F); + this.playSoundAtPos(blockPosIn, SoundEvent.TELEPORT_REV, 0.5F); break; case 1014: - this.playSoundAtPos(blockPosIn, SoundEvent.METAL, 2.0F, (this.rand.floatv() - this.rand.floatv()) * 0.2F + 1.0F); + this.playSoundAtPos(blockPosIn, SoundEvent.METAL, 2.0F); break; case 1015: - this.playSoundAtPos(blockPosIn, SoundEvent.BAT_TAKEOFF, 0.05F, (this.rand.floatv() - this.rand.floatv()) * 0.2F + 1.0F); + this.playSoundAtPos(blockPosIn, SoundEvent.BAT_TAKEOFF, 0.05F); break; case 1016: - this.playSoundAtPos(blockPosIn, SoundEvent.FIREBALL, 2.0F, this.rand.floatv() * 0.1F + 1.5F); + this.playSoundAtPos(blockPosIn, SoundEvent.FIREBALL, 2.0F); break; case 1017: - this.playSoundAtPos(blockPosIn, SoundEvent.EXPLODE, 20.0f, 2.0f); + this.playSoundAtPos(blockPosIn, SoundEvent.EXPLODE, 20.0f); break; case 1020: - this.playSoundAtPos(blockPosIn, SoundEvent.ANVIL_BREAK, 1.0F, this.rand.floatv() * 0.1F + 0.9F); + this.playSoundAtPos(blockPosIn, SoundEvent.ANVIL_BREAK, 1.0F); break; case 1021: - this.playSoundAtPos(blockPosIn, SoundEvent.ANVIL_USE, 1.0F, this.rand.floatv() * 0.1F + 0.9F); + this.playSoundAtPos(blockPosIn, SoundEvent.ANVIL_USE, 1.0F); break; case 1022: - this.playSoundAtPos(blockPosIn, SoundEvent.ANVIL_LAND, 0.3F, this.rand.floatv() * 0.1F + 0.9F); + this.playSoundAtPos(blockPosIn, SoundEvent.ANVIL_LAND, 0.3F); break; case 1023: @@ -542,11 +542,11 @@ public class WorldClient extends World // d131, d141, d161, random.gaussian() * 0.15D, random.doublev() * 0.2D, random.gaussian() * 0.15D, // new int[] {ItemRegistry.getIdFromItem(ItemRegistry.getItemFromBlock(Blocks.glass)), 0}); // } - this.playSoundAtPos(blockPosIn, SoundEvent.GLASS, 1.0F, this.rand.floatv() * 0.1F + 0.9F); + this.playSoundAtPos(blockPosIn, SoundEvent.GLASS, 1.0F); break; case 1024: - this.playSoundAtPos(blockPosIn, SoundEvent.CLICK, 1.0F, 1.3F); + this.playSoundAtPos(blockPosIn, SoundEvent.CLICK, 1.0F); break; case 1025: @@ -554,7 +554,7 @@ public class WorldClient extends World for(int z = 0; z < 30; z++) { this.playSoundAtPos(pos.set(blockPosIn.getX() + this.rand.range(-128, 128), blockPosIn.getY() + this.rand.range(-4, 4), blockPosIn.getZ() + this.rand.range(-128, 128)), - SoundEvent.EXPLODE, 30.0F, this.rand.floatv() * 0.1F + 0.9F); + SoundEvent.EXPLODE, 30.0F); } break; @@ -636,7 +636,7 @@ public class WorldClient extends World } } - this.playSoundAtPos(blockPosIn, SoundEvent.GLASS, 1.0F, this.rand.floatv() * 0.1F + 0.9F); + this.playSoundAtPos(blockPosIn, SoundEvent.GLASS, 1.0F); break; case 2004: diff --git a/java/src/game/world/WorldServer.java b/java/src/game/world/WorldServer.java index 5d55ea0..d424199 100755 --- a/java/src/game/world/WorldServer.java +++ b/java/src/game/world/WorldServer.java @@ -1666,9 +1666,9 @@ public final class WorldServer extends World { return this.seaLevel; } - public void playSound(SoundEvent sound, double x, double y, double z, float volume, float pitch) + public void playSound(SoundEvent sound, double x, double y, double z, float volume) { - this.server.sendNear(x, y, z, volume > 1.0F ? (double)(16.0F * volume) : 16.0D, this.dimension.getDimensionId(), new S29PacketSoundEffect(sound, x, y, z, volume, pitch)); + this.server.sendNear(x, y, z, volume > 1.0F ? (double)(16.0F * volume) : 16.0D, this.dimension.getDimensionId(), new S29PacketSoundEffect(sound, x, y, z, volume)); } public void markBlockRangeForRenderUpdate(int x1, int y1, int z1, int x2, int y2, int z2)