Class StringData

java.lang.Object
com.blamejared.crafttweaker.api.data.StringData
All Implemented Interfaces:
IData, Comparable<IData>, Iterable<IData>

@ZenRegister public class StringData extends Object implements IData
DocParam:
this ("Hello" as IData)
  • Constructor Details

    • StringData

      public StringData(net.minecraft.nbt.StringTag internal)
    • StringData

      public StringData(String internal)
  • Method Details

    • add

      public IData add(IData other)
      Description copied from interface: IData
      Adds the given IData to this IData.
      Specified by:
      add in interface IData
      Parameters:
      other - the other data to add.
      Returns:
      A new IData after adding the other data.
    • cat

      public IData cat(IData other)
      Description copied from interface: IData
      Concatenates the given IData to this IData.
      Specified by:
      cat in interface IData
      Parameters:
      other - the other data to concatenate.
      Returns:
      A new IData after concatenating the other data.
    • contains

      public boolean contains(IData other)
      Description copied from interface: IData
      Checks if this IData contains the other IData

      For most data types, this will check equality of the data, but for map data, it will check if the other data is a string, and then check if it contains a key with that name

      Specified by:
      contains in interface IData
      Parameters:
      other - the other data to check
      Returns:
      true if this data contains the other data.
    • compareTo

      public int compareTo(@NotNull @NotNull IData other)
      Description copied from interface: IData
      Compares this IData to the other IData
      Specified by:
      compareTo in interface Comparable<IData>
      Specified by:
      compareTo in interface IData
      Parameters:
      other - the data to be compared.
      Returns:
      The comparison result.
    • equalTo

      public boolean equalTo(IData other)
      Description copied from interface: IData
      Checks if this IData is equal to the other IData.
      Specified by:
      equalTo in interface IData
      Parameters:
      other - The data to check equality of.
      Returns:
      True if equal, false otherwise.
    • asBool

      public boolean asBool()
      Description copied from interface: IData
      Casts this IData to a boolean.
      Specified by:
      asBool in interface IData
      Returns:
      this data as a bool
    • asByte

      public byte asByte()
      Description copied from interface: IData
      Casts this IData to a byte.
      Specified by:
      asByte in interface IData
      Returns:
      this data as a byte
    • asShort

      public short asShort()
      Description copied from interface: IData
      Casts this IData to a short.
      Specified by:
      asShort in interface IData
      Returns:
      this data as a short
    • asInt

      public int asInt()
      Description copied from interface: IData
      Casts this IData to an int.
      Specified by:
      asInt in interface IData
      Returns:
      this data as an int
    • asLong

      public long asLong()
      Description copied from interface: IData
      Casts this IData to a long.
      Specified by:
      asLong in interface IData
      Returns:
      this data as a long
    • asFloat

      public float asFloat()
      Description copied from interface: IData
      Casts this IData to a float.
      Specified by:
      asFloat in interface IData
      Returns:
      this data as a float
    • asDouble

      public double asDouble()
      Description copied from interface: IData
      Casts this IData to a double.
      Specified by:
      asDouble in interface IData
      Returns:
      this data as a double
    • length

      public int length()
      Description copied from interface: IData
      Gets the length of this IData.
      Specified by:
      length in interface IData
      Returns:
      The length of this IData.
    • getInternal

      public net.minecraft.nbt.StringTag getInternal()
      Description copied from interface: IData
      Gets the internal Tag stored in this IData.
      Specified by:
      getInternal in interface IData
      Returns:
      the vanilla Tag that this IData represents.
    • copy

      public IData copy()
      Specified by:
      copy in interface IData
    • copyInternal

      public IData copyInternal()
      Specified by:
      copyInternal in interface IData
    • accept

      public <T> T accept(DataVisitor<T> visitor)
      Specified by:
      accept in interface IData
    • 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.
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object