Record Class EntityFilter
java.lang.Object
java.lang.Record
de.eldoria.schematicsanitizer.sanitizer.filter.EntityFilter
- Record Components:
removeCreature- remove entities which are classified asCreatureremoveNonCreatures- remove entities which are not classified asCreatureentityBlacklist- remove entities which have the exact type
public record EntityFilter(boolean removeCreature, boolean removeNonCreatures, Set<com.sk89q.worldedit.world.entity.EntityType> entityBlacklist)
extends Record
A filter for entities
-
Constructor Summary
ConstructorsConstructorDescriptionEntityFilter(boolean removeCreature, boolean removeNonCreatures, Set<com.sk89q.worldedit.world.entity.EntityType> entityBlacklist) Creates an instance of aEntityFilterrecord class. -
Method Summary
Modifier and TypeMethodDescriptionSet<com.sk89q.worldedit.world.entity.EntityType> Returns the value of theentityBlacklistrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisBlacklisted(com.sk89q.worldedit.world.entity.EntityType entityType) Checks if the given entity type is blacklisted.booleanReturns the value of theremoveCreaturerecord component.booleanReturns the value of theremoveNonCreaturesrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
EntityFilter
public EntityFilter(boolean removeCreature, boolean removeNonCreatures, Set<com.sk89q.worldedit.world.entity.EntityType> entityBlacklist) Creates an instance of aEntityFilterrecord class.- Parameters:
removeCreature- the value for theremoveCreaturerecord componentremoveNonCreatures- the value for theremoveNonCreaturesrecord componententityBlacklist- the value for theentityBlacklistrecord component
-
-
Method Details
-
isBlacklisted
public boolean isBlacklisted(com.sk89q.worldedit.world.entity.EntityType entityType) Checks if the given entity type is blacklisted.- Parameters:
entityType- the entity type to be checked- Returns:
- true if the entity type is blacklisted, false otherwise
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
removeCreature
public boolean removeCreature()Returns the value of theremoveCreaturerecord component.- Returns:
- the value of the
removeCreaturerecord component
-
removeNonCreatures
public boolean removeNonCreatures()Returns the value of theremoveNonCreaturesrecord component.- Returns:
- the value of the
removeNonCreaturesrecord component
-
entityBlacklist
Returns the value of theentityBlacklistrecord component.- Returns:
- the value of the
entityBlacklistrecord component
-