Class BoolData

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

@ZenRegister public class BoolData extends Object implements IData
Careful with BoolData: While it works for specifying boolean attributes in JSON syntax, using it in Tags will instead use a ByteData object. Reason for this is that Minecraft does not have Boolean NBT values.
DocParam:
this (true as IData)
  • Field Details

    • TRUE

      public static final BoolData TRUE
    • FALSE

      public static final BoolData FALSE
  • Constructor Details

    • BoolData

      public BoolData(boolean internalValue)
  • Method Details

    • getByteData

      public ByteData getByteData()
    • getInternal

      public net.minecraft.nbt.ByteTag 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.
    • or

      public IData or(IData other)
      Description copied from interface: IData
      Applies a bitwise OR (|) operation to this IData and the other IData
      Specified by:
      or in interface IData
      Parameters:
      other - the other data.
      Returns:
      A new IData after applying a bitwise OR operation.
    • and

      public IData and(IData other)
      Description copied from interface: IData
      Applies a bitwise AND (&) operation to this IData and the other IData
      Specified by:
      and in interface IData
      Parameters:
      other - the other data.
      Returns:
      A new IData after applying a bitwise AND operation.
    • xor

      public IData xor(IData other)
      Description copied from interface: IData
      Applies a bitwise XOR (^) operation to this IData and the other IData
      Specified by:
      xor in interface IData
      Parameters:
      other - the other data.
      Returns:
      A new IData after applying a bitwise XOR operation.
    • not

      public IData not()
      Description copied from interface: IData
      Applies a NOT (!) operation to this IData.
      Specified by:
      not in interface IData
      Returns:
      The result of the NOT operation.
    • 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.
    • 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
    • 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
    • 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