Class SyncedField<T>

java.lang.Object
me.desht.pneumaticcraft.common.network.SyncedField<T>
Direct Known Subclasses:
SyncedField.SyncedBoolean, SyncedField.SyncedDouble, SyncedField.SyncedEnum, SyncedField.SyncedFloat, SyncedField.SyncedFluidStack, SyncedField.SyncedInt, SyncedField.SyncedItemHandler, SyncedField.SyncedItemStack, SyncedField.SyncedString

public abstract class SyncedField<T> extends Object
  • Method Details

    • setLazy

      public SyncedField<T> setLazy(boolean lazy)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • update

      public boolean update()
      Called server-side: retrieve the latest value of this field from the syncable object and return true if it's changed since the last time update() was called (provided this is not a @LazySynced field).
      Returns:
      true if the field has changed and is non-lazy so needs to be sync'd to clients, false otherwise
    • equals

      protected boolean equals(T oldValue, T newValue)
    • copyWhenNecessary

      protected T copyWhenNecessary(T oldValue)
    • retrieveValue

      protected T retrieveValue(Field field, Object te) throws Exception
      Throws:
      Exception
    • injectValue

      protected void injectValue(Field field, Object te, T value) throws Exception
      Throws:
      Exception
    • getValueForArray

      protected abstract T getValueForArray(Object array, int index)
    • setValueForArray

      protected abstract void setValueForArray(Object array, int index, T value)
    • getValue

      public T getValue()
    • setValue

      public void setValue(Object value)
    • getType

      public static byte getType(SyncedField<?> syncedField)
      Utility Methods