Class Funcs

java.lang.Object
io.github.emcw.utils.Funcs

public class Funcs extends Object
  • Constructor Details

    • Funcs

      public Funcs()
  • Method Details

    • listToMap

      @NotNull public static <T> @NotNull Map<String,T> listToMap(@NotNull @NotNull List<BaseEntity<T>> list)
    • mapToList

      @Contract("_ -> new") @NotNull public static <K, V> @NotNull List<V> mapToList(@NotNull @NotNull Map<K,V> map)
    • collectEntities

      public static <T> Map<String,T> collectEntities(@NotNull @NotNull Stream<? extends BaseEntity<T>> stream)
    • collectAsMap

      public static <T> Map<String,T> collectAsMap(@NotNull @NotNull Stream<Map.Entry<String,T>> stream)
    • arrayHas

      public static boolean arrayHas(String[] arr, @NotNull @NotNull String str)
    • calcArea

      public static int calcArea(int[] X, int[] Z)
    • calcArea

      public static int calcArea(int[] X, int[] Z, int numPoints, int @NotNull ... divisor)
    • range

      @NotNull public static @NotNull Integer range(int[] args)
    • euclidean

      public static Integer euclidean(int x1, int x2, int z1, int z2)
    • manhattan

      @NotNull public static @NotNull Integer manhattan(@NotNull @NotNull Location loc1, @NotNull @NotNull Location loc2)
    • manhattan

      @NotNull public static @NotNull Integer manhattan(int x1, int x2, int z1, int z2)
    • removeListDuplicates

      public static <T> List<T> removeListDuplicates(@NotNull @NotNull List<T> list)
    • collectList

      public static <T> List<T> collectList(Stream<T> stream, Boolean noDuplicates)
    • streamList

      @Contract(pure=true) public static <T> Stream<T> streamList(@NotNull @NotNull List<T> list)
    • streamIntRange

      @NotNull public static @NotNull IntStream streamIntRange(int max, int @NotNull ... min)
    • streamInts

      @NotNull public static @NotNull IntStream streamInts(int... ints)
    • mapInstance

      public static EMCMap mapInstance(@NotNull @NotNull String name)
    • withinRadius

      @Contract(pure=true) public static boolean withinRadius(Integer num, Integer @NotNull [] args)
    • withinRadius

      public static boolean withinRadius(Integer sourceCoord, Integer targetCoord, Integer radius)