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