Class RadioManager
java.lang.Object
com.codinglitch.simpleradio.SimpleRadioApi
com.codinglitch.simpleradio.ServerSimpleRadioApi
com.codinglitch.simpleradio.radio.RadioManager
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclose()voidvoiddequeueSource(Predicate<RadioManager.QueuedSource> criteria) voidstatic void<T> Optional<T> Gets a config entry from a specified pathshortgetIdentifier(Predicate<Router> filter) static RadioManagergetRouter(short identifier) getRouter(WorldlyPosition location) getRouter(net.minecraft.world.entity.Entity owner) void@Nullable net.minecraft.world.item.ItemStackisEntityHolding(net.minecraft.world.entity.Entity entity, Predicate<net.minecraft.world.item.ItemStack> handCriteria) voidlevelTick(net.minecraft.server.level.ServerLevel level) <E extends SimpleRadioEvent>
voidstatic voidload()newRouter(WorldlyPosition position) Creates a blank Router at the specified location with a random UUID.Creates a blank Router with the specified reference.newRouter(UUID reference, WorldlyPosition position) Creates a blank Router at the specified location with the specified reference.newSource(UUID owner, WorldlyPosition location, byte[] data, float volume) voidonEntityPacket(net.minecraft.world.level.Level level, de.maxhenkel.voicechat.api.audiochannel.EntityAudioChannel channel, de.maxhenkel.voicechat.api.packets.EntitySoundPacket packet) voidonLocationalPacket(net.minecraft.world.level.Level level, de.maxhenkel.voicechat.api.audiochannel.LocationalAudioChannel channel, byte[] data) voidonMicPacket(de.maxhenkel.voicechat.api.events.MicrophonePacketEvent event) static <E extends SimpleRadioEvent>
voidpost(E event) voidqueueSource(Source source, Router destination, int delay) booleanreadQueue(Predicate<RadioManager.QueuedSource> filter) voidregisterRouter(Router router) voidregisterRouter(Router router, @Nullable Frequency frequency) removeRouter(short identifier) removeRouter(WorldlyPosition location) removeRouter(Router router) removeRouter(Predicate<Router> criteria) removeRouter(UUID uuid) removeRouter(net.minecraft.world.entity.Entity owner) voidsendAudio(WorldlyPosition location, UUID sender, byte[] data) voidsendRecord(net.minecraft.world.item.ItemStack stack, WorldlyPosition position, long identifier) voidsendSound(WorldlyPosition location, String sound, float volume, float pitch, float offset, long seed) voidsendSound(WorldlyPosition location, String sound, float volume, float pitch, long seed) voidsendSound(WorldlyPosition location, net.minecraft.sounds.SoundEvent soundEvent, float volume, float pitch, float offset, long seed) voidsendSound(WorldlyPosition location, net.minecraft.sounds.SoundEvent soundEvent, float volume, float pitch, long seed) voidserverTick(int tickCount) <T> voidSets a config entry from a specified pathvoidshortAt(WorldlyPosition location) speakers()voidstopRecord(net.minecraft.server.level.ServerLevel level, long identifier) net.minecraft.core.BlockPostravelExtension(net.minecraft.core.BlockPos pos, net.minecraft.world.level.LevelAccessor level) voidupdateRecord(net.minecraft.world.item.ItemStack stack, WorldlyPosition position, float offset, long identifier) static <R extends Router>
voidvalidate(RouterContainer<R> container) booleanverifyEntityCollection(net.minecraft.world.entity.Entity entity, Predicate<net.minecraft.world.item.ItemStack> itemCriteria) booleanverifyLocationCollection(WorldlyPosition position, Class<?> clazz) voidMethods inherited from class com.codinglitch.simpleradio.SimpleRadioApi
getInstance, getRouterSided, getRouterSided, registerRouterSided, removeRouterSided, removeRouterSided, removeRouterSided
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
RadioManager
public RadioManager()
-
-
Method Details
-
load
public static void load() -
getInstance
-
info
- Specified by:
infoin classSimpleRadioApi
-
debug
- Specified by:
debugin classSimpleRadioApi
-
warn
- Specified by:
warnin classSimpleRadioApi
-
error
- Specified by:
errorin classSimpleRadioApi
-
listen
- Specified by:
listenin classSimpleRadioApi
-
post
-
frequencies
- Specified by:
frequenciesin classSimpleRadioApi
-
speakers
- Specified by:
speakersin classServerSimpleRadioApi
-
listeners
- Specified by:
listenersin classServerSimpleRadioApi
-
getConfig
Description copied from class:SimpleRadioApiGets a config entry from a specified pathTo get the soundListening entry from the router config:
ServerSimpleRadioApi.getInstance().getConfig("router.soundListening");- Specified by:
getConfigin classSimpleRadioApi- Parameters:
path- The path to the config entry- Returns:
- An optional containing the value, if found
-
setConfig
Description copied from class:SimpleRadioApiSets a config entry from a specified pathTo set the soundListening entry from the router config:
ServerSimpleRadioApi.getInstance().getConfig("router.soundListening", true);- Specified by:
setConfigin classSimpleRadioApi- Parameters:
path- The path to the config entryvalue- The value to set the config entry to
-
newRouter
Description copied from class:SimpleRadioApiCreates a blank Router with the specified reference.- Specified by:
newRouterin classSimpleRadioApi- Parameters:
reference- The reference. If you are creating a block entity with a router, this should be equivalent to a UUID you store and save.- Returns:
- The created router.
-
newRouter
Description copied from class:SimpleRadioApiCreates a blank Router at the specified location with a random UUID. Most of the time, you should instead useSimpleRadioApi.newRouter(UUID)orSimpleRadioApi.newRouter(UUID, WorldlyPosition).- Specified by:
newRouterin classSimpleRadioApi- Parameters:
position- The location of the router.- Returns:
- The created router
-
newRouter
Description copied from class:SimpleRadioApiCreates a blank Router at the specified location with the specified reference.- Specified by:
newRouterin classSimpleRadioApi- Parameters:
reference- The reference. If you are creating a block entity with a router, this should be equivalent to a UUID you store and save.position- The location of the router.- Returns:
- The created router
-
newSource
- Specified by:
newSourcein classSimpleRadioApi
-
travelExtension
public net.minecraft.core.BlockPos travelExtension(net.minecraft.core.BlockPos pos, net.minecraft.world.level.LevelAccessor level) - Specified by:
travelExtensionin classSimpleRadioApi
-
getIdentifier
- Specified by:
getIdentifierin classServerSimpleRadioApi
-
getRouters
- Specified by:
getRoutersin classServerSimpleRadioApi
-
removeRouter
- Specified by:
removeRouterin classServerSimpleRadioApi
-
removeRouter
- Specified by:
removeRouterin classServerSimpleRadioApi
-
removeRouter
- Specified by:
removeRouterin classServerSimpleRadioApi
-
removeRouter
- Specified by:
removeRouterin classServerSimpleRadioApi
-
removeRouter
- Specified by:
removeRouterin classServerSimpleRadioApi
-
removeRouter
- Specified by:
removeRouterin classServerSimpleRadioApi
-
getRouter
- Specified by:
getRouterin classServerSimpleRadioApi
-
getRouter
- Specified by:
getRouterin classServerSimpleRadioApi
-
getRouter
- Specified by:
getRouterin classServerSimpleRadioApi
-
getRouter
- Specified by:
getRouterin classServerSimpleRadioApi
-
getRouter
- Specified by:
getRouterin classServerSimpleRadioApi
-
getRouter
- Specified by:
getRouterin classServerSimpleRadioApi
-
registerRouter
- Specified by:
registerRouterin classSimpleRadioApi
-
registerRouter
- Specified by:
registerRouterin classSimpleRadioApi
-
close
public static void close() -
validate
-
garbageCollect
public static void garbageCollect() -
levelTick
public void levelTick(net.minecraft.server.level.ServerLevel level) -
serverTick
public void serverTick(int tickCount) -
queueSource
-
dequeueSource
-
readQueue
-
shortAt
- Specified by:
shortAtin classServerSimpleRadioApi
-
verifyLocationCollection
- Specified by:
verifyLocationCollectionin classServerSimpleRadioApi
-
verifyEntityCollection
public boolean verifyEntityCollection(net.minecraft.world.entity.Entity entity, Predicate<net.minecraft.world.item.ItemStack> itemCriteria) - Specified by:
verifyEntityCollectionin classServerSimpleRadioApi
-
isEntityHolding
@Nullable public @Nullable net.minecraft.world.item.ItemStack isEntityHolding(net.minecraft.world.entity.Entity entity, Predicate<net.minecraft.world.item.ItemStack> handCriteria) -
onLocationalPacket
public void onLocationalPacket(net.minecraft.world.level.Level level, de.maxhenkel.voicechat.api.audiochannel.LocationalAudioChannel channel, byte[] data) -
onEntityPacket
public void onEntityPacket(net.minecraft.world.level.Level level, de.maxhenkel.voicechat.api.audiochannel.EntityAudioChannel channel, de.maxhenkel.voicechat.api.packets.EntitySoundPacket packet) -
onMicPacket
public void onMicPacket(de.maxhenkel.voicechat.api.events.MicrophonePacketEvent event) -
sendRecord
public void sendRecord(net.minecraft.world.item.ItemStack stack, WorldlyPosition position, long identifier) -
stopRecord
public void stopRecord(net.minecraft.server.level.ServerLevel level, long identifier) -
updateRecord
public void updateRecord(net.minecraft.world.item.ItemStack stack, WorldlyPosition position, float offset, long identifier) -
sendSound
public void sendSound(WorldlyPosition location, net.minecraft.sounds.SoundEvent soundEvent, float volume, float pitch, long seed) - Specified by:
sendSoundin classServerSimpleRadioApi
-
sendSound
public void sendSound(WorldlyPosition location, net.minecraft.sounds.SoundEvent soundEvent, float volume, float pitch, float offset, long seed) - Specified by:
sendSoundin classServerSimpleRadioApi
-
sendSound
-
sendSound
public void sendSound(WorldlyPosition location, String sound, float volume, float pitch, float offset, long seed) - Specified by:
sendSoundin classServerSimpleRadioApi
-
sendAudio
- Specified by:
sendAudioin classServerSimpleRadioApi
-