All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.nukkit.block.customblock.data.BoneCondition Maven / Gradle / Ivy

There is a newer version: 1.20.40-r1
Show newest version
package cn.nukkit.block.customblock.data;

import cn.nukkit.api.PowerNukkitXOnly;
import cn.nukkit.api.Since;
import cn.nukkit.nbt.tag.CompoundTag;
import org.jetbrains.annotations.NotNull;

@Since("1.19.50-r3")
@PowerNukkitXOnly

public record BoneCondition(@NotNull String conditionName,
                            @NotNull String boneName,
                            @NotNull String conditionExpr) implements NBTData {
    private static final int molangVersion = 6;

    public BoneCondition(@NotNull String boneName, @NotNull String conditionExpr) {
        this(boneName, boneName, conditionExpr);
    }

    @Override
    public CompoundTag toCompoundTag() {
        return new CompoundTag(conditionName)
                .putString("bone_condition", conditionExpr)
                .putString("bone_name", conditionName)
                .putInt("molang_version", molangVersion);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy