PreferredTargetSelector

public class PreferredTargetSelector<T extends Interactable> implements Comparator<T>

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()

Functions

compare
Link copied to clipboard
int compare(T target1, T target2)
comparing
Link copied to clipboard
static Comparator<Tcomparing<T, U>(Function<? extends Object, ? extends U> keyExtractor, Comparator<? extends Object> keyComparator)
comparingDouble
Link copied to clipboard
static Comparator<TcomparingDouble<T>(ToDoubleFunction<? extends Object> keyExtractor)
comparingInt
Link copied to clipboard
static Comparator<TcomparingInt<T>(ToIntFunction<? extends Object> keyExtractor)
comparingLong
Link copied to clipboard
static Comparator<TcomparingLong<T>(ToLongFunction<? extends Object> keyExtractor)
naturalOrder
Link copied to clipboard
static Comparator<TnaturalOrder<T extends Comparable<? extends Object>>()
nullsFirst
Link copied to clipboard
static Comparator<TnullsFirst<T>(Comparator<? extends Object> comparator)
nullsLast
Link copied to clipboard
static Comparator<TnullsLast<T>(Comparator<? extends Object> comparator)
reversed
Link copied to clipboard
Comparator<Treversed()
reverseOrder
Link copied to clipboard
static Comparator<TreverseOrder<T extends Comparable<? extends Object>>()
thenComparing
Link copied to clipboard
Comparator<TthenComparing(Comparator<? extends Object> other)
thenComparingDouble
Link copied to clipboard
Comparator<TthenComparingDouble(ToDoubleFunction<? extends Object> keyExtractor)
thenComparingInt
Link copied to clipboard
Comparator<TthenComparingInt(ToIntFunction<? extends Object> keyExtractor)
thenComparingLong
Link copied to clipboard
Comparator<TthenComparingLong(ToLongFunction<? extends Object> keyExtractor)