net.minestom.server.item.crossbow.CrossbowChargingSounds Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of minestom-snapshots Show documentation
Show all versions of minestom-snapshots Show documentation
1.20.4 Lightweight Minecraft server
package net.minestom.server.item.crossbow;
import net.minestom.server.gamedata.tags.Tag;
import net.minestom.server.registry.ObjectSet;
import net.minestom.server.sound.SoundEvent;
import net.minestom.server.utils.nbt.BinaryTagSerializer;
import org.jetbrains.annotations.Nullable;
public record CrossbowChargingSounds(
@Nullable ObjectSet start,
@Nullable ObjectSet mid,
@Nullable ObjectSet end
) {
private static final BinaryTagSerializer> SOUND_SET_NBT_TYPE = ObjectSet.nbtType(Tag.BasicType.SOUND_EVENTS);
public static final BinaryTagSerializer NBT_TYPE = BinaryTagSerializer.object(
"start", SOUND_SET_NBT_TYPE.optional(), CrossbowChargingSounds::start,
"mid", SOUND_SET_NBT_TYPE.optional(), CrossbowChargingSounds::mid,
"end", SOUND_SET_NBT_TYPE.optional(), CrossbowChargingSounds::end,
CrossbowChargingSounds::new
);
}