Class SoundLoop
java.lang.Object
net.minecraft.client.resources.sounds.AbstractSoundInstance
net.minecraft.client.resources.sounds.AbstractTickableSoundInstance
com.binaris.wizardry.client.sound.SoundLoop
- All Implemented Interfaces:
net.fabricmc.fabric.api.client.sound.v1.FabricSoundInstance,net.minecraft.client.resources.sounds.SoundInstance,net.minecraft.client.resources.sounds.TickableSoundInstance
- Direct Known Subclasses:
SoundLoopSpell
public abstract class SoundLoop
extends net.minecraft.client.resources.sounds.AbstractTickableSoundInstance
Handle all the active sound loops with the
This class only works as a blueprint for situations that you need to play a sound loop, for example:
onClientTick(EBClientTickEvent)
Saves all the info for the three basic sounds (start, loop, end) and handle all the logic in the event
This class only works as a blueprint for situations that you need to play a sound loop, for example:
SpellSoundManager, all the logic here is just for simplify
the process of doing a sound loop-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface net.minecraft.client.resources.sounds.SoundInstance
net.minecraft.client.resources.sounds.SoundInstance.Attenuation -
Field Summary
Fields inherited from class net.minecraft.client.resources.sounds.AbstractSoundInstance
attenuation, delay, location, pitch, random, relative, sound, source, volume, x, y, zFields inherited from interface net.fabricmc.fabric.api.client.sound.v1.FabricSoundInstance
EMPTY_SOUND -
Constructor Summary
ConstructorsConstructorDescriptionSoundLoop(net.minecraft.sounds.SoundEvent start, net.minecraft.sounds.SoundEvent loop, net.minecraft.sounds.SoundEvent end, net.minecraft.sounds.SoundSource category, float volume, SoundLoop.ISoundFactory factory) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidvoidendLoop()protected static booleanhasActiveLoopMatching(Predicate<SoundLoop> predicate) Checks if there's an active loop matching the given predicatestatic voidonClientTick(EBClientTickEvent event) protected voidvoidtick()Used to know when the sound is ready to be looped, all the rest of the tick logic is handled in the client tickonClientTick(EBClientTickEvent)Methods inherited from class net.minecraft.client.resources.sounds.AbstractTickableSoundInstance
isStopped, stopMethods inherited from class net.minecraft.client.resources.sounds.AbstractSoundInstance
getAttenuation, getDelay, getLocation, getPitch, getSound, getSource, getVolume, getX, getY, getZ, isLooping, isRelative, resolve, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.fabricmc.fabric.api.client.sound.v1.FabricSoundInstance
getAudioStreamMethods inherited from interface net.minecraft.client.resources.sounds.SoundInstance
canPlaySound, canStartSilent, getAttenuation, getDelay, getLocation, getPitch, getSound, getSource, getVolume, getX, getY, getZ, isLooping, isRelative, resolve
-
Constructor Details
-
SoundLoop
public SoundLoop(net.minecraft.sounds.SoundEvent start, net.minecraft.sounds.SoundEvent loop, net.minecraft.sounds.SoundEvent end, net.minecraft.sounds.SoundSource category, float volume, SoundLoop.ISoundFactory factory)
-
-
Method Details
-
addLoop
-
hasActiveLoopMatching
Checks if there's an active loop matching the given predicate -
onClientTick
-
tick
public void tick()Used to know when the sound is ready to be looped, all the rest of the tick logic is handled in the client tickonClientTick(EBClientTickEvent) -
endLoop
public void endLoop() -
stopStartAndLoop
protected void stopStartAndLoop()
-