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

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