LongData
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.LongData;
Description
Implements
LongData
implements the following interfaces:
Constructors
// new LongData(internal as long);new LongData(myLong);
Parameters:
internal: long
Type: long
Operators
Members
Returns: this data as a byte array
// LongData.asByteArray() as byte[];myLongData.asByteArray();
Return Type:
byte[]
// LongData as byte[]myLongData as byte[]
Return Type:
byte[]
Returns: this data as an int array
// LongData.asIntArray() as int[];myLongData.asIntArray();
Return Type:
int[]
// LongData as int[]myLongData as int[]
Return Type:
int[]
Returns: this data as a long array
// LongData.asLongArray() as long[];myLongData.asLongArray();
Return Type:
long[]
// LongData as long[]myLongData as long[]
Return Type:
long[]
E.G println(("hello" as IData).asString())
prints "hello"
Returns: The escaped string version of this IData.
// LongData.asString() as string;myLongData.asString();
Return Type:
string
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
E.G println(("hello" as IData).getAsString())
prints hello
// LongData as stringmyLongData as string
Return Type:
string
Returns: the intenral ID of this data.
// LongData.getId() as byte;myLongData.getId();
Return Type:
byte
// LongData.isEmpty as boolmyLongData.isEmpty
Return Type:
bool
Returns: True if empty.
// LongData.isEmpty() as bool;myLongData.isEmpty();
Return Type:
bool
// LongData.keys as Set<string>myLongData.keys
Return Type:
Set<string>
Returns: The keys of this IData.
// LongData.keys() as Set<string>;myLongData.keys();
Return Type:
Set<string>
// LongData.length as intmyLongData.length
Return Type:
int
Returns: The length of this IData.
// LongData.length() as int;myLongData.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
myLongData.map((data) => 3);
Parameters:
Return Type:
IData
// LongData.remove(index as int);myLongData.remove(0);
Parameters:
index: int
Type: int
- The index to remove. // LongData.remove(key as string);myLongData.remove("key");
Parameters:
key: string
Type: string
- The key to remove.