Class MappingDataBase
java.lang.Object
com.viaversion.viaversion.api.data.MappingDataBase
- All Implemented Interfaces:
MappingData
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.viaversion.viaversion.api.data.MappingData
MappingData.MappingType -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FullMappingsprotected FullMappingsprotected FullMappingsprotected BiMappingsprotected Mappingsprotected it.unimi.dsi.fastutil.ints.IntSetSet of block ids that have had type or property changes.protected Mappingsprotected FullMappingsprotected FullMappingsprotected BiMappingsprotected final Stringprotected Mappingsprotected Mappingsprotected ParticleMappingsprotected FullMappingsprotected Mappingsprotected Mappingsprotected Map<RegistryType,List<TagData>> protected final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable it.unimi.dsi.fastutil.ints.IntSetSet of block (not block state) ids that had their base type or properties changed.protected intcheckValidity(int id, int mappedId, String type) Returns the given mapped id if valid, else 0 with a warning logged to the console.@Nullable FullMappings@Nullable FullMappings@Nullable FullMappings@Nullable Mappings@Nullable Mappings@Nullable FullMappings@Nullable Mappings@Nullable FullMappings@Nullable FullMappings@Nullable FullMappingsReturns item mappings if they also have identifier data present.@Nullable FullMappings@Nullable BiMappingsReturns item mappings.protected Logger@Nullable MappingsintgetNewAttributeId(int id) Returns the mapped attribute id, or 0 if unmapped.intgetNewBlockId(int id) Returns the mapped block id, or 0 if unmapped.intgetNewBlockStateId(int id) Returns the mapped block state id, or 0 if unmapped.intgetNewItemId(int id) Returns the mapped item id, or 0 if unmapped.intgetNewParticleId(int id) Returns the mapped particle id, or 0 if unmapped.intgetNewSoundId(int id) Returns the mapped sound id, or 0 if unmapped.intgetOldBlockId(int id) Returns the backwards mapped block id, or 1 if unmapped.intgetOldItemId(int id) Returns the backwards mapped item id, or 1 if unmapped.intgetOldSoundId(int id) Returns the backwards mapped sound id, or 1 if unmapped.@Nullable Mappings@Nullable ParticleMappings@Nullable FullMappings@Nullable Mappings@Nullable MappingsgetTags(RegistryType type) Returns a list of tags to send if present.identifiersFromGlobalIds(com.viaversion.nbt.tag.CompoundTag mappingsTag, String key) voidload()Loads the mapping data.protected @Nullable BiMappingsloadBiMappings(com.viaversion.nbt.tag.CompoundTag data, String key) protected voidloadExtras(com.viaversion.nbt.tag.CompoundTag data) protected @Nullable FullMappingsloadFullMappings(com.viaversion.nbt.tag.CompoundTag data, com.viaversion.nbt.tag.CompoundTag unmappedIdentifiersTag, com.viaversion.nbt.tag.CompoundTag mappedIdentifiersTag, String key) protected @Nullable BiMappingsloadFullOrBiMappings(com.viaversion.nbt.tag.CompoundTag data, com.viaversion.nbt.tag.CompoundTag unmappedIdentifiersTag, com.viaversion.nbt.tag.CompoundTag mappedIdentifiersTag, String key) protected @Nullable MappingsloadMappings(com.viaversion.nbt.tag.CompoundTag data, String key) protected @Nullable com.viaversion.nbt.tag.CompoundTagprotected @Nullable com.viaversion.nbt.tag.CompoundTagreadMappingsFile(String name) protected @Nullable com.viaversion.nbt.tag.CompoundTagMethods 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.MappingData
getFullMappings
-
Field Details
-
unmappedVersion
-
mappedVersion
-
argumentTypeMappings
-
entityMappings
-
recipeSerializerMappings
-
itemDataSerializerMappings
-
attributeMappings
-
blockEntityMappings
-
particleMappings
-
itemMappings
-
blockMappings
-
blockStateMappings
-
soundMappings
-
statisticsMappings
-
enchantmentMappings
-
paintingMappings
-
tags
-
changedBlocks
protected it.unimi.dsi.fastutil.ints.IntSet changedBlocksSet of block ids that have had type or property changes.
-
-
Constructor Details
-
MappingDataBase
-
-
Method Details
-
load
public void load()Description copied from interface:MappingDataLoads the mapping data.- Specified by:
loadin interfaceMappingData
-
identifiersFromGlobalIds
-
readMappingsFile
-
readUnmappedIdentifiersFile
-
readMappedIdentifiersFile
-
loadMappings
-
loadFullOrBiMappings
protected @Nullable BiMappings loadFullOrBiMappings(com.viaversion.nbt.tag.CompoundTag data, com.viaversion.nbt.tag.CompoundTag unmappedIdentifiersTag, com.viaversion.nbt.tag.CompoundTag mappedIdentifiersTag, String key) -
loadFullMappings
protected @Nullable FullMappings loadFullMappings(com.viaversion.nbt.tag.CompoundTag data, com.viaversion.nbt.tag.CompoundTag unmappedIdentifiersTag, com.viaversion.nbt.tag.CompoundTag mappedIdentifiersTag, String key) -
loadBiMappings
-
getNewBlockStateId
public int getNewBlockStateId(int id) Description copied from interface:MappingDataReturns the mapped block state id, or 0 if unmapped.- Specified by:
getNewBlockStateIdin interfaceMappingData- Parameters:
id- unmapped block state id- Returns:
- mapped block state id, or 0 if unmapped
-
getNewBlockId
public int getNewBlockId(int id) Description copied from interface:MappingDataReturns the mapped block id, or 0 if unmapped.- Specified by:
getNewBlockIdin interfaceMappingData- Parameters:
id- unmapped block id- Returns:
- mapped block id, or 0 if unmapped
-
getOldBlockId
public int getOldBlockId(int id) Description copied from interface:MappingDataReturns the backwards mapped block id, or 1 if unmapped.- Specified by:
getOldBlockIdin interfaceMappingData- Parameters:
id- mapped block id- Returns:
- backwards mapped block id, or 1 if unmapped
-
getNewItemId
public int getNewItemId(int id) Description copied from interface:MappingDataReturns the mapped item id, or 0 if unmapped.- Specified by:
getNewItemIdin interfaceMappingData- Parameters:
id- unmapped item id- Returns:
- mapped item id, or 0 if unmapped
-
getOldItemId
public int getOldItemId(int id) Description copied from interface:MappingDataReturns the backwards mapped item id, or 1 if unmapped.- Specified by:
getOldItemIdin interfaceMappingData- Parameters:
id- mapped item id- Returns:
- backwards mapped item id, or 1 if unmapped
-
getNewParticleId
public int getNewParticleId(int id) Description copied from interface:MappingDataReturns the mapped particle id, or 0 if unmapped.- Specified by:
getNewParticleIdin interfaceMappingData- Parameters:
id- unmapped particle id- Returns:
- mapped particle id, or 0 if unmapped
-
getNewAttributeId
public int getNewAttributeId(int id) Description copied from interface:MappingDataReturns the mapped attribute id, or 0 if unmapped.- Specified by:
getNewAttributeIdin interfaceMappingData- Parameters:
id- unmapped attribute id- Returns:
- mapped attribute id, or 0 if unmapped
-
getNewSoundId
public int getNewSoundId(int id) Description copied from interface:MappingDataReturns the mapped sound id, or 0 if unmapped.- Specified by:
getNewSoundIdin interfaceMappingData- Parameters:
id- unmapped sound id- Returns:
- mapped sound id, or 0 if unmapped
-
getOldSoundId
public int getOldSoundId(int id) Description copied from interface:MappingDataReturns the backwards mapped sound id, or 1 if unmapped.- Specified by:
getOldSoundIdin interfaceMappingData- Parameters:
id- mapped sound id- Returns:
- backwards mapped sound id, or 1 if unmapped
-
getTags
Description copied from interface:MappingDataReturns a list of tags to send if present.- Specified by:
getTagsin interfaceMappingData- Parameters:
type- registry tag type- Returns:
- list of tags to send if present, else null
-
getItemMappings
Description copied from interface:MappingDataReturns item mappings.- Specified by:
getItemMappingsin interfaceMappingData- Returns:
- item mappings
-
getFullItemMappings
Description copied from interface:MappingDataReturns item mappings if they also have identifier data present.- Specified by:
getFullItemMappingsin interfaceMappingData- Returns:
- item mappings if they also have identifier data present
- See Also:
-
getParticleMappings
- Specified by:
getParticleMappingsin interfaceMappingData
-
getBlockMappings
- Specified by:
getBlockMappingsin interfaceMappingData
-
getFullBlockMappings
- Specified by:
getFullBlockMappingsin interfaceMappingData
-
getBlockEntityMappings
- Specified by:
getBlockEntityMappingsin interfaceMappingData
-
getBlockStateMappings
- Specified by:
getBlockStateMappingsin interfaceMappingData
-
getSoundMappings
- Specified by:
getSoundMappingsin interfaceMappingData
-
getFullSoundMappings
- Specified by:
getFullSoundMappingsin interfaceMappingData
-
getStatisticsMappings
- Specified by:
getStatisticsMappingsin interfaceMappingData
-
getMenuMappings
- Specified by:
getMenuMappingsin interfaceMappingData
-
getEnchantmentMappings
- Specified by:
getEnchantmentMappingsin interfaceMappingData
-
getAttributeMappings
- Specified by:
getAttributeMappingsin interfaceMappingData
-
getEntityMappings
- Specified by:
getEntityMappingsin interfaceMappingData
-
getArgumentTypeMappings
- Specified by:
getArgumentTypeMappingsin interfaceMappingData
-
getDataComponentSerializerMappings
- Specified by:
getDataComponentSerializerMappingsin interfaceMappingData
-
getPaintingMappings
- Specified by:
getPaintingMappingsin interfaceMappingData
-
getRecipeSerializerMappings
- Specified by:
getRecipeSerializerMappingsin interfaceMappingData
-
changedBlocks
public @Nullable it.unimi.dsi.fastutil.ints.IntSet changedBlocks()Description copied from interface:MappingDataSet of block (not block state) ids that had their base type or properties changed.- Specified by:
changedBlocksin interfaceMappingData- Returns:
- set of changed block ids, or null if not tracked/none are present
-
getLogger
-
checkValidity
Returns the given mapped id if valid, else 0 with a warning logged to the console.- Parameters:
id- unmapped idmappedId- mapped idtype- mapping type (e.g. "item")- Returns:
- the given mapped id if valid, else 0
-
loadExtras
protected void loadExtras(com.viaversion.nbt.tag.CompoundTag data)
-