mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-01 20:50:41 +01:00
SPIGOT-236 - fix notes playing wrongly.
Formula is from BlockNote (NMS), slightly formatted different to be smaller.
This commit is contained in:
parent
975c9ed4f9
commit
6fab8fe51e
1 changed files with 5 additions and 2 deletions
|
@ -266,7 +266,9 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||
instrumentName = "bassattack";
|
||||
break;
|
||||
}
|
||||
getHandle().playerConnection.sendPacket(new PacketPlayOutNamedSoundEffect("note."+instrumentName, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), 3.0f, note));
|
||||
|
||||
float f = (float) Math.pow(2.0D, (note - 12.0D) / 12.0D);
|
||||
getHandle().playerConnection.sendPacket(new PacketPlayOutNamedSoundEffect("note."+instrumentName, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), 3.0f, f));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -291,7 +293,8 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||
instrumentName = "bassattack";
|
||||
break;
|
||||
}
|
||||
getHandle().playerConnection.sendPacket(new PacketPlayOutNamedSoundEffect("note."+instrumentName, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), 3.0f, note.getId()));
|
||||
float f = (float) Math.pow(2.0D, (note.getId() - 12.0D) / 12.0D);
|
||||
getHandle().playerConnection.sendPacket(new PacketPlayOutNamedSoundEffect("note."+instrumentName, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), 3.0f, f));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue