Skip to content

Commit cd385c7

Browse files
authored
Merge pull request #5 from aw11man/silencerfix
Fix FlansMods#1428
2 parents d6f15f3 + d9e01ec commit cd385c7

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/main/java/com/flansmod/common/guns/ItemGun.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ public void playShotSound(World world, Vector3f position, Boolean silenced) {
637637
// Play shot sounds
638638
if(soundDelay <= 0 && type.shootSound != null)
639639
{
640-
PacketPlaySound.sendSoundPacket(position.x, position.y, position.z, FlansMod.soundRange, world.provider.getDimension(), type.shootSound, silenced);
640+
PacketPlaySound.sendSoundPacket(position.x, position.y, position.z, silenced ? (FlansMod.soundRange*0.75F) : FlansMod.soundRange, world.provider.getDimension(), type.shootSound, silenced);
641641
soundDelay = type.idleSoundLength;
642642
}
643643
}

src/main/java/com/flansmod/common/network/PacketPlaySound.java

+8-8
Original file line numberDiff line numberDiff line change
@@ -29,34 +29,34 @@ public PacketPlaySound()
2929
{
3030
}
3131

32-
public static void sendSoundPacket(double x, double y, double z, double range, int dimension, String s, boolean distort)
32+
public static void sendSoundPacket(double x, double y, double z, double range, int dimension, String s, boolean silenced)
3333
{
34-
sendSoundPacket(x, y, z, range, dimension, s, distort, false);
34+
sendSoundPacket(x, y, z, range, dimension, s, silenced, false);
3535
}
3636

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

4242
public PacketPlaySound(double x, double y, double z, String s)
4343
{
4444
this(x, y, z, s, false);
4545
}
4646

47-
public PacketPlaySound(double x, double y, double z, String s, boolean distort)
47+
public PacketPlaySound(double x, double y, double z, String s, boolean silenced)
4848
{
49-
this(x, y, z, s, distort, false);
49+
this(x, y, z, s, silenced, false);
5050
}
5151

52-
public PacketPlaySound(double x, double y, double z, String s, boolean distort, boolean silenced)
52+
public PacketPlaySound(double x, double y, double z, String s, boolean silenced, boolean distort)
5353
{
5454
posX = (float)x;
5555
posY = (float)y;
5656
posZ = (float)z;
5757
sound = s;
58-
this.distort = distort;
5958
this.silenced = silenced;
59+
this.distort = distort;
6060

6161
Matrix2f audioMatrix = Matrix2f.generateAudioMatrix(x, y, z);
6262
hash = audioMatrix.coords.hash;

0 commit comments

Comments
 (0)