Class PalettedContainer<T>

    • Field Detail

      • globalPalette

        private final IPalette<T> globalPalette
      • reader

        private final java.util.function.Function<CompoundNBT,​T> reader
      • writer

        private final java.util.function.Function<T,​CompoundNBT> writer
      • defaultValue

        private final T defaultValue
      • bits

        private int bits
      • lock

        private final java.util.concurrent.locks.ReentrantLock lock
    • Method Detail

      • acquire

        public void acquire()
      • release

        public void release()
      • getIndex

        private static int getIndex​(int p_186011_0_,
                                    int p_186011_1_,
                                    int p_186011_2_)
      • setBits

        private void setBits​(int p_186012_1_)
      • setBits

        private void setBits​(int bitsIn,
                             boolean forceBits)
      • onResize

        public int onResize​(int p_onResize_1_,
                            T p_onResize_2_)
        Specified by:
        onResize in interface IResizeCallback<T>
      • getAndSet

        public T getAndSet​(int p_222641_1_,
                           int p_222641_2_,
                           int p_222641_3_,
                           T p_222641_4_)
      • getAndSetUnchecked

        public T getAndSetUnchecked​(int p_222639_1_,
                                    int p_222639_2_,
                                    int p_222639_3_,
                                    T p_222639_4_)
      • getAndSet

        protected T getAndSet​(int p_222643_1_,
                              T p_222643_2_)
      • set

        protected void set​(int p_186014_1_,
                           T p_186014_2_)
      • get

        public T get​(int p_186016_1_,
                     int p_186016_2_,
                     int p_186016_3_)
      • get

        protected T get​(int p_186015_1_)
      • read

        public void read​(ListNBT p_222642_1_,
                         long[] p_222642_2_)
      • write

        public void write​(CompoundNBT p_196963_1_,
                          java.lang.String p_196963_2_,
                          java.lang.String p_196963_3_)
      • getSerializedSize

        public int getSerializedSize()
      • maybeHas

        public boolean maybeHas​(java.util.function.Predicate<T> p_235963_1_)