public EntityFunction createFunction() { final Type type = this.type; checkNotNull(type, "type can't be null"); return entity -> { EntityProperties registryType = entity.getFacet(EntityProperties.class); if (registryType != null) { if (type.matches(registryType)) { entity.remove(); return true; } } return false; }; }
@Override boolean matches(EntityProperties type) { for (Type value : values()) { if (value != this && value.matches(type)) { return true; } } return false; } },
public void fromString(String str) throws CommandException { Type type = Type.findByPattern(str); if (type != null) { this.type = type; } else { throw new CommandException("Acceptable types: projectiles, items, paintings, itemframes, boats, minecarts, tnt, xp, or all"); } }