Klasse SoundFile.Builder
java.lang.Object
de.mrjulsen.dragnsounds.core.filesystem.SoundFile.Builder
- Umschließende Klasse:
SoundFile
Data collection to create a new sound file on the server.
-
Konstruktorübersicht
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
deserializeNbt
(net.minecraft.nbt.CompoundTag nbt, net.minecraft.world.level.Level level) static SoundFile.Builder
fromNbt
(net.minecraft.nbt.CompoundTag nbt, net.minecraft.world.level.Level level) save
(UUID owner, ByteArrayOutputStream dataStream, int initialChannels, long initialDuration) Create the new sound file and write it to disk.net.minecraft.nbt.CompoundTag
-
Konstruktordetails
-
Builder
- Parameter:
location
- The location where the sound file should be stored in.displayName
- The display name of the sound file (not the filename). Can contain any characters.initialMetadata
- A collection of metadata that should be added after creating the file.
-
-
Methodendetails
-
save
public SoundFile save(UUID owner, ByteArrayOutputStream dataStream, int initialChannels, long initialDuration) throws IOException, ws.schild.jave.InputFormatException, ws.schild.jave.EncoderException Create the new sound file and write it to disk.- Parameter:
owner
- The owner of the sound file (usually the UUID of the player).dataStream
- The stream containing all the data of the file.initialChannels
- A fallback option to get the amount of audio channels which is calculated on the client side (may be manipulated there too)initialDuration
- A fallback option to get the audio playback duration which is calculated on the client side (may be manipulated there too)- Gibt zurück:
- A SoundFile object of the new file.
- Löst aus:
IOException
ws.schild.jave.InputFormatException
ws.schild.jave.EncoderException
- Impl Note:
- You should not call this method by yourself, as this is managed by the library.
- Valid on side:
- Server
-
serializeNbt
public net.minecraft.nbt.CompoundTag serializeNbt() -
deserializeNbt
public void deserializeNbt(net.minecraft.nbt.CompoundTag nbt, net.minecraft.world.level.Level level) -
fromNbt
public static SoundFile.Builder fromNbt(net.minecraft.nbt.CompoundTag nbt, net.minecraft.world.level.Level level)
-