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 . IntData;
IntData
implements the following interfaces:
IData
Undocumented Interfaces Comparable <IData >
, Iterable <IData >
// new IntData(internal as int);
Concatenates the given IData to this IData. ( 8192 as IData) ~ myIData
Parameters:
other: IData
Type: IData
- the other data to concatenate.
Return Type:
IData
Gets the data at the given index. // IntData[index as int] as IData
Parameters:
index: int
Type: int
- The index to get
Return Type:
IData
Gets the data at the given key. // IntData[key as string] as IData ( 8192 as IData)[myString]
Parameters:
key: string
Type: string
- The key to get
Return Type:
IData
Applies a NOT (!) operation to this IData.
Return Type:
IData
Puts the given value inside this IData at the given index. // IntData[index as string] = (value as IData ) ( 8192 as IData)[myString] = myIData
Parameters:
index: string
Type: string
- The key to store the data at
Casts this IData to a byte array. Returns : this data as a byte array
// IntData.asByteArray() as byte[];
( 8192 as IData).asByteArray();
Return Type:
byte []
Casts this IData to a byte array. ( 8192 as IData) as byte []
Return Type:
byte []
Casts this IData to an int array. Returns : this data as an int array
// IntData.asIntArray() as int[];
( 8192 as IData).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
// IntData.asList() as List< IData >; ( 8192 as IData).asList();
Return Type:
List <IData >
Casts this IData to a list. // IntData as List< IData > ( 8192 as IData) as List < IData>
Return Type:
List <IData >
Casts this IData to a long array. Returns : this data as a long array
// IntData.asLongArray() as long[];
( 8192 as IData).asLongArray();
Return Type:
long []
Casts this IData to a long array. ( 8192 as IData) as long []
Return Type:
long []
Casts this IData to a map. Returns : this data as a map
// IntData.asMap() as IData [string];
Return Type:
IData [string ]
Casts this IData to a map. // IntData as IData [string] ( 8192 as IData) as IData [ string ]
Return Type:
IData [string ]
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.
// IntData.asString() as string;
( 8192 as IData).asString();
Return Type:
string
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.
// IntData.getAsString() as string;
( 8192 as IData).getAsString();
Return Type:
string
Gets the literal string version of this IData. E.G println(("hello" as IData).getAsString())
prints hello
( 8192 as IData) as string
Return Type:
string
Gets the internal ID of this data. Returns : the intenral ID of this data.
// IntData.getId() as byte;
Return Type:
byte
Checks if this data is empty. // IntData.isEmpty as bool
Return Type:
bool
Checks if this data is empty. Returns : True if empty.
// IntData.isEmpty() as bool;
( 8192 as IData).isEmpty();
Return Type:
bool
Gets the keys of this IData // IntData.keys as Set<string>
Return Type:
Set <string >
Gets the keys of this IData Returns : The keys of this IData.
// IntData.keys() as Set<string>;
Return Type:
Set <string >
Gets the length of this IData.
Return Type:
int
Gets the length of this IData. Returns : The length of this IData.
// IntData.length() as int;
( 8192 as IData).length();
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.
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
( 8192 as IData).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.
( 8192 as IData).merge(myIData);
Return Type:
IData
Puts the given value inside this IData at the given index. // IntData.put(index as string, value as IData ); ( 8192 as IData).put( "key" , "value" );
Parameters:
index: string
Type: string
- The key to store the data at
Removes the stored data at the given index. // IntData.remove(index as int);
( 8192 as IData).remove( 0 );
Parameters:
index: int
Type: int
- The index to remove.
Removes the stored data at the given key. // IntData.remove(key as string);
( 8192 as IData).remove( "key" );
Parameters:
key: string
Type: string
- The key to remove.
Sets the given value inside this IData at the given index. // IntData.setAt(name as string, data as IData ); ( 8192 as IData).setAt(myString, myIData);
Parameters:
name: string
Type: string
- The key to store the data at