SPIGOT-3432: Add playNote support for new sounds
By: md_5 <git@md-5.net>
This commit is contained in:
@@ -265,6 +265,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
case 4:
|
||||
instrumentName = "bass";
|
||||
break;
|
||||
case 5:
|
||||
instrumentName = "flute";
|
||||
break;
|
||||
case 6:
|
||||
instrumentName = "bell";
|
||||
break;
|
||||
case 7:
|
||||
instrumentName = "guitar";
|
||||
break;
|
||||
case 8:
|
||||
instrumentName = "chime";
|
||||
break;
|
||||
case 9:
|
||||
instrumentName = "xylophone";
|
||||
break;
|
||||
}
|
||||
|
||||
float f = (float) Math.pow(2.0D, (note - 12.0D) / 12.0D);
|
||||
@@ -292,6 +307,21 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
case 4:
|
||||
instrumentName = "bass";
|
||||
break;
|
||||
case 5:
|
||||
instrumentName = "flute";
|
||||
break;
|
||||
case 6:
|
||||
instrumentName = "bell";
|
||||
break;
|
||||
case 7:
|
||||
instrumentName = "guitar";
|
||||
break;
|
||||
case 8:
|
||||
instrumentName = "chime";
|
||||
break;
|
||||
case 9:
|
||||
instrumentName = "xylophone";
|
||||
break;
|
||||
}
|
||||
float f = (float) Math.pow(2.0D, (note.getId() - 12.0D) / 12.0D);
|
||||
getHandle().playerConnection.sendPacket(new PacketPlayOutNamedSoundEffect(CraftSound.getSoundEffect("block.note." + instrumentName), net.minecraft.server.SoundCategory.MUSIC, loc.getBlockX(), loc.getBlockY(), loc.getBlockZ(), 3.0f, f));
|
||||
|
||||
Reference in New Issue
Block a user