Fix FireworkEffectMeta

Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
TheMode 2022-04-15 04:44:34 +02:00
parent 1ad6caaf8b
commit 164cf9fe2b

View File

@ -5,14 +5,14 @@ import net.minestom.server.item.firework.FireworkEffect;
import net.minestom.server.tag.Tag;
import net.minestom.server.tag.TagHandler;
import net.minestom.server.tag.TagReadable;
import net.minestom.server.tag.TagSerializer;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.annotations.UnknownNullability;
import org.jglrxavpok.hephaistos.nbt.NBTCompound;
public record FireworkEffectMeta(TagReadable readable) implements ItemMetaView<FireworkEffectMeta.Builder> {
private static final Tag<FireworkEffect> FIREWORK_EFFECT = Tag.NBT("Explosion")
.map(nbt -> FireworkEffect.fromCompound((NBTCompound) nbt), FireworkEffect::asCompound);
private static final Tag<FireworkEffect> FIREWORK_EFFECT = Tag.Structure("Explosion",
TagSerializer.fromCompound(FireworkEffect::fromCompound, FireworkEffect::asCompound));
public @Nullable FireworkEffect getFireworkEffect() {
return getTag(FIREWORK_EFFECT);