Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1428 #1429

Open
wants to merge 1 commit into
base: 1.12.2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main/java/com/flansmod/common/guns/ItemGun.java
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ public void playShotSound(World world, Vector3f position, Boolean silenced) {
// Play shot sounds
if(soundDelay <= 0 && type.shootSound != null)
{
PacketPlaySound.sendSoundPacket(position.x, position.y, position.z, FlansMod.soundRange, world.provider.getDimension(), type.shootSound, silenced);
PacketPlaySound.sendSoundPacket(position.x, position.y, position.z, silenced ? (FlansMod.soundRange*0.75F) : FlansMod.soundRange, world.provider.getDimension(), type.shootSound, silenced);
soundDelay = type.idleSoundLength;
}
}
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/com/flansmod/common/network/PacketPlaySound.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,34 +29,34 @@ public PacketPlaySound()
{
}

public static void sendSoundPacket(double x, double y, double z, double range, int dimension, String s, boolean distort)
public static void sendSoundPacket(double x, double y, double z, double range, int dimension, String s, boolean silenced)
{
sendSoundPacket(x, y, z, range, dimension, s, distort, false);
sendSoundPacket(x, y, z, range, dimension, s, silenced, false);
}

public static void sendSoundPacket(double x, double y, double z, double range, int dimension, String s, boolean distort, boolean silenced)
public static void sendSoundPacket(double x, double y, double z, double range, int dimension, String s, boolean silenced, boolean distort)
{
FlansMod.getPacketHandler().sendToAllAround(new PacketPlaySound(x, y, z, s, distort, silenced), x, y, z, (float)range, dimension);
FlansMod.getPacketHandler().sendToAllAround(new PacketPlaySound(x, y, z, s, silenced, distort), x, y, z, (float)range, dimension);
}

public PacketPlaySound(double x, double y, double z, String s)
{
this(x, y, z, s, false);
}

public PacketPlaySound(double x, double y, double z, String s, boolean distort)
public PacketPlaySound(double x, double y, double z, String s, boolean silenced)
{
this(x, y, z, s, distort, false);
this(x, y, z, s, silenced, false);
}

public PacketPlaySound(double x, double y, double z, String s, boolean distort, boolean silenced)
public PacketPlaySound(double x, double y, double z, String s, boolean silenced, boolean distort)
{
posX = (float)x;
posY = (float)y;
posZ = (float)z;
sound = s;
this.distort = distort;
this.silenced = silenced;
this.distort = distort;

Matrix2f audioMatrix = Matrix2f.generateAudioMatrix(x, y, z);
hash = audioMatrix.coords.hash;
Expand Down