Class FloatData

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

@ZenRegister public class FloatData extends Object implements IData
DocParam:
this (8.5 as IData)
  • Constructor Details

    • FloatData

      public FloatData(net.minecraft.nbt.FloatTag internal)
    • FloatData

      public FloatData(float internal)
  • Method Details

    • getInternal

      public net.minecraft.nbt.FloatTag 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.
    • 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.
    • sub

      public IData sub(IData other)
      Description copied from interface: IData
      Subtracts the given IData from this IData.
      Specified by:
      sub in interface IData
      Parameters:
      other - the other data to remove.
      Returns:
      A new IData after removing the other data.
    • mul

      public IData mul(IData other)
      Description copied from interface: IData
      Multiplies the given IData to this IData.
      Specified by:
      mul in interface IData
      Parameters:
      other - the other data to multiply by.
      Returns:
      A new IData after multiplying the other data.
    • div

      public IData div(IData other)
      Description copied from interface: IData
      Divides the given IData from this IData.
      Specified by:
      div in interface IData
      Parameters:
      other - the other data to divide by.
      Returns:
      A new IData after dividing the other data.
    • mod

      public IData mod(IData other)
      Description copied from interface: IData
      Applies a modulo operation to this IData against the other IData.
      Specified by:
      mod in interface IData
      Parameters:
      other - the other data to modulo by.
      Returns:
      A new IData after applying a modulo operation.
    • neg

      public IData neg()
      Description copied from interface: IData
      Negates this IData.
      Specified by:
      neg in interface IData
      Returns:
      The negation of this IData.
    • 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
    • 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