Class Memory<T>


  • public class Memory<T>
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private long timeToLive  
      private T value  
    • Constructor Summary

      Constructors 
      Constructor Description
      Memory​(T p_i231551_1_, long p_i231551_2_)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean canExpire()  
      static <T> com.mojang.serialization.Codec<Memory<T>> codec​(com.mojang.serialization.Codec<T> p_234066_0_)  
      T getValue()  
      boolean hasExpired()  
      static <T> Memory<T> of​(T p_234068_0_)  
      static <T> Memory<T> of​(T p_234069_0_, long p_234069_1_)  
      void tick()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • value

        private final T value
      • timeToLive

        private long timeToLive
    • Constructor Detail

      • Memory

        public Memory​(T p_i231551_1_,
                      long p_i231551_2_)
    • Method Detail

      • tick

        public void tick()
      • of

        public static <T> Memory<T> of​(T p_234068_0_)
      • of

        public static <T> Memory<T> of​(T p_234069_0_,
                                       long p_234069_1_)
      • getValue

        public T getValue()
      • hasExpired

        public boolean hasExpired()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • canExpire

        public boolean canExpire()
      • codec

        public static <T> com.mojang.serialization.Codec<Memory<T>> codec​(com.mojang.serialization.Codec<T> p_234066_0_)