Preferred Target Selector
public class PreferredTargetSelector<T extends Interactable> implements Comparator<T>
Content copied to clipboard
Provides a way to sort game entities in order of "preference" when it comes to interacting with them. Takes into account mouse position, hovering, "true" distance to the entities, etc. The "lower" the value of the entity, the more preferred it is.
Constructors
PreferredTargetSelector
Link copied to clipboard
void PreferredTargetSelector()
Content copied to clipboard
Functions
comparing
Link copied to clipboard
static Comparator<T> comparing<T, U>(Function<? extends Object, ? extends U> keyExtractor, Comparator<? extends Object> keyComparator)
Content copied to clipboard
comparingDouble
Link copied to clipboard
static Comparator<T> comparingDouble<T>(ToDoubleFunction<? extends Object> keyExtractor)
Content copied to clipboard
comparingInt
Link copied to clipboard
static Comparator<T> comparingInt<T>(ToIntFunction<? extends Object> keyExtractor)
Content copied to clipboard
comparingLong
Link copied to clipboard
static Comparator<T> comparingLong<T>(ToLongFunction<? extends Object> keyExtractor)
Content copied to clipboard
naturalOrder
Link copied to clipboard
static Comparator<T> naturalOrder<T extends Comparable<? extends Object>>()
Content copied to clipboard
nullsFirst
Link copied to clipboard
static Comparator<T> nullsFirst<T>(Comparator<? extends Object> comparator)
Content copied to clipboard
nullsLast
Link copied to clipboard
static Comparator<T> nullsLast<T>(Comparator<? extends Object> comparator)
Content copied to clipboard
reversed
Link copied to clipboard
reverseOrder
Link copied to clipboard
static Comparator<T> reverseOrder<T extends Comparable<? extends Object>>()
Content copied to clipboard
thenComparing
Link copied to clipboard
thenComparingDouble
Link copied to clipboard
Comparator<T> thenComparingDouble(ToDoubleFunction<? extends Object> keyExtractor)
Content copied to clipboard
thenComparingInt
Link copied to clipboard
Comparator<T> thenComparingInt(ToIntFunction<? extends Object> keyExtractor)
Content copied to clipboard
thenComparingLong
Link copied to clipboard
Comparator<T> thenComparingLong(ToLongFunction<? extends Object> keyExtractor)
Content copied to clipboard