MapData
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.MapData;
Description
Implements
MapData
implements the following interfaces:
Constructors
Operators
Members
Returns: this data as a bool
// MapData.asBool() as bool;myMapData.asBool();
Return Type:
bool
// MapData as boolmyMapData as bool
Return Type:
bool
Returns: this data as a byte
// MapData.asByte() as byte;myMapData.asByte();
Return Type:
byte
// MapData as bytemyMapData as byte
Return Type:
byte
Returns: this data as a byte array
// MapData.asByteArray() as byte[];myMapData.asByteArray();
Return Type:
byte[]
// MapData as byte[]myMapData as byte[]
Return Type:
byte[]
Returns: this data as a double
// MapData.asDouble() as double;myMapData.asDouble();
Return Type:
double
// MapData as doublemyMapData as double
Return Type:
double
Returns: this data as a float
// MapData.asFloat() as float;myMapData.asFloat();
Return Type:
float
// MapData as floatmyMapData as float
Return Type:
float
Returns: this data as an int
// MapData.asInt() as int;myMapData.asInt();
Return Type:
int
// MapData as intmyMapData as int
Return Type:
int
Returns: this data as an int array
// MapData.asIntArray() as int[];myMapData.asIntArray();
Return Type:
int[]
// MapData as int[]myMapData as int[]
Return Type:
int[]
Returns: this data as a long
// MapData.asLong() as long;myMapData.asLong();
Return Type:
long
// MapData as longmyMapData as long
Return Type:
long
Returns: this data as a long array
// MapData.asLongArray() as long[];myMapData.asLongArray();
Return Type:
long[]
// MapData as long[]myMapData as long[]
Return Type:
long[]
Returns: this data as a short
// MapData.asShort() as short;myMapData.asShort();
Return Type:
short
// MapData as shortmyMapData as short
Return Type:
short
E.G println(("hello" as IData).asString())
prints "hello"
Returns: The escaped string version of this IData.
// MapData.asString() as string;myMapData.asString();
Return Type:
string
E.G println(("hello" as IData).getAsString())
prints hello
Returns: The literal string version of this IData.
// MapData.getAsString() as string;myMapData.getAsString();
Return Type:
string
E.G println(("hello" as IData).getAsString())
prints hello
// MapData as stringmyMapData as string
Return Type:
string
Returns: the intenral ID of this data.
// MapData.getId() as byte;myMapData.getId();
Return Type:
byte
// MapData.isEmpty as boolmyMapData.isEmpty
Return Type:
bool
Returns: True if empty.
// MapData.isEmpty() as bool;myMapData.isEmpty();
Return Type:
bool
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
myMapData.map((data) => 3);
Parameters:
Return Type:
IData