sergbot 0 Share Posted November 23, 2020 Or do I have to always spell out every single item of interest fully? Link to comment Share on other sites More sharing options...
Hashtag 8691 Share Posted November 23, 2020 You can use filters. For example, to get all types of logs in your inventory, you could write something like Inventory.all(item -> item != null && item.getName().toLowerCase().contains("logs")); Link to comment Share on other sites More sharing options...
TheCloakdOne 389 Share Posted November 23, 2020 public Filter<Entity> wildcardFilter(String name) { return (i) -> i != null && i.getName().toLowerCase().contains(name); } Always good to try and abstract common logic, the above will take a common entity and return it as a wildcard filter Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.