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