Class LongArrayData

java.lang.Object
com.blamejared.crafttweaker.api.data.LongArrayData
All Implemented Interfaces:
ICollectionData, IData

@ZenRegister public class LongArrayData extends Object implements ICollectionData
DocParam:
this [100000, 800000, 50000]
  • Constructor Details

    • LongArrayData

      public LongArrayData(net.minecraft.nbt.LongArrayTag internal)
    • LongArrayData

      public LongArrayData(long[] internal)
  • Method Details

    • copy

      public LongArrayData copy()
      Description copied from interface: IData
      Makes a copy of this IData. IData is immutable by default, use this to create a proper copy of the object.
      Specified by:
      copy in interface ICollectionData
      Specified by:
      copy in interface IData
      Returns:
      a copy of this IData.
    • copyInternal

      public LongArrayData copyInternal()
      Description copied from interface: IData
      Makes a copy of this IData with a copy of the internal INBT object.
      Specified by:
      copyInternal in interface ICollectionData
      Specified by:
      copyInternal in interface IData
      Returns:
      a copy of this IData with a copy of the internal INBT object.
    • getInternal

      public net.minecraft.nbt.LongArrayTag getInternal()
      Description copied from interface: IData
      Gets the internal INBT stored in this IData.
      Specified by:
      getInternal in interface IData
      Returns:
      the vanilla INBT tag that this IData represents.
    • setAt

      public LongData setAt(int index, IData value)
      Description copied from interface: ICollectionData
      Sets the item at the provided index to the given value
      Specified by:
      setAt in interface ICollectionData
      Parameters:
      index - The index to set (0-based)
      value - The new Value
      Returns:
      The replaced value
    • add

      public void add(int index, IData value)
      Specified by:
      add in interface ICollectionData
      Parameters:
      index - The index to add to. Subsequent items will be moved one index higher
      value - The value to add to the list
    • add

      public void add(IData value)
      Specified by:
      add in interface ICollectionData
      Parameters:
      value - The value to add to the list
    • remove

      public LongData remove(int index)
      Description copied from interface: ICollectionData
      Removes the IData stored at the given index.
      Specified by:
      remove in interface ICollectionData
      Parameters:
      index - The index (0-based)
      Returns:
      The IData that was removed
    • getAt

      public IData getAt(int index)
      Description copied from interface: ICollectionData
      Retrieves the IData stored at the given index.
      Specified by:
      getAt in interface ICollectionData
      Parameters:
      index - The index (0-based)
      Returns:
      The IData
    • size

      public int size()
      Specified by:
      size in interface ICollectionData
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface ICollectionData
    • clear

      public void clear()
      Description copied from interface: ICollectionData
      Removes every element in the list
      Specified by:
      clear in interface ICollectionData
    • asList

      public List<IData> asList()
      Description copied from interface: IData
      Gets a List representation of this IData, returns null on anything but ListData.
      Specified by:
      asList in interface IData
      Returns:
      null if this IData is not a list.
    • getType

      public IData.Type getType()
      Description copied from interface: IData
      Gets the type of this IData.
      Specified by:
      getType in interface IData
      Returns:
      The type of this IData.
    • accept

      public <T> T accept(DataVisitor<T> visitor)
      Specified by:
      accept in interface IData
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object