- Joined
- Dec 3, 2013
- Messages
- 6,774
- Thread Author
- #1
Hey guys,
Some of you may or may not have already heard that spectre comes with some api changes that will break your bots. While most of them can't really be handled by you guys pre-emptively, there is one that you can be ready for now, and that is the removal of the Filter(s) class. It was initially introduced because we weren't forcing the use of Java 8 which comes with the Predicate class, which has the same functionality as Filters (Probably more).
The documentation for predicates can be found here: Predicate (Java Platform SE 8 )
Here's an example:
is equivalent to:
Finally, any of the methods from the Filters class can be found in the Predicate class. With the example above i could do itemFilter.negate() instead of Filters.invert(itemFilter)
Hope this was helpful!
Note: I'll post the other changes that can't be compiled with the current version of runemate soon.
FileWeb -> SerializableWeb
ActionSlot -> ActionBar.Slot
Some of you may or may not have already heard that spectre comes with some api changes that will break your bots. While most of them can't really be handled by you guys pre-emptively, there is one that you can be ready for now, and that is the removal of the Filter(s) class. It was initially introduced because we weren't forcing the use of Java 8 which comes with the Predicate class, which has the same functionality as Filters (Probably more).
The documentation for predicates can be found here: Predicate (Java Platform SE 8 )
Here's an example:
Code:
final Filter<ItemDefinition> itemFilter = new Filter<ItemDefinition>() {
@Override
public boolean accepts(ItemDefinition def) {
if (def != null) {
final String name = def.getName();
return name != null && !name.isEmpty() && name.contains("Add to bonfire");
}
return false;
}
};
is equivalent to:
Code:
final Predicate<ItemDefinition> itemFilter = def -> {
if (def != null) {
final String name = def.getName();
return name != null && !name.isEmpty() && name.contains("Add to bonfire");
}
return false;
};
Hope this was helpful!
Note: I'll post the other changes that can't be compiled with the current version of runemate soon.
FileWeb -> SerializableWeb
ActionSlot -> ActionBar.Slot
Last edited: