EmptyData
Importing the class
If you need to reference this type directly, like when casting an Array, or as a parameter, you will need to import it. Simply add the import at the top of the file.
import crafttweaker.api.data.EmptyData;
Description
Represents a marker object for data.Note that this is not supposed to be used in scripts, and as such it cannot be obtained in any way.
Implements
EmptyData
implements the following interfaces:
Operators
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
myIData in myEmptyData
Return Type:
bool
Members
Returns: this data as a bool
// EmptyData.asBool() as bool;myEmptyData.asBool();
Return Type:
bool
// EmptyData as boolmyEmptyData as bool
Return Type:
bool
Returns: this data as a byte
// EmptyData.asByte() as byte;myEmptyData.asByte();
Return Type:
byte
// EmptyData as bytemyEmptyData as byte
Return Type:
byte
Returns: this data as a byte array
// EmptyData.asByteArray() as byte[];myEmptyData.asByteArray();
Return Type:
byte[]
// EmptyData as byte[]myEmptyData as byte[]
Return Type:
byte[]
Returns: this data as a double
// EmptyData.asDouble() as double;myEmptyData.asDouble();
Return Type:
double
// EmptyData as doublemyEmptyData as double
Return Type:
double
Returns: this data as a float
// EmptyData.asFloat() as float;myEmptyData.asFloat();
Return Type:
float
// EmptyData as floatmyEmptyData as float
Return Type:
float
Returns: this data as an int
// EmptyData.asInt() as int;myEmptyData.asInt();
Return Type:
int
// EmptyData as intmyEmptyData as int
Return Type:
int
Returns: this data as an int array
// EmptyData.asIntArray() as int[];myEmptyData.asIntArray();
Return Type:
int[]
// EmptyData as int[]myEmptyData as int[]
Return Type:
int[]
Returns: this data as a long
// EmptyData.asLong() as long;myEmptyData.asLong();
Return Type:
long
// EmptyData as longmyEmptyData as long
Return Type:
long
Returns: this data as a long array
// EmptyData.asLongArray() as long[];myEmptyData.asLongArray();
Return Type:
long[]
// EmptyData as long[]myEmptyData as long[]
Return Type:
long[]
Returns: this data as a short
// EmptyData.asShort() as short;myEmptyData.asShort();
Return Type:
short
// EmptyData as shortmyEmptyData as short
Return Type:
short
E.G println(("hello" as IData).asString())
prints "hello"
Returns: The escaped string version of this IData.
// EmptyData.asString() as string;myEmptyData.asString();
Return Type:
string
E.G println(("hello" as IData).getAsString())
prints hello
Returns: The literal string version of this IData.
// EmptyData.getAsString() as string;myEmptyData.getAsString();
Return Type:
string
E.G println(("hello" as IData).getAsString())
prints hello
// EmptyData as stringmyEmptyData as string
Return Type:
string
Returns: the intenral ID of this data.
// EmptyData.getId() as byte;myEmptyData.getId();
Return Type:
byte
// EmptyData.isEmpty as boolmyEmptyData.isEmpty
Return Type:
bool
Returns: True if empty.
// EmptyData.isEmpty() as bool;myEmptyData.isEmpty();
Return Type:
bool
// EmptyData.keys as Set<string>myEmptyData.keys
Return Type:
Set<string>
Returns: The keys of this IData.
// EmptyData.keys() as Set<string>;myEmptyData.keys();
Return Type:
Set<string>
// EmptyData.length as intmyEmptyData.length
Return Type:
int
Returns: The length of this IData.
// EmptyData.length() as int;myEmptyData.length();
Return Type:
int
This attempts to give the most accurate type for the given members, for example, if all the members are bytes, then it returns a ByteArrayData.
However if the types are mixed or do not have a *ArrayData version, then a ListData is returned.
Returns: A list of the given members.
Return Type:
IData
Returns: A new IData from the operation
myEmptyData.map((data) => 3);
Parameters:
Return Type:
IData
// EmptyData.remove(index as int);myEmptyData.remove(0);
Parameters:
index: int
Type: int
- The index to remove. // EmptyData.remove(key as string);myEmptyData.remove("key");
Parameters:
key: string
Type: string
- The key to remove.