Package team.lodestar.lodestone.helpers
Class DataHelper
java.lang.Object
team.lodestar.lodestone.helpers.DataHelper
A collection of helper methods for data manipulation
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ArrayList<net.minecraft.world.phys.Vec3>blockOutlinePositions(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos) static floatdistance(float... a) static floatdistSqr(float... a) static <T> Collection<T>getAll(Collection<? extends T> src, T... items) create a copy of all items in a list that match from another list of itemsstatic <T> Collection<T>getAll(Collection<T> src, Predicate<T> pred) create a copy of all items in a list that match from a predicatestatic <T> booleanhasDuplicate(T[] things) returns whether an array of items has any duplicatesstatic int[]nextInts(int count, int range) returns an integer array of random intsstatic net.minecraft.world.phys.Vec3radialOffset(net.minecraft.world.phys.Vec3 pos, float distance, float current, float total) static <T,K extends Collection<T>>
KreverseOrder(K reversed, Collection<T> items) Reverses the order of any K collection of T entriesstatic net.minecraft.world.phys.Vec3rotatingRadialOffset(net.minecraft.world.phys.Vec3 pos, float distanceX, float distanceZ, float current, float total, long gameTime, float time) static net.minecraft.world.phys.Vec3rotatingRadialOffset(net.minecraft.world.phys.Vec3 pos, float distance, float current, float total, long gameTime, float time) static ArrayList<net.minecraft.world.phys.Vec3>rotatingRadialOffsets(net.minecraft.world.phys.Vec3 pos, float distanceX, float distanceZ, float total, long gameTime, float time) static ArrayList<net.minecraft.world.phys.Vec3>rotatingRadialOffsets(net.minecraft.world.phys.Vec3 pos, float distance, float total, long gameTime, float time) static <T> Ttake(Collection<? extends T> src, T item) removes an entry from a collection and returns it if removedstatic <T> Collection<T>takeAll(Collection<? extends T> src, T... items) removes all entry from a collection and returns all items removed in a new collectionstatic <T> Collection<T>takeAll(Collection<T> src, Predicate<T> pred) removes all entry from a collection based off of a predicate and returns all items removed in a new collectionstatic StringtoTitleCase(String givenString, String regex) Capitalizes the first character in each word and replaces [regex] with space
-
Constructor Details
-
DataHelper
public DataHelper()
-
-
Method Details
-
reverseOrder
Reverses the order of any K collection of T entries -
toTitleCase
Capitalizes the first character in each word and replaces [regex] with space -
nextInts
public static int[] nextInts(int count, int range) returns an integer array of random ints- Parameters:
count- the amount of integersrange- the range the random function uses
-
hasDuplicate
public static <T> boolean hasDuplicate(T[] things) returns whether an array of items has any duplicates -
take
removes an entry from a collection and returns it if removed -
takeAll
removes all entry from a collection and returns all items removed in a new collection -
takeAll
removes all entry from a collection based off of a predicate and returns all items removed in a new collection -
getAll
create a copy of all items in a list that match from another list of items -
getAll
create a copy of all items in a list that match from a predicate -
radialOffset
public static net.minecraft.world.phys.Vec3 radialOffset(net.minecraft.world.phys.Vec3 pos, float distance, float current, float total) -
rotatingRadialOffsets
public static ArrayList<net.minecraft.world.phys.Vec3> rotatingRadialOffsets(net.minecraft.world.phys.Vec3 pos, float distance, float total, long gameTime, float time) -
rotatingRadialOffsets
public static ArrayList<net.minecraft.world.phys.Vec3> rotatingRadialOffsets(net.minecraft.world.phys.Vec3 pos, float distanceX, float distanceZ, float total, long gameTime, float time) -
rotatingRadialOffset
public static net.minecraft.world.phys.Vec3 rotatingRadialOffset(net.minecraft.world.phys.Vec3 pos, float distance, float current, float total, long gameTime, float time) -
rotatingRadialOffset
public static net.minecraft.world.phys.Vec3 rotatingRadialOffset(net.minecraft.world.phys.Vec3 pos, float distanceX, float distanceZ, float current, float total, long gameTime, float time) -
blockOutlinePositions
public static ArrayList<net.minecraft.world.phys.Vec3> blockOutlinePositions(net.minecraft.world.level.Level level, net.minecraft.core.BlockPos pos) -
distSqr
public static float distSqr(float... a) -
distance
public static float distance(float... a)
-