mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-20 20:22:37 +00:00
Implemented a way to play ISound(s) to players without using a sound ID.
This commit is contained in:
1 parent
a895c8bd24
commit
5d520837b1
8 files changed
+34
-1
No files matched your search
@@ -505,6 +505,13 @@ public class NoppesUtilPlayer {
|
||||
}
|
||||
}
|
||||
|
||||
public static void playSoundTo(EntityPlayerMP player, ScriptSound sound) {
|
||||
NBTTagCompound compound = sound.writeToNBT();
|
||||
if (sound.sourceEntity == null || player.worldObj.provider.dimensionId == sound.sourceEntity.getDimension()) {
|
||||
Server.sendData(player, EnumPacketClient.PLAY_SOUND_TO_NO_ID, compound);
|
||||
}
|
||||
}
|
||||
|
||||
public static void stopSoundFor(EntityPlayerMP player, int id) {
|
||||
Server.sendData(player, EnumPacketClient.STOP_SOUND_FOR, id);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user