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;
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.
EmptyData
implements the following interfaces:
IData
Undocumented Interfaces Comparable <IData >
, Iterable <IData >
Adds the given IData to this IData. // (EmptyData + (other as IData)) as IData
Return Type:
IData
Applies a bitwise AND (&) operation to this IData and the other IData // (EmptyData & (other as IData)) as IData
Return Type:
IData
Concatenates the given IData to this IData. // (EmptyData ~ (other as IData)) as IData
Parameters:
other: IData
Type: IData
- the other data to concatenate.
Return Type:
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
// ((other as IData) in EmptyData) as bool
Parameters:
other: IData
Type: IData
- the other data to check
Return Type:
bool
Divides the given IData from this IData. // (EmptyData / (other as IData)) as IData
Parameters:
other: IData
Type: IData
- the other data to divide by.
Return Type:
IData
Checks if this IData is equal to the other IData. // (EmptyData == (other as IData)) as bool
Parameters:
other: IData
Type: IData
- The data to check equality of.
Return Type:
bool
Gets the data at the given index. // EmptyData[index as int] as IData
Parameters:
index: int
Type: int
- The index to get
Return Type:
IData
Gets the data at the given key. // EmptyData[key as string] as IData
Parameters:
key: string
Type: string
- The key to get
Return Type:
IData
Applies a modulo operation to this IData against the other IData. // (EmptyData % (other as IData)) as IData
Parameters:
other: IData
Type: IData
- the other data to modulo by.
Return Type:
IData
Multiplies the given IData to this IData. // (EmptyData * (other as IData)) as IData
Parameters:
other: IData
Type: IData
- the other data to multiply by.
Return Type:
IData
Negates this IData.
Return Type:
IData
Applies a NOT (!) operation to this IData.
Return Type:
IData
Applies a bitwise OR (|) operation to this IData and the other IData // (EmptyData | (other as IData)) as IData
Return Type:
IData
Puts the given value inside this IData at the given index. // EmptyData[index as string] = (value as IData)
myEmptyData[myString] = myIData
Parameters:
index: string
Type: string
- The key to store the data at
Applies a SHL (<<) operation to this data by the other data // (EmptyData << (other as IData)) as IData
Return Type:
IData
Applies a SHR (>>) operation to this data by the other data // (EmptyData >> (other as IData)) as IData
Return Type:
IData
Subtracts the given IData from this IData. // (EmptyData - (other as IData)) as IData
Parameters:
other: IData
Type: IData
- the other data to remove.
Return Type:
IData
Applies a bitwise XOR (^) operation to this IData and the other IData // (EmptyData ^ (other as IData)) as IData
Return Type:
IData
Adds the given IData to this IData. Returns : A new IData after adding the other data.
// EmptyData.add(other as IData) as IData;
Return Type:
IData
Casts this IData to a boolean. Returns : this data as a bool
// EmptyData.asBool() as bool;
Return Type:
bool
Casts this IData to a boolean.
Return Type:
bool
Casts this IData to a byte. Returns : this data as a byte
// EmptyData.asByte() as byte;
Return Type:
byte
Casts this IData to a byte.
Return Type:
byte
Casts this IData to a byte array. Returns : this data as a byte array
// EmptyData.asByteArray() as byte[];
myEmptyData . asByteArray();
Return Type:
byte []
Casts this IData to a byte array.
Return Type:
byte []
Casts this IData to a double. Returns : this data as a double
// EmptyData.asDouble() as double;
Return Type:
double
Casts this IData to a double.
Return Type:
double
Casts this IData to a float. Returns : this data as a float
// EmptyData.asFloat() as float;
Return Type:
float
Casts this IData to a float.
Return Type:
float
Casts this IData to an int. Returns : this data as an int
// EmptyData.asInt() as int;
Return Type:
int
Casts this IData to an int.
Return Type:
int
Casts this IData to an int array. Returns : this data as an int array
// EmptyData.asIntArray() as int[];
myEmptyData . asIntArray();
Return Type:
int []
Casts this IData to an int array.
Return Type:
int []
Casts this IData to a list. Returns : this data as a list
// EmptyData.asList() as List<IData>;
Return Type:
List <IData >
Casts this IData to a list. // EmptyData as List<IData>
myEmptyData as List < IData>
Return Type:
List <IData >
Casts this IData to a long. Returns : this data as a long
// EmptyData.asLong() as long;
Return Type:
long
Casts this IData to a long.
Return Type:
long
Casts this IData to a long array. Returns : this data as a long array
// EmptyData.asLongArray() as long[];
myEmptyData . asLongArray();
Return Type:
long []
Casts this IData to a long array.
Return Type:
long []
Casts this IData to a map. Returns : this data as a map
// EmptyData.asMap() as IData[string];
Return Type:
IData [string ]
Casts this IData to a map. // EmptyData as IData[string]
myEmptyData as IData [ string ]
Return Type:
IData [string ]
Casts this IData to a short. Returns : this data as a short
// EmptyData.asShort() as short;
Return Type:
short
Casts this IData to a short.
Return Type:
short
Gets an escaped string version of this IData, quotes are included in the output E.G println(("hello" as IData).asString())
prints "hello"
Returns : The escaped string version of this IData.
// EmptyData.asString() as string;
Return Type:
string
Compares this IData to the other IData Returns : The comparison result.
// EmptyData.compareTo(other as IData) as int;
myEmptyData . compareTo( 5 );
Parameters:
other: IData
Type: IData
- the data to be compared.
Return Type:
int
Gets the literal string version of this IData. 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
Gets the literal string version of this IData. E.G println(("hello" as IData).getAsString())
prints hello
Return Type:
string
Gets the internal ID of this data. Returns : the intenral ID of this data.
// EmptyData.getId() as byte;
Return Type:
byte
Checks if this data is empty. // EmptyData.isEmpty as bool
Return Type:
bool
Checks if this data is empty. Returns : True if empty.
// EmptyData.isEmpty() as bool;
Return Type:
bool
Gets the keys of this IData // EmptyData.keys as Set<string>
Return Type:
Set <string >
Gets the keys of this IData Returns : The keys of this IData.
// EmptyData.keys() as Set<string>;
Return Type:
Set <string >
Gets the length of this IData. // EmptyData.length as int
Return Type:
int
Gets the length of this IData. Returns : The length of this IData.
// EmptyData.length() as int;
Return Type:
int
Creates a collection of the given IData members. 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.
// EmptyData.listOf(members as IData[]) as IData;
EmptyData . listOf( 1 , 2 , 3 );
Parameters:
members: IData []
Type: IData []
- The members to put in the list.
Return Type:
IData
Maps this IData to another IData based on the given operation. Returns : A new IData from the operation
// EmptyData.map(operation as function(r as IData) as IData) as IData;
myEmptyData . map((data) => 3 );
Parameters:
operation: function(r as IData ) as IData
Type: function(r as IData ) as IData
- The operation to apply to this IData
Return Type:
IData
Merges the given data with this data. Returns : the result of merging the datas.
// EmptyData.merge(other as IData) as IData;
myEmptyData . merge(myIData);
Return Type:
IData
Puts the given value inside this IData at the given index. // EmptyData.put(index as string, value as IData);
myEmptyData . put( "key" , "value" );
Parameters:
index: string
Type: string
- The key to store the data at
Removes the stored data at the given index. // EmptyData.remove(index as int);
Parameters:
index: int
Type: int
- The index to remove.
Removes the stored data at the given key. // EmptyData.remove(key as string);
myEmptyData . remove( "key" );
Parameters:
key: string
Type: string
- The key to remove.
Sets the given value inside this IData at the given index. // EmptyData.setAt(name as string, data as IData);
myEmptyData . setAt(myString, myIData);
Parameters:
name: string
Type: string
- The key to store the data at