Class MappingDataBase
java.lang.Object
com.viaversion.viaversion.api.data.MappingDataBase
- All Implemented Interfaces:
MappingData
-
Field Summary
Modifier and TypeFieldDescriptionprotected FullMappings
protected FullMappings
protected Mappings
protected BiMappings
protected Mappings
protected Mappings
protected FullMappings
protected FullMappings
protected BiMappings
protected final String
protected Mappings
protected Mappings
protected ParticleMappings
protected FullMappings
protected Mappings
protected Mappings
protected Map<RegistryType,
List<TagData>> protected final String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected int
checkValidity
(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 Mappings
@Nullable Mappings
@Nullable Mappings
@Nullable FullMappings
@Nullable Mappings
@Nullable FullMappings
@Nullable FullMappings
Returns item mappings if they also have identifier data present.@Nullable BiMappings
Returns item mappings.protected Logger
@Nullable Mappings
int
getNewAttributeId
(int id) Returns the mapped attribute id, or 0 if unmapped.int
getNewBlockId
(int id) Returns the mapped block id, or 0 if unmapped.int
getNewBlockStateId
(int id) Returns the mapped block state id, or 0 if unmapped.int
getNewItemId
(int id) Returns the mapped item id, or 0 if unmapped.int
getNewParticleId
(int id) Returns the mapped particle id, or 0 if unmapped.int
getNewSoundId
(int id) Returns the mapped sound id, or 0 if unmapped.int
getOldBlockId
(int id) Returns the backwards mapped block id, or 1 if unmapped.int
getOldItemId
(int id) Returns the backwards mapped item id, or 1 if unmapped.int
getOldSoundId
(int i) Returns the backwards mapped sound id, or 1 if unmapped.@Nullable Mappings
@Nullable ParticleMappings
@Nullable FullMappings
@Nullable Mappings
@Nullable Mappings
getTags
(RegistryType type) Returns a list of tags to send if present.identifiersFromGlobalIds
(com.viaversion.nbt.tag.CompoundTag mappingsTag, String key) void
load()
Loads the mapping data.protected @Nullable BiMappings
loadBiMappings
(com.viaversion.nbt.tag.CompoundTag data, String key) protected void
loadExtras
(com.viaversion.nbt.tag.CompoundTag data) protected @Nullable FullMappings
loadFullMappings
(com.viaversion.nbt.tag.CompoundTag data, com.viaversion.nbt.tag.CompoundTag unmappedIdentifiersTag, com.viaversion.nbt.tag.CompoundTag mappedIdentifiersTag, String key) protected @Nullable Mappings
loadMappings
(com.viaversion.nbt.tag.CompoundTag data, String key) protected @Nullable com.viaversion.nbt.tag.CompoundTag
protected @Nullable com.viaversion.nbt.tag.CompoundTag
readMappingsFile
(String name) protected @Nullable com.viaversion.nbt.tag.CompoundTag
-
Field Details
-
unmappedVersion
-
mappedVersion
-
argumentTypeMappings
-
entityMappings
-
recipeSerializerMappings
-
itemDataSerializerMappings
-
attributeMappings
-
particleMappings
-
itemMappings
-
blockMappings
-
blockStateMappings
-
blockEntityMappings
-
soundMappings
-
statisticsMappings
-
enchantmentMappings
-
paintingMappings
-
tags
-
-
Constructor Details
-
MappingDataBase
-
-
Method Details
-
load
public void load()Description copied from interface:MappingData
Loads the mapping data.- Specified by:
load
in interfaceMappingData
-
identifiersFromGlobalIds
-
readMappingsFile
-
readUnmappedIdentifiersFile
-
readMappedIdentifiersFile
-
loadMappings
-
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:MappingData
Returns the mapped block state id, or 0 if unmapped.- Specified by:
getNewBlockStateId
in 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:MappingData
Returns the mapped block id, or 0 if unmapped.- Specified by:
getNewBlockId
in interfaceMappingData
- Parameters:
id
- unmapped block id- Returns:
- mapped block id, or 0 if unmapped
-
getOldBlockId
public int getOldBlockId(int id) Description copied from interface:MappingData
Returns the backwards mapped block id, or 1 if unmapped.- Specified by:
getOldBlockId
in 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:MappingData
Returns the mapped item id, or 0 if unmapped.- Specified by:
getNewItemId
in interfaceMappingData
- Parameters:
id
- unmapped item id- Returns:
- mapped item id, or 0 if unmapped
-
getOldItemId
public int getOldItemId(int id) Description copied from interface:MappingData
Returns the backwards mapped item id, or 1 if unmapped.- Specified by:
getOldItemId
in 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:MappingData
Returns the mapped particle id, or 0 if unmapped.- Specified by:
getNewParticleId
in interfaceMappingData
- Parameters:
id
- unmapped particle id- Returns:
- mapped particle id, or 0 if unmapped
-
getNewAttributeId
public int getNewAttributeId(int id) Description copied from interface:MappingData
Returns the mapped attribute id, or 0 if unmapped.- Specified by:
getNewAttributeId
in interfaceMappingData
- Parameters:
id
- unmapped attribute id- Returns:
- mapped attribute id, or 0 if unmapped
-
getNewSoundId
public int getNewSoundId(int id) Description copied from interface:MappingData
Returns the mapped sound id, or 0 if unmapped.- Specified by:
getNewSoundId
in interfaceMappingData
- Parameters:
id
- unmapped sound id- Returns:
- mapped sound id, or 0 if unmapped
-
getOldSoundId
public int getOldSoundId(int i) Description copied from interface:MappingData
Returns the backwards mapped sound id, or 1 if unmapped.- Specified by:
getOldSoundId
in interfaceMappingData
- Parameters:
i
- mapped sound id- Returns:
- backwards mapped sound id, or 1 if unmapped
-
getTags
Description copied from interface:MappingData
Returns a list of tags to send if present.- Specified by:
getTags
in interfaceMappingData
- Parameters:
type
- registry tag type- Returns:
- list of tags to send if present, else null
-
getItemMappings
Description copied from interface:MappingData
Returns item mappings.- Specified by:
getItemMappings
in interfaceMappingData
- Returns:
- item mappings
-
getFullItemMappings
Description copied from interface:MappingData
Returns item mappings if they also have identifier data present.- Specified by:
getFullItemMappings
in interfaceMappingData
- Returns:
- item mappings if they also have identifier data present
- See Also:
-
getParticleMappings
- Specified by:
getParticleMappings
in interfaceMappingData
-
getBlockMappings
- Specified by:
getBlockMappings
in interfaceMappingData
-
getBlockEntityMappings
- Specified by:
getBlockEntityMappings
in interfaceMappingData
-
getBlockStateMappings
- Specified by:
getBlockStateMappings
in interfaceMappingData
-
getSoundMappings
- Specified by:
getSoundMappings
in interfaceMappingData
-
getStatisticsMappings
- Specified by:
getStatisticsMappings
in interfaceMappingData
-
getMenuMappings
- Specified by:
getMenuMappings
in interfaceMappingData
-
getEnchantmentMappings
- Specified by:
getEnchantmentMappings
in interfaceMappingData
-
getAttributeMappings
- Specified by:
getAttributeMappings
in interfaceMappingData
-
getEntityMappings
- Specified by:
getEntityMappings
in interfaceMappingData
-
getArgumentTypeMappings
- Specified by:
getArgumentTypeMappings
in interfaceMappingData
-
getDataComponentSerializerMappings
- Specified by:
getDataComponentSerializerMappings
in interfaceMappingData
-
getPaintingMappings
- Specified by:
getPaintingMappings
in interfaceMappingData
-
getRecipeSerializerMappings
- Specified by:
getRecipeSerializerMappings
in interfaceMappingData
-
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)
-