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[];(3.25 as IData).asByteArray();
Return Type:
byte[]
// DoubleData as byte[](3.25 as IData) as byte[]
Return Type:
byte[]
Returns: this data as an int array
// DoubleData.asIntArray() as int[];(3.25 as IData).asIntArray();
Return Type:
int[]
// DoubleData as int[](3.25 as IData) as int[]
Return Type:
int[]
Returns: this data as a long array
// DoubleData.asLongArray() as long[];(3.25 as IData).asLongArray();
Return Type:
long[]
// DoubleData as long[](3.25 as IData) 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;(3.25 as IData).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;(3.25 as IData).getAsString();
Return Type:
string
E.G println(("hello" as IData).getAsString())
prints hello
// DoubleData as string(3.25 as IData) as string
Return Type:
string
Returns: the intenral ID of this data.
// DoubleData.getId() as byte;(3.25 as IData).getId();
Return Type:
byte
// DoubleData.isEmpty as bool(3.25 as IData).isEmpty
Return Type:
bool
Returns: True if empty.
// DoubleData.isEmpty() as bool;(3.25 as IData).isEmpty();
Return Type:
bool
// DoubleData.keys as Set<string>(3.25 as IData).keys
Return Type:
Set<string>
Returns: The keys of this IData.
// DoubleData.keys() as Set<string>;(3.25 as IData).keys();
Return Type:
Set<string>
// DoubleData.length as int(3.25 as IData).length
Return Type:
int
Returns: The length of this IData.
// DoubleData.length() as int;(3.25 as IData).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
(3.25 as IData).map((data) => 3);
Parameters:
Return Type:
IData
// DoubleData.remove(index as int);(3.25 as IData).remove(0);
Parameters:
index: int
Type: int
- The index to remove. // DoubleData.remove(key as string);(3.25 as IData).remove("key");
Parameters:
key: string
Type: string
- The key to remove.