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