-Allows for the changing of several sound attributes, including volume, pitch, repeating, etc.

NpcAPI, IPlayer, IWorld:
-Added more sound functions, with sounds that can be stopped and started based on an ID.
This commit is contained in:
c0508383 committed 2022-07-13 19:27:27 -05:00
1 parent e6e266f3b6
commit d1762654ba
16 files changed
+566 -7

No files matched your search

@@ -71,6 +71,7 @@ import noppes.npcs.entity.EntityDialogNpc;
import noppes.npcs.entity.EntityNPCInterface;
import noppes.npcs.roles.RoleTransporter;
import noppes.npcs.scripted.NpcAPI;
import noppes.npcs.scripted.ScriptSound;
import noppes.npcs.scripted.event.DialogEvent;
import noppes.npcs.scripted.interfaces.entity.IPlayer;
@@ -324,6 +325,41 @@ public class NoppesUtilServer {
}
}
public static void playSound(int id, ScriptSound sound) {
List<EntityPlayer> list = MinecraftServer.getServer().getConfigurationManager().playerEntityList;
for (EntityPlayer player : list) {
NoppesUtilPlayer.playSoundTo((EntityPlayerMP) player, id, sound);
}
}
public static void stopSound(int id) {
List<EntityPlayer> list = MinecraftServer.getServer().getConfigurationManager().playerEntityList;
for (EntityPlayer player : list) {
NoppesUtilPlayer.stopSoundFor((EntityPlayerMP) player, id);
}
}
public static void pauseSounds() {
List<EntityPlayer> list = MinecraftServer.getServer().getConfigurationManager().playerEntityList;
for (EntityPlayer player : list) {
NoppesUtilPlayer.pauseSoundsFor((EntityPlayerMP) player);
}
}
public static void continueSounds() {
List<EntityPlayer> list = MinecraftServer.getServer().getConfigurationManager().playerEntityList;
for (EntityPlayer player : list) {
NoppesUtilPlayer.continueSoundsFor((EntityPlayerMP) player);
}
}
public static void stopSounds() {
List<EntityPlayer> list = MinecraftServer.getServer().getConfigurationManager().playerEntityList;
for (EntityPlayer player : list) {
NoppesUtilPlayer.stopSoundsFor((EntityPlayerMP) player);
}
}
public static void deleteNpc(EntityNPCInterface npc,EntityPlayer player) {
Server.sendAssociatedData(npc, EnumPacketClient.DELETE_NPC, npc.getEntityId());
}