sound changes, press sounds, remove pitch

This commit is contained in:
Sen 2025-03-18 12:03:56 +01:00
parent c5219ce100
commit c602585e6a
76 changed files with 231 additions and 251 deletions

View file

@ -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;

View file

@ -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;
}
}

View file

@ -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;
}
}
}

View file

@ -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)

View file

@ -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)

View file

@ -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;
}
}

View file

@ -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()))

View file

@ -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");

View file

@ -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);

View file

@ -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)
{

View file

@ -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;
}

View file

@ -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);
}
}

View file

@ -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;

View file

@ -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;

View file

@ -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)
{

View file

@ -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);
}
}
}

View file

@ -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);
}
}

View file

@ -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)

View file

@ -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.

View file

@ -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);
}

View file

@ -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);
}
}

View file

@ -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;

View file

@ -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;

View file

@ -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);

View file

@ -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;
}

View file

@ -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);

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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);

View file

@ -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);
// }
}
}

View file

@ -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();

View file

@ -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,

View file

@ -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)

View file

@ -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));
}
}

View file

@ -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

View file

@ -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();
}

View file

@ -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();
}

View file

@ -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();
}
}

View file

@ -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);

View file

@ -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;

View file

@ -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());
}
}

View file

@ -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();
}
}

View file

@ -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));
}
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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)
{

View file

@ -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)
{

View file

@ -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)
{

View file

@ -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)
{

View file

@ -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)
{

View file

@ -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)
{

View file

@ -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)
{

View file

@ -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())

View file

@ -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());
}

View file

@ -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)
{

View file

@ -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());
}

View file

@ -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)]);

View file

@ -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());

View file

@ -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)
{

View file

@ -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)
{

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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;
}

View file

@ -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)
{

View file

@ -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;

View file

@ -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<String, Integer> playerList = Maps.<String, Integer>newTreeMap();
// private final List<Entry<String, Integer>> 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)

View file

@ -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));

View file

@ -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<NetHandlerPlayClient>
{
@ -15,14 +14,13 @@ public class S29PacketSoundEffect implements Packet<NetHandlerPlayClient>
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<NetHandlerPlayClient>
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<NetHandlerPlayClient>
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<NetHandlerPlayClient>
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<NetHandlerPlayClient>
{
return this.soundVolume;
}
public float getPitch()
{
return (float)this.soundPitch / 63.0F;
}
public void processPacket(NetHandlerPlayClient handler)
{

View file

@ -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);
}
}
}

View file

@ -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();

View file

@ -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)

View file

@ -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)
{

View file

@ -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);

View file

@ -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:

View file

@ -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)