Class MapData
java.lang.Object
com.blamejared.crafttweaker.api.data.MapData
- All Implemented Interfaces:
IData,Comparable<IData>,Iterable<IData>
- DocParam:
- this (Hello: "World", Somewhere: "Over the rainbow")
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.blamejared.crafttweaker.api.data.IData
IData.Type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> Taccept(DataVisitor<T> visitor) asMap()Casts this IData to a map.booleanChecks if this IData contains the other IDatacopy()booleanbooleanChecks if this IData is equal to the other IData.getAt(int index) Gets the data at the given index.Gets the data at the given key.net.minecraft.nbt.CompoundTagGets the internal Tag stored in this IData.getKeys()Gets the keys of this IDatagetType()Gets the type of this IData.inthashCode()booleanChecks if this data supports being cast to a map.iterator()intlength()Gets the length of this IData.Merges the given data with this data.voidPuts the given value inside this IData at the given index.voidAdds all entries from the given map into this one.voidremove(int index) Removes the stored data at the given index.voidRemoves the stored data at the given key.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.blamejared.crafttweaker.api.data.IData
add, and, asBool, asByte, asByteArray, asDouble, asFloat, asInt, asIntArray, asList, asLong, asLongArray, asShort, asString, cat, compareTo, containsList, div, getAsString, getId, isEmpty, isListable, map, mod, mul, neg, not, or, setAt, shl, shr, sub, xorMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
MapData
-
MapData
public MapData(net.minecraft.nbt.CompoundTag internal) -
MapData
public MapData() -
MapData
-
-
Method Details
-
putAll
Adds all entries from the given map into this one. Can override existing keys.- Parameters:
map- The other entries to be added to this map- DocParam:
- map {Hello: "Goodbye", Item: "Bedrock"}
-
remove
public void remove(int index) Description copied from interface:IDataRemoves the stored data at the given index. -
remove
Description copied from interface:IDataRemoves the stored data at the given key. -
getAt
Description copied from interface:IDataGets the data at the given index. -
getAt
Description copied from interface:IDataGets the data at the given key. -
contains
Description copied from interface:IDataChecks if this IData contains the other IDataFor most data types, this will check equality of the data, but for map data, it will check if the other data is a string, and then check if it contains a key with that name
-
put
Description copied from interface:IDataPuts the given value inside this IData at the given index. -
equalTo
Description copied from interface:IDataChecks if this IData is equal to the other IData. -
isMappable
public boolean isMappable()Description copied from interface:IDataChecks if this data supports being cast to a map.- Specified by:
isMappablein interfaceIData- Returns:
- True if it can be cast to a map, false otherwise.
-
asMap
Description copied from interface:IDataCasts this IData to a map. -
length
public int length()Description copied from interface:IDataGets the length of this IData. -
getKeys
Description copied from interface:IDataGets the keys of this IData -
iterator
-
getInternal
public net.minecraft.nbt.CompoundTag getInternal()Description copied from interface:IDataGets the internal Tag stored in this IData.- Specified by:
getInternalin interfaceIData- Returns:
- the vanilla Tag that this IData represents.
-
copy
-
copyInternal
- Specified by:
copyInternalin interfaceIData
-
accept
-
getType
Description copied from interface:IDataGets the type of this IData. -
boolDataKeys
-
merge
Description copied from interface:IDataMerges the given data with this data. -
equals
-
hashCode
public int hashCode() -
toString
-