EmbeddedCondition
内嵌式条件
跟 DescriptionRead 有什么区别呢?
/**
* 单行描述条件
* 格式 "属性名: 值 / <条件>" 如果满足该行条件才会读取该行描述属性
*
* 如何注册? : 使用 @AutoRegister 进行注册
*/
interface DescriptionLineCondition : DescriptionComponent {
/**
* [entity] 可为空需要自行判断
* [text] 为 "<属性内容> / <条件>" 中的 <条件> 内容
* 返回值为 true 时则读取属性,为 false 时则不读取
*/
fun condition(entity: LivingEntity?, text: String): Boolean
fun condition(entity: LivingEntity?, text: String, slot: EquipmentSlot?): Boolean{
return this.condition(entity, lore)
}
fun condition(entity: LivingEntity?, text: String, slot: EquipmentSlot?, item: ItemStack?): Boolean {
return this.condition(entity, lore, slot)
}
}示例
最后更新于