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