Record Class SimpleEntityFilter
java.lang.Object
java.lang.Record
dev.latvian.mods.klib.entity.filter.SimpleEntityFilter
- 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 SimpleEntityFilter(UnitType<net.minecraft.network.RegistryFriendlyByteBuf, EntityFilter> type, Predicate<net.minecraft.world.entity.Entity> predicate)
extends Record
implements EntityFilter
-
Field Summary
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
ConstructorsConstructorDescriptionSimpleEntityFilter(UnitType<net.minecraft.network.RegistryFriendlyByteBuf, EntityFilter> type, Predicate<net.minecraft.world.entity.Entity> predicate) Creates an instance of aSimpleEntityFilterrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Predicate<net.minecraft.world.entity.Entity> Returns the value of thepredicaterecord component.booleantest(net.minecraft.world.entity.Entity entity) toString()Returns a string representation of this record class.UnitType<net.minecraft.network.RegistryFriendlyByteBuf, EntityFilter> type()Returns the value of thetyperecord component.Methods inherited from interface CustomRegistryValue
optionalKey, refMethods inherited from interface EntityFilter
and, and, getFirst, getRegistry, isStringLiteral, not, or, orMethods inherited from interface RefOptimizer
optimize
-
Constructor Details
-
SimpleEntityFilter
public SimpleEntityFilter(UnitType<net.minecraft.network.RegistryFriendlyByteBuf, EntityFilter> type, Predicate<net.minecraft.world.entity.Entity> predicate) Creates an instance of aSimpleEntityFilterrecord class.- Parameters:
type- the value for thetyperecord componentpredicate- the value for thepredicaterecord component
-
-
Method Details
-
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). -
type
Returns the value of thetyperecord component.- Specified by:
typein interfaceCustomRegistryOwnTypeProvider<net.minecraft.network.RegistryFriendlyByteBuf, EntityFilter>- Returns:
- the value of the
typerecord component
-
predicate
Returns the value of thepredicaterecord component.- Returns:
- the value of the
predicaterecord component
-