Class Palettes

java.lang.Object
net.minestom.server.instance.palette.Palettes

public final class Palettes extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    anyEquals(int bitsPerEntry, long[] values, int size, int target)
    Returns true if any of the first size packed entries equals target.
    static int
    arrayLength(int dimension, int bitsPerEntry)
     
    static long
    broadcast(int bitsPerEntry, int value)
    Builds a 64-bit pattern with value placed in every bitsPerEntry-wide lane.
    static int
    count(int bitsPerEntry, long[] values)
     
    static int
    countEquals(int bitsPerEntry, long[] values, int size, int target)
    Counts the packed entries equal to target among the first size entries.
    static void
    fill(int bitsPerEntry, long[] values, int value)
     
    static void
    getAllFill(byte dimension, int value, Palette.EntryConsumer consumer)
     
    static int
    maxPaletteSize(int bitsPerEntry)
     
    static long[]
    pack(int[] ints, int bitsPerEntry)
     
    static int
    read(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 int
    replaceEquals(int bitsPerEntry, long[] values, int size, int oldValue, int newValue)
    Replaces every packed entry equal to oldValue with newValue among the first size entries, returning the number of entries replaced.
    static int
    sectionIndex(int dimension, int x, int y, int z)
     
    static void
    unpack(int[] out, long[] in, int bitsPerEntry)
     
    static int
    write(int dimension, int bitsPerEntry, long[] values, int x, int y, int z, int value)
     

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 with value placed in every bitsPerEntry-wide lane.
    • countEquals

      public static int countEquals(int bitsPerEntry, long[] values, int size, int target)
      Counts the packed entries equal to target among the first size entries. 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 first size packed entries equals target.
    • replaceEquals

      public static int replaceEquals(int bitsPerEntry, long[] values, int size, int oldValue, int newValue)
      Replaces every packed entry equal to oldValue with newValue among the first size entries, returning the number of entries replaced.
    • sectionIndex

      public static int sectionIndex(int dimension, int x, int y, int z)
    • getAllFill

      public static void getAllFill(byte dimension, int value, Palette.EntryConsumer consumer)
    • remap

      public static long[] remap(int dimension, int oldBitsPerEntry, int newBitsPerEntry, long[] values, it.unimi.dsi.fastutil.ints.Int2IntFunction function)