Class IntArrayMappings
java.lang.Object
com.viaversion.viaversion.api.data.IntArrayMappings
- All Implemented Interfaces:
Mappings
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetNewId(int id) Returns the mapped id from the given id, or -1 if invalid/out of bounds.inverse()Mappings with keys and values swapped.intReturns the amount of new ids total, even if it does not have a direct mapping.static IntArrayMappingsof(int[] mappings, int mappedIds) int[]raw()voidsetNewId(int id, int mappedId) Manually maps a specific id.intsize()Returns amount of unmapped entries, being the size of the mapping.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.viaversion.viaversion.api.data.Mappings
contains, getNewIdOrDefault
-
Constructor Details
-
IntArrayMappings
protected IntArrayMappings(int[] mappings, int mappedIds)
-
-
Method Details
-
of
-
getNewId
public int getNewId(int id) Description copied from interface:MappingsReturns the mapped id from the given id, or -1 if invalid/out of bounds. -
setNewId
public void setNewId(int id, int mappedId) Description copied from interface:MappingsManually maps a specific id. -
size
public int size()Description copied from interface:MappingsReturns amount of unmapped entries, being the size of the mapping. -
mappedSize
public int mappedSize()Description copied from interface:MappingsReturns the amount of new ids total, even if it does not have a direct mapping. Returns -1 if unknown.- Specified by:
mappedSizein interfaceMappings- Returns:
- amount of new ids, or -1 if unknown
-
inverse
Description copied from interface:MappingsMappings with keys and values swapped. -
raw
public int[] raw()
-