Class Palettes
java.lang.Object
net.minestom.server.instance.palette.Palettes
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleananyEquals(int bitsPerEntry, long[] values, int size, int target) Returns true if any of the firstsizepacked entries equalstarget.static intarrayLength(int dimension, int bitsPerEntry) static longbroadcast(int bitsPerEntry, int value) Builds a 64-bit pattern withvalueplaced in everybitsPerEntry-wide lane.static intcount(int bitsPerEntry, long[] values) static intcountEquals(int bitsPerEntry, long[] values, int size, int target) Counts the packed entries equal totargetamong the firstsizeentries.static voidfill(int bitsPerEntry, long[] values, int value) static voidgetAllFill(byte dimension, int value, Palette.EntryConsumer consumer) static intmaxPaletteSize(int bitsPerEntry) static long[]pack(int[] ints, int bitsPerEntry) static intread(int dimension, int bitsPerEntry, long[] values, int x, int y, int z) static long[]remap(int dimension, int oldBitsPerEntry, int newBitsPerEntry, long[] values, it.unimi.dsi.fastutil.ints.Int2IntFunction function) static intreplaceEquals(int bitsPerEntry, long[] values, int size, int oldValue, int newValue) Replaces every packed entry equal tooldValuewithnewValueamong the firstsizeentries, returning the number of entries replaced.static intsectionIndex(int dimension, int x, int y, int z) static voidunpack(int[] out, long[] in, int bitsPerEntry) static intwrite(int dimension, int bitsPerEntry, long[] values, int x, int y, int z, int value)
-
Method Details
-
pack
public static long[] pack(int[] ints, int bitsPerEntry) -
unpack
public static void unpack(int[] out, long[] in, int bitsPerEntry) -
maxPaletteSize
public static int maxPaletteSize(int bitsPerEntry) -
arrayLength
public static int arrayLength(int dimension, int bitsPerEntry) -
read
public static int read(int dimension, int bitsPerEntry, long[] values, int x, int y, int z) -
write
public static int write(int dimension, int bitsPerEntry, long[] values, int x, int y, int z, int value) -
fill
public static void fill(int bitsPerEntry, long[] values, int value) -
count
public static int count(int bitsPerEntry, long[] values) -
broadcast
public static long broadcast(int bitsPerEntry, int value) Builds a 64-bit pattern withvalueplaced in everybitsPerEntry-wide lane. -
countEquals
public static int countEquals(int bitsPerEntry, long[] values, int size, int target) Counts the packed entries equal totargetamong the firstsizeentries. Scans 64 bits at a time using borrow-safe SWAR zero-lane detection. -
anyEquals
public static boolean anyEquals(int bitsPerEntry, long[] values, int size, int target) Returns true if any of the firstsizepacked entries equalstarget. -
replaceEquals
public static int replaceEquals(int bitsPerEntry, long[] values, int size, int oldValue, int newValue) Replaces every packed entry equal tooldValuewithnewValueamong the firstsizeentries, returning the number of entries replaced. -
sectionIndex
public static int sectionIndex(int dimension, int x, int y, int z) -
getAllFill
-
remap
public static long[] remap(int dimension, int oldBitsPerEntry, int newBitsPerEntry, long[] values, it.unimi.dsi.fastutil.ints.Int2IntFunction function)
-