diff options
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/api/sbentities/SkyBlockEntity.java')
-rw-r--r-- | src/main/java/com/thatgravyboat/skyblockhud/api/sbentities/SkyBlockEntity.java | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/api/sbentities/SkyBlockEntity.java b/src/main/java/com/thatgravyboat/skyblockhud/api/sbentities/SkyBlockEntity.java new file mode 100644 index 0000000..78b48df --- /dev/null +++ b/src/main/java/com/thatgravyboat/skyblockhud/api/sbentities/SkyBlockEntity.java @@ -0,0 +1,28 @@ +package com.thatgravyboat.skyblockhud.api.sbentities; + +import net.minecraft.entity.Entity; + +import java.util.function.Predicate; + +public class SkyBlockEntity { + + private final String name; + private final Predicate<Entity> predicate; + + public static SkyBlockEntity of(String name, Predicate<Entity> predicate) { + return new SkyBlockEntity(name, predicate); + } + + private SkyBlockEntity(String name, Predicate<Entity> predicate) { + this.name = name; + this.predicate = predicate; + } + + public String getName() { + return name; + } + + public boolean isEntity(Entity entity) { + return predicate.test(entity); + } +} |