Class EntityFilter
java.lang.Object
me.desht.pneumaticcraft.common.util.EntityFilter
- All Implemented Interfaces:
Predicate<net.minecraft.world.entity.Entity>
- Direct Known Subclasses:
EntityFilter.ConstantEntityFilter
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic EntityFilterallow()An entity filter which allows everythingstatic EntityFilterdeny()An entity filter which allows nothingstatic <T extends IProgWidget & IEntityProvider>
EntityFilterfromProgWidget(T widget, boolean whitelist) Create a new entity filter from a progwidget, which has one or more text widgets attachedstatic EntityFilterfromString(String s) Create an entity filter from stringstatic EntityFilterfromString(String s, EntityFilter fallback) Create an entity filter from stringbooleantest(net.minecraft.world.entity.Entity entity) toString()
-
Constructor Details
-
EntityFilter
Create a new entity filter- Parameters:
filter- the filter specification- Throws:
IllegalArgumentException- if the spec is not valid
-
-
Method Details
-
fromProgWidget
public static <T extends IProgWidget & IEntityProvider> EntityFilter fromProgWidget(T widget, boolean whitelist) Create a new entity filter from a progwidget, which has one or more text widgets attached- Type Parameters:
T- widget type- Parameters:
widget- the progwidgetwhitelist- true if this should be a whitelist (look to the widget's right) or blacklist (look to the left)- Returns:
- an entity filter
- Throws:
IllegalArgumentException- if any of the attached text widgets contain an invalid filter spec
-
fromString
Create an entity filter from string- Parameters:
s- the filter spec- Returns:
- an entity filter, or null if the spec is not valid
-
fromString
Create an entity filter from string- Parameters:
s- the filter specfallback- a fallback filter to use- Returns:
- an entity filter, or the fallback filter if the spec is not valid
-
allow
An entity filter which allows everything- Returns:
- an entity filter
-
deny
An entity filter which allows nothing- Returns:
- an entity filter
-
toString
-
test
public boolean test(net.minecraft.world.entity.Entity entity)
-