Record Class IfEntityFilter
java.lang.Object
java.lang.Record
dev.latvian.mods.klib.entity.filter.IfEntityFilter
- All Implemented Interfaces:
EntityFilter, CustomRegistryOwnTypeProvider<net.minecraft.network.RegistryFriendlyByteBuf, EntityFilter>, CustomRegistryValue<net.minecraft.network.RegistryFriendlyByteBuf, EntityFilter>, RefOptimizer<EntityFilter>, WithKey, WithRef<EntityFilter>, Predicate<net.minecraft.world.entity.Entity>
public record IfEntityFilter(Ref<EntityNumber> ifValue, Comparison comparison, Ref<EntityNumber> testValue)
extends Record
implements EntityFilter
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic DynamicType<net.minecraft.network.RegistryFriendlyByteBuf, EntityFilter> Fields inherited from interface EntityFilter
ADVENTURE_MODE, ALIVE, ANY, CODEC, CREATIVE_MODE, DAMAGEABLE, DATA_TYPE, DEAD, DEAD_OR_DYING, ENEMY, GLOWING, IN_LIQUID, IN_WATER, IN_WATER_OR_RAIN, INVISIBLE, ITEM, LIVING, MOB, NONE, ON_FIRE, ON_RAILS, PLAYER, PREFIX_LIST, PROJECTILE, REGISTRY, SPECTATOR_MODE, SPECTATOR_OR_CREATIVE_MODE, STREAM_CODEC, SURVIVAL_LIKE_MODE, SURVIVAL_MODE, UNDERWATER, VISIBLEFields inherited from interface WithKey
COMPARATOR -
Constructor Summary
ConstructorsConstructorDescriptionIfEntityFilter(Ref<EntityNumber> ifValue, Comparison comparison, Ref<EntityNumber> testValue) Creates an instance of aIfEntityFilterrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecomparisonrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.ifValue()Returns the value of theifValuerecord component.booleantest(net.minecraft.world.entity.Entity entity) Returns the value of thetestValuerecord component.final StringtoString()Returns a string representation of this record class.DynamicType<net.minecraft.network.RegistryFriendlyByteBuf, EntityFilter> type()Methods inherited from interface CustomRegistryValue
optionalKey, refMethods inherited from interface EntityFilter
and, and, getFirst, getRegistry, isStringLiteral, not, or, orMethods inherited from interface RefOptimizer
optimize
-
Field Details
-
TYPE
-
-
Constructor Details
-
IfEntityFilter
public IfEntityFilter(Ref<EntityNumber> ifValue, Comparison comparison, Ref<EntityNumber> testValue) Creates an instance of aIfEntityFilterrecord class.- Parameters:
ifValue- the value for theifValuerecord componentcomparison- the value for thecomparisonrecord componenttestValue- the value for thetestValuerecord component
-
-
Method Details
-
type
- Specified by:
typein interfaceCustomRegistryOwnTypeProvider<net.minecraft.network.RegistryFriendlyByteBuf, EntityFilter>
-
test
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
ifValue
Returns the value of theifValuerecord component.- Returns:
- the value of the
ifValuerecord component
-
comparison
Returns the value of thecomparisonrecord component.- Returns:
- the value of the
comparisonrecord component
-
testValue
Returns the value of thetestValuerecord component.- Returns:
- the value of the
testValuerecord component
-