1
0
Fork 0

remove some sounds

This commit is contained in:
Sen 2025-09-10 10:11:50 +02:00
parent 6e2c9ca2d7
commit 521dabb042
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
206 changed files with 60 additions and 463 deletions

View file

@ -19,7 +19,6 @@ import common.collect.Maps;
import common.entity.npc.EntityNPC; import common.entity.npc.EntityNPC;
import common.init.SoundEvent; import common.init.SoundEvent;
import common.log.Log; import common.log.Log;
import common.rng.Random;
import common.sound.MovingSound; import common.sound.MovingSound;
import common.sound.Sound; import common.sound.Sound;
import common.util.ExtMath; import common.util.ExtMath;
@ -76,8 +75,7 @@ public class SoundManager {
} }
} }
private static final Random RANDOM = new Random(); private static final Map<SoundEvent, short[]> BUFFERS = Maps.newEnumMap(SoundEvent.class);
private static final Map<SoundEvent, short[][]> BUFFERS = Maps.newEnumMap(SoundEvent.class);
private final Map<String, Sound> playingSounds = HashBiMap.<String, Sound>create(); private final Map<String, Sound> playingSounds = HashBiMap.<String, Sound>create();
private final Map<Sound, String> invPlayingSounds = ((BiMap)this.playingSounds).inverse(); private final Map<Sound, String> invPlayingSounds = ((BiMap)this.playingSounds).inverse();
@ -100,13 +98,10 @@ public class SoundManager {
public static void loadSounds() { public static void loadSounds() {
for(SoundEvent entry : SoundEvent.values()) { for(SoundEvent entry : SoundEvent.values()) {
short[][] buffers = new short[entry.getSounds().length][]; String sound = entry.getSound();
for(int z = 0; z < entry.getSounds().length; z++) { Log.SOUND.trace("Lade Sound %s", sound);
String sound = entry.getSounds()[z]; short[] buffer = readOgg("sounds/" + sound + ".ogg");
Log.SOUND.trace("Lade Sound %s", sound); BUFFERS.put(entry, buffer);
buffers[z] = readOgg("sounds/" + sound + ".ogg");
}
BUFFERS.put(entry, buffers);
} }
} }
@ -135,7 +130,7 @@ public class SoundManager {
} }
private static short[] getBuffer(SoundEvent event) { private static short[] getBuffer(SoundEvent event) {
return RANDOM.pick(BUFFERS.get(event)); return BUFFERS.get(event);
} }
public void unload() public void unload()

View file

@ -1421,10 +1421,6 @@ public class ClientPlayer implements IClientPlayer
this.playSoundAtPos(blockPosIn, SoundEvent.METAL, 2.0F); this.playSoundAtPos(blockPosIn, SoundEvent.METAL, 2.0F);
break; break;
case 1015:
this.playSoundAtPos(blockPosIn, SoundEvent.BAT_TAKEOFF, 0.05F);
break;
case 1016: case 1016:
this.playSoundAtPos(blockPosIn, SoundEvent.FIREBALL, 2.0F); this.playSoundAtPos(blockPosIn, SoundEvent.FIREBALL, 2.0F);
break; break;
@ -1433,10 +1429,6 @@ public class ClientPlayer implements IClientPlayer
this.playSoundAtPos(blockPosIn, SoundEvent.EXPLODE, 20.0f); this.playSoundAtPos(blockPosIn, SoundEvent.EXPLODE, 20.0f);
break; break;
case 1020:
this.playSoundAtPos(blockPosIn, SoundEvent.ANVIL_BREAK, 1.0F);
break;
case 1021: case 1021:
this.playSoundAtPos(blockPosIn, SoundEvent.ANVIL_USE, 1.0F); this.playSoundAtPos(blockPosIn, SoundEvent.ANVIL_USE, 1.0F);
break; break;
@ -1446,7 +1438,7 @@ public class ClientPlayer implements IClientPlayer
break; break;
case 1023: case 1023:
this.playSoundAtPos(blockPosIn, SoundEvent.GLASS, 1.0F); this.playSoundAtPos(blockPosIn, SoundEvent.GLASS_BREAK, 1.0F);
break; break;
case 1024: case 1024:
@ -1493,7 +1485,7 @@ public class ClientPlayer implements IClientPlayer
if (state != null && state.getBlock() != Blocks.air) if (state != null && state.getBlock() != Blocks.air)
{ {
this.gm.getSoundManager().playSound(new PositionedSound(state.getBlock().getSound().getBreakSound(), 1.0F, /* block.sound.getFrequency() * 0.8F, */ (float)blockPosIn.getX() + 0.5F, (float)blockPosIn.getY() + 0.5F, (float)blockPosIn.getZ() + 0.5F)); this.gm.getSoundManager().playSound(new PositionedSound(SoundEvent.BLOCK_BREAK, 0.5F, /* block.sound.getFrequency() * 0.8F, */ (float)blockPosIn.getX() + 0.5F, (float)blockPosIn.getY() + 0.5F, (float)blockPosIn.getZ() + 0.5F));
} }
if(state != null) if(state != null)
this.gm.effectRenderer.destroyBlock(blockPosIn, state); this.gm.effectRenderer.destroyBlock(blockPosIn, state);
@ -1514,7 +1506,7 @@ public class ClientPlayer implements IClientPlayer
this.spawnParticle(ParticleType.POTION, d13, d14, d16, data); this.spawnParticle(ParticleType.POTION, d13, d14, d16, data);
} }
this.playSoundAtPos(blockPosIn, SoundEvent.GLASS, 1.0F); this.playSoundAtPos(blockPosIn, SoundEvent.GLASS_BREAK, 1.0F);
break; break;
case 2005: case 2005:

View file

@ -8,6 +8,7 @@ import common.entity.npc.EntityNPC;
import common.init.BlockRegistry; import common.init.BlockRegistry;
import common.init.Blocks; import common.init.Blocks;
import common.init.EntityRegistry; import common.init.EntityRegistry;
import common.init.SoundEvent;
import common.item.ItemControl; import common.item.ItemControl;
import common.item.ItemStack; import common.item.ItemStack;
import common.packet.CPacketAction; import common.packet.CPacketAction;
@ -147,8 +148,8 @@ public class PlayerController {
else { else {
this.damage += block.getHardness(this.gm.player, this.gm.player.worldObj, pos); this.damage += block.getHardness(this.gm.player, this.gm.player.worldObj, pos);
if(this.stepCounter % 4.0F == 0.0F && block.getSound().getStepSound() != null) { if(this.stepCounter % 4.0F == 0.0F) {
this.gm.getSoundManager().playSound(new PositionedSound(block.getSound().getStepSound(), 0.25F, this.gm.getSoundManager().playSound(new PositionedSound(SoundEvent.BLOCK_DAMAGE, 0.05F,
(float)pos.getX() + 0.5F, (float)pos.getY() + 0.5F, (float)pos.getZ() + 0.5F)); (float)pos.getX() + 0.5F, (float)pos.getY() + 0.5F, (float)pos.getZ() + 0.5F));
} }

Some files were not shown because too many files have changed in this diff Show more