Contents
- Description
- Constructor Summary
- Method Summary
- Constructor Details
- Method Details
- playItemSoundEvent(Ref, Store, Item, ItemSoundEvent)
- playSoundEventEntity(int, int, ComponentAccessor)
- playSoundEventEntity(int, int, float, float, ComponentAccessor)
- playSoundEvent2dToPlayer(PlayerRef, int, SoundCategory)
- playSoundEvent2dToPlayer(PlayerRef, int, SoundCategory, float, float)
- playSoundEvent2dToPlayer(PlayerRef, String, SoundCategory)
- playSoundEvent2dToWorld(World, String, SoundCategory)
- playLocalPlayerSoundEvent(PlayerRef, int, int, SoundCategory)
- playLocalPlayerSoundEvent(PlayerRef, int, int, SoundCategory, float, float)
- playSoundEvent2d(int, SoundCategory, ComponentAccessor)
- playSoundEvent2d(int, SoundCategory, float, float, ComponentAccessor)
- playSoundEvent2d(Ref, int, SoundCategory, ComponentAccessor)
- playSoundEvent2d(Ref, int, SoundCategory, float, float, ComponentAccessor)
- playSoundEvent3d(int, SoundCategory, double, double, double, ComponentAccessor)
- playSoundEvent3d(int, SoundCategory, double, double, double, float, float, ComponentAccessor)
- playSoundEvent3d(int, SoundCategory, Vector3d, ComponentAccessor)
- playSoundEvent3d(int, SoundCategory, double, double, double, Predicate, ComponentAccessor)
- playSoundEvent3d(int, SoundCategory, double, double, double, float, float, Predicate, ComponentAccessor)
- playSoundEvent3d(Ref, int, Vector3d, ComponentAccessor)
- playSoundEvent3d(Ref, int, double, double, double, ComponentAccessor)
- playSoundEvent3d(Ref, int, Vector3d, boolean, ComponentAccessor)
- playSoundEvent3d(Ref, int, double, double, double, boolean, ComponentAccessor)
- playSoundEvent3d(int, double, double, double, Predicate, ComponentAccessor)
- playSoundEvent3dToPlayer(Ref, int, SoundCategory, double, double, double, ComponentAccessor)
- playSoundEvent3dToPlayer(Ref, int, SoundCategory, double, double, double, float, float, ComponentAccessor)
- playSoundEvent3dToPlayer(Ref, int, SoundCategory, Vector3d, ComponentAccessor)
Class SoundUtil
java.lang.Object
com.hypixel.hytale.server.core.universe.world.SoundUtil
A utility class that contains a variety of useful sound methods.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidplayItemSoundEvent(Ref<EntityStore> ref, Store<EntityStore> store, Item item, ItemSoundEvent itemSoundEvent) Called to play a item sound event from the given item to the given entity.static voidplayLocalPlayerSoundEvent(PlayerRef playerRefComponent, int localSoundEventIndex, int worldSoundEventIndex, SoundCategory soundCategory) Called to play a sound event to a specific player, sending both local and world sound event indices so the client can choose based on camera mode (2D in first person, 3D in third person).static voidplayLocalPlayerSoundEvent(PlayerRef playerRefComponent, int localSoundEventIndex, int worldSoundEventIndex, SoundCategory soundCategory, float volumeModifier, float pitchModifier) Called to play a sound event to a specific player, sending both local and world sound event indices so the client can choose based on camera mode (2D in first person, 3D in third person).static voidplaySoundEvent2d(int soundEventIndex, SoundCategory soundCategory, float volumeModifier, float pitchModifier, ComponentAccessor<EntityStore> componentAccessor) Called to broadcast a two-dimensional sound event to all players.static voidplaySoundEvent2d(int soundEventIndex, SoundCategory soundCategory, ComponentAccessor<EntityStore> componentAccessor) Called to broadcast a two-dimensional sound event to all players.static voidplaySoundEvent2d(Ref<EntityStore> ref, int soundEventIndex, SoundCategory soundCategory, float volumeModifier, float pitchModifier, ComponentAccessor<EntityStore> componentAccessor) Called to play a two-dimensional sound event to a specific player.static voidplaySoundEvent2d(Ref<EntityStore> ref, int soundEventIndex, SoundCategory soundCategory, ComponentAccessor<EntityStore> componentAccessor) Called to play a two-dimensional sound event to a specific player.static voidplaySoundEvent2dToPlayer(PlayerRef playerRefComponent, int soundEventIndex, SoundCategory soundCategory) Called to play a two-dimensional sound event to a specific player.static voidplaySoundEvent2dToPlayer(PlayerRef playerRefComponent, int soundEventIndex, SoundCategory soundCategory, float volumeModifier, float pitchModifier) Called to play a two-dimensional sound event to a specific player.static voidplaySoundEvent2dToPlayer(PlayerRef playerRefComponent, String soundEventId, SoundCategory soundCategory) Called to play a two-dimensional sound event to a specific player, by asset id.static voidplaySoundEvent2dToWorld(World world, String soundEventId, SoundCategory soundCategory) Called to play a two-dimensional sound event to every player in a world, by asset id.static voidplaySoundEvent3d(int soundEventIndex, double x, double y, double z, Predicate<Ref<EntityStore>> shouldHear, ComponentAccessor<EntityStore> componentAccessor) Called to play a three-dimensional sound event at the given position.static voidplaySoundEvent3d(int soundEventIndex, SoundCategory soundCategory, double x, double y, double z, float volumeModifier, float pitchModifier, ComponentAccessor<EntityStore> componentAccessor) Called to play a three-dimensional sound event to this player.static voidplaySoundEvent3d(int soundEventIndex, SoundCategory soundCategory, double x, double y, double z, float volumeModifier, float pitchModifier, Predicate<Ref<EntityStore>> shouldHear, ComponentAccessor<EntityStore> componentAccessor) Called to play a three-dimensional sound event to this player.static voidplaySoundEvent3d(int soundEventIndex, SoundCategory soundCategory, double x, double y, double z, ComponentAccessor<EntityStore> componentAccessor) Called to play a three-dimensional sound event to this player.static voidplaySoundEvent3d(int soundEventIndex, SoundCategory soundCategory, double x, double y, double z, Predicate<Ref<EntityStore>> shouldHear, ComponentAccessor<EntityStore> componentAccessor) Called to play a three-dimensional sound event to this player.static voidplaySoundEvent3d(int soundEventIndex, SoundCategory soundCategory, org.joml.Vector3d position, ComponentAccessor<EntityStore> componentAccessor) Called to play a three-dimensional sound event to this player.static voidplaySoundEvent3d(Ref<EntityStore> sourceRef, int soundEventIndex, double x, double y, double z, boolean ignoreSource, ComponentAccessor<EntityStore> componentAccessor) Called to play a three-dimensional sound event at the given position.static voidplaySoundEvent3d(Ref<EntityStore> sourceRef, int soundEventIndex, double x, double y, double z, ComponentAccessor<EntityStore> componentAccessor) Called to play a three-dimensional sound event at the given position.static voidplaySoundEvent3d(Ref<EntityStore> sourceRef, int soundEventIndex, org.joml.Vector3d position, boolean ignoreSource, ComponentAccessor<EntityStore> componentAccessor) Called to play a three-dimensional sound event at the given position.static voidplaySoundEvent3d(Ref<EntityStore> sourceRef, int soundEventIndex, org.joml.Vector3d pos, ComponentAccessor<EntityStore> componentAccessor) Called to play a three-dimensional sound event at the given position.static voidplaySoundEvent3dToPlayer(Ref<EntityStore> playerRef, int soundEventIndex, SoundCategory soundCategory, double x, double y, double z, float volumeModifier, float pitchModifier, ComponentAccessor<EntityStore> componentAccessor) Called to play a three-dimensional sound event to this player.static voidplaySoundEvent3dToPlayer(Ref<EntityStore> playerRef, int soundEventIndex, SoundCategory soundCategory, double x, double y, double z, ComponentAccessor<EntityStore> componentAccessor) Called to play a three-dimensional sound event to this player.static voidplaySoundEvent3dToPlayer(Ref<EntityStore> playerRef, int soundEventIndex, SoundCategory soundCategory, org.joml.Vector3d position, ComponentAccessor<EntityStore> componentAccessor) Called to play a three-dimensional sound event to this player.static voidplaySoundEventEntity(int soundEventIndex, int networkId, float volumeModifier, float pitchModifier, ComponentAccessor<EntityStore> componentAccessor) Called to play a sound event to all players from the given target entity.static voidplaySoundEventEntity(int soundEventIndex, int networkId, ComponentAccessor<EntityStore> componentAccessor) Called to play a sound event to all players from the given target entity.
-
Constructor Details
-
SoundUtil
public SoundUtil()
-
-
Method Details
-
playItemSoundEvent
public static void playItemSoundEvent(@Nonnull Ref<EntityStore> ref, @Nonnull Store<EntityStore> store, @Nonnull Item item, @Nonnull ItemSoundEvent itemSoundEvent) Called to play a item sound event from the given item to the given entity.- Parameters:
ref- The entity reference of the target entity.store- TheStore<EntityStore>for entity storage.item- The item to play the sound from.itemSoundEvent- The item sound event to play.
-
playSoundEventEntity
public static void playSoundEventEntity(int soundEventIndex, int networkId, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Called to play a sound event to all players from the given target entity.- Parameters:
soundEventIndex- The index of the sound event.networkId- The network ID of the target entity.componentAccessor- Theinvalid input: '<' EntityStore >for component access.
-
playSoundEventEntity
public static void playSoundEventEntity(int soundEventIndex, int networkId, float volumeModifier, float pitchModifier, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Called to play a sound event to all players from the given target entity.- Parameters:
soundEventIndex- The index of the sound event.networkId- The network ID of the target entity.volumeModifier- Volume modifier (linear gain).pitchModifier- Pitch modifier (linear pitch).componentAccessor- Theinvalid input: '<' EntityStore >for component access.
-
playSoundEvent2dToPlayer
public static void playSoundEvent2dToPlayer(@Nonnull PlayerRef playerRefComponent, int soundEventIndex, @Nonnull SoundCategory soundCategory) Called to play a two-dimensional sound event to a specific player.- Parameters:
playerRefComponent- ThePlayerRefcomponent of the player.soundEventIndex- The index of the sound event.soundCategory- The category of the sound event.
-
playSoundEvent2dToPlayer
public static void playSoundEvent2dToPlayer(@Nonnull PlayerRef playerRefComponent, int soundEventIndex, @Nonnull SoundCategory soundCategory, float volumeModifier, float pitchModifier) Called to play a two-dimensional sound event to a specific player.- Parameters:
playerRefComponent- ThePlayerRefcomponent of the player.soundEventIndex- The index of the sound event.soundCategory- The category of the sound event.volumeModifier- Volume modifier (linear gain).pitchModifier- Pitch modifier (linear pitch).
-
playSoundEvent2dToPlayer
public static void playSoundEvent2dToPlayer(@Nonnull PlayerRef playerRefComponent, @Nullable String soundEventId, @Nonnull SoundCategory soundCategory) Called to play a two-dimensional sound event to a specific player, by asset id.- Parameters:
playerRefComponent- ThePlayerRefcomponent of the player.soundEventId- The asset id of the sound event.nullor an unknown id plays nothing.soundCategory- The category of the sound event.
-
playSoundEvent2dToWorld
public static void playSoundEvent2dToWorld(@Nonnull World world, @Nullable String soundEventId, @Nonnull SoundCategory soundCategory) Called to play a two-dimensional sound event to every player in a world, by asset id.- Parameters:
world- TheWorldwhose players hear the sound event.soundEventId- The asset id of the sound event.nullor an unknown id plays nothing.soundCategory- The category of the sound event.
-
playLocalPlayerSoundEvent
public static void playLocalPlayerSoundEvent(@Nonnull PlayerRef playerRefComponent, int localSoundEventIndex, int worldSoundEventIndex, @Nonnull SoundCategory soundCategory) Called to play a sound event to a specific player, sending both local and world sound event indices so the client can choose based on camera mode (2D in first person, 3D in third person).- Parameters:
playerRefComponent- ThePlayerRefcomponent of the player.localSoundEventIndex- The index of the local (2D) sound event.worldSoundEventIndex- The index of the world (3D) sound event.soundCategory- The category of the sound event.
-
playLocalPlayerSoundEvent
public static void playLocalPlayerSoundEvent(@Nonnull PlayerRef playerRefComponent, int localSoundEventIndex, int worldSoundEventIndex, @Nonnull SoundCategory soundCategory, float volumeModifier, float pitchModifier) Called to play a sound event to a specific player, sending both local and world sound event indices so the client can choose based on camera mode (2D in first person, 3D in third person).- Parameters:
playerRefComponent- ThePlayerRefcomponent of the player.localSoundEventIndex- The index of the local (2D) sound event.worldSoundEventIndex- The index of the world (3D) sound event.soundCategory- The category of the sound event.volumeModifier- Volume modifier (linear gain).pitchModifier- Pitch modifier (linear pitch).
-
playSoundEvent2d
public static void playSoundEvent2d(int soundEventIndex, @Nonnull SoundCategory soundCategory, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Called to broadcast a two-dimensional sound event to all players.- Parameters:
soundEventIndex- The index of the sound event.soundCategory- The category of the sound event.componentAccessor- TheComponentAccessor<EntityStore>for component access.
-
playSoundEvent2d
public static void playSoundEvent2d(int soundEventIndex, @Nonnull SoundCategory soundCategory, float volumeModifier, float pitchModifier, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Called to broadcast a two-dimensional sound event to all players.- Parameters:
soundEventIndex- The index of the sound event.soundCategory- The category of the sound event.volumeModifier- Volume modifier (linear gain).pitchModifier- Pitch modifier (linear pitch).componentAccessor- TheComponentAccessor<EntityStore>for component access.
-
playSoundEvent2d
public static void playSoundEvent2d(@Nonnull Ref<EntityStore> ref, int soundEventIndex, @Nonnull SoundCategory soundCategory, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Called to play a two-dimensional sound event to a specific player.- Parameters:
ref- The entity reference of the target player entity.soundEventIndex- The index of the sound event.soundCategory- The category of the sound event.componentAccessor- TheComponentAccessor<EntityStore>for component access.
-
playSoundEvent2d
public static void playSoundEvent2d(@Nonnull Ref<EntityStore> ref, int soundEventIndex, @Nonnull SoundCategory soundCategory, float volumeModifier, float pitchModifier, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Called to play a two-dimensional sound event to a specific player.- Parameters:
ref- The entity reference of the target player entity.soundEventIndex- The index of the sound event.soundCategory- The category of the sound event.volumeModifier- Volume modifier (linear gain).pitchModifier- Pitch modifier (linear pitch).componentAccessor- TheComponentAccessor<EntityStore>for component access.
-
playSoundEvent3d
public static void playSoundEvent3d(int soundEventIndex, @Nonnull SoundCategory soundCategory, double x, double y, double z, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Called to play a three-dimensional sound event to this player.- Parameters:
soundEventIndex- The index of the sound event.soundCategory- The category of the sound event.x- The X position of the sound.y- The Y position of the sound.z- The Z position of the sound.componentAccessor- TheComponentAccessor<EntityStore>for component access.
-
playSoundEvent3d
public static void playSoundEvent3d(int soundEventIndex, @Nonnull SoundCategory soundCategory, double x, double y, double z, float volumeModifier, float pitchModifier, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Called to play a three-dimensional sound event to this player.- Parameters:
soundEventIndex- The index of the sound event.soundCategory- The category of the sound event.x- The X position of the sound.y- The Y position of the sound.z- The Z position of the sound.volumeModifier- Volume modifier (linear gain).pitchModifier- Pitch modifier (linear pitch).componentAccessor- TheComponentAccessor<EntityStore>for component access.
-
playSoundEvent3d
public static void playSoundEvent3d(int soundEventIndex, @Nonnull SoundCategory soundCategory, @Nonnull org.joml.Vector3d position, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Called to play a three-dimensional sound event to this player.- Parameters:
soundEventIndex- The index of the sound event.soundCategory- The category of the sound event.position- The position of the sound.componentAccessor- TheComponentAccessor<EntityStore>for component access.
-
playSoundEvent3d
public static void playSoundEvent3d(int soundEventIndex, @Nonnull SoundCategory soundCategory, double x, double y, double z, @Nonnull Predicate<Ref<EntityStore>> shouldHear, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Called to play a three-dimensional sound event to this player.- Parameters:
soundEventIndex- The index of the sound event.soundCategory- The category of the sound event.x- The X position of the sound.y- The Y position of the sound.z- The Z position of the sound.shouldHear- A predicate that determines which players can hear the sound event.componentAccessor- TheComponentAccessor<EntityStore>for component access.
-
playSoundEvent3d
public static void playSoundEvent3d(int soundEventIndex, @Nonnull SoundCategory soundCategory, double x, double y, double z, float volumeModifier, float pitchModifier, @Nonnull Predicate<Ref<EntityStore>> shouldHear, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Called to play a three-dimensional sound event to this player.- Parameters:
soundEventIndex- The index of the sound event.soundCategory- The category of the sound event.x- The X position of the sound.y- The Y position of the sound.z- The Z position of the sound.volumeModifier- Volume modifier (linear gain).pitchModifier- Pitch modifier (linear pitch).shouldHear- A predicate that determines which players can hear the sound event.componentAccessor- TheComponentAccessor<EntityStore>for component access.
-
playSoundEvent3d
public static void playSoundEvent3d(@Nullable Ref<EntityStore> sourceRef, int soundEventIndex, @Nonnull org.joml.Vector3d pos, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Called to play a three-dimensional sound event at the given position.- Parameters:
sourceRef- The entity reference of the source entity.soundEventIndex- The index of the sound event.pos- The position of the sound.componentAccessor- TheComponentAccessor<EntityStore>for component access.
-
playSoundEvent3d
public static void playSoundEvent3d(@Nullable Ref<EntityStore> sourceRef, int soundEventIndex, double x, double y, double z, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Called to play a three-dimensional sound event at the given position.- Parameters:
sourceRef- The entity reference of the source entity.soundEventIndex- The index of the sound event.x- The X position of the sound.y- The Y position of the sound.z- The Z position of the sound.componentAccessor- TheComponentAccessor<EntityStore>for component access.
-
playSoundEvent3d
public static void playSoundEvent3d(@Nullable Ref<EntityStore> sourceRef, int soundEventIndex, @Nonnull org.joml.Vector3d position, boolean ignoreSource, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Called to play a three-dimensional sound event at the given position.- Parameters:
sourceRef- The entity reference of the source entity.soundEventIndex- The index of the sound event.position- The position of the sound.ignoreSource- Whether to ignore the source entity.componentAccessor- TheComponentAccessor<EntityStore>for component access.
-
playSoundEvent3d
public static void playSoundEvent3d(@Nullable Ref<EntityStore> sourceRef, int soundEventIndex, double x, double y, double z, boolean ignoreSource, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Called to play a three-dimensional sound event at the given position.- Parameters:
sourceRef- The entity reference of the source entity.soundEventIndex- The index of the sound event.x- The X position of the sound.y- The Y position of the sound.z- The Z position of the sound.ignoreSource- Whether to ignore the source entity.componentAccessor- TheComponentAccessor<EntityStore>for component access.
-
playSoundEvent3d
public static void playSoundEvent3d(int soundEventIndex, double x, double y, double z, @Nonnull Predicate<Ref<EntityStore>> shouldHear, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Called to play a three-dimensional sound event at the given position.- Parameters:
soundEventIndex- The index of the sound event.x- The X position of the sound.y- The Y position of the sound.z- The Z position of the sound.shouldHear- A predicate to determine whether an entity should hear this sound.componentAccessor- TheComponentAccessor<EntityStore>for component access.
-
playSoundEvent3dToPlayer
public static void playSoundEvent3dToPlayer(@Nullable Ref<EntityStore> playerRef, int soundEventIndex, @Nonnull SoundCategory soundCategory, double x, double y, double z, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Called to play a three-dimensional sound event to this player.- Parameters:
playerRef- The entity reference of the player entity.soundEventIndex- The index of the sound event.soundCategory- The category of the sound event.x- The X position of the sound.y- The Y position of the sound.z- The Z position of the sound.componentAccessor- TheComponentAccessorfor component access.
-
playSoundEvent3dToPlayer
public static void playSoundEvent3dToPlayer(@Nullable Ref<EntityStore> playerRef, int soundEventIndex, @Nonnull SoundCategory soundCategory, double x, double y, double z, float volumeModifier, float pitchModifier, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Called to play a three-dimensional sound event to this player.- Parameters:
playerRef- The entity reference of the player entity.soundEventIndex- The index of the sound event.soundCategory- The category of the sound event.x- The X position of the sound.y- The Y position of the sound.z- The Z position of the sound.volumeModifier- Volume modifier (linear gain).pitchModifier- Pitch modifier (linear pitch).componentAccessor- TheComponentAccessorfor component access.
-
playSoundEvent3dToPlayer
public static void playSoundEvent3dToPlayer(@Nullable Ref<EntityStore> playerRef, int soundEventIndex, @Nonnull SoundCategory soundCategory, @Nonnull org.joml.Vector3d position, @Nonnull ComponentAccessor<EntityStore> componentAccessor) Called to play a three-dimensional sound event to this player.- Parameters:
playerRef- The entity reference of the player entity.soundEventIndex- The index of the sound event.soundCategory- The category of the sound event.position- The position of the sound.componentAccessor- TheComponentAccessorfor component access.
-