FireworksPredicate.java
net.minecraft.core.component.predicates.FireworksPredicate
信息
- 全限定名:net.minecraft.core.component.predicates.FireworksPredicate
- 类型:public record
- 包:net.minecraft.core.component.predicates
- 源码路径:src/main/java/net/minecraft/core/component/predicates/FireworksPredicate.java
- 起始行号:L14
- 实现:SingleComponentItemPredicate
- 职责:
TODO
字段/常量
CODEC- 类型:
Codec<FireworksPredicate> - 修饰符:
public static final - 源码定位:
L17 - 说明:
TODO
- 类型:
内部类/嵌套类型
- 无
构造器
- 无
方法
下面的方法块按源码顺序生成。
public DataComponentType<Fireworks> componentType() @ L27
- 方法名:componentType
- 源码定位:L27
- 返回类型:DataComponentType
- 修饰符:public
参数:
- 无
说明:
TODO
public boolean matches(Fireworks value) @ L32
- 方法名:matches
- 源码定位:L32
- 返回类型:boolean
- 修饰符:public
参数:
- value: Fireworks
说明:
TODO
代码
public record FireworksPredicate(
Optional<CollectionPredicate<FireworkExplosion, FireworkExplosionPredicate.FireworkPredicate>> explosions, MinMaxBounds.Ints flightDuration
) implements SingleComponentItemPredicate<Fireworks> {
public static final Codec<FireworksPredicate> CODEC = RecordCodecBuilder.create(
i -> i.group(
CollectionPredicate.<FireworkExplosion, FireworkExplosionPredicate.FireworkPredicate>codec(FireworkExplosionPredicate.FireworkPredicate.CODEC)
.optionalFieldOf("explosions")
.forGetter(FireworksPredicate::explosions),
MinMaxBounds.Ints.CODEC.optionalFieldOf("flight_duration", MinMaxBounds.Ints.ANY).forGetter(FireworksPredicate::flightDuration)
)
.apply(i, FireworksPredicate::new)
);
@Override
public DataComponentType<Fireworks> componentType() {
return DataComponents.FIREWORKS;
}
public boolean matches(Fireworks value) {
return this.explosions.isPresent() && !this.explosions.get().test(value.explosions()) ? false : this.flightDuration.matches(value.flightDuration());
}
}引用的其他类
-
- 引用位置:
实现
- 引用位置:
-
- 引用位置:
返回值
- 引用位置:
-
- 引用位置:
参数/返回值
- 引用位置: