public class MappingDataBase extends java.lang.Object implements MappingData
Modifier and Type | Field and Description |
---|---|
protected FullMappings |
argumentTypeMappings |
protected Mappings |
blockEntityMappings |
protected Mappings |
blockMappings |
protected Mappings |
blockStateMappings |
protected Mappings |
enchantmentMappings |
protected FullMappings |
entityMappings |
protected boolean |
hasDiffFile |
protected Int2IntBiMap |
itemMappings |
protected boolean |
loadItems |
protected java.lang.String |
newVersion |
protected java.lang.String |
oldVersion |
protected Mappings |
paintingMappings |
protected ParticleMappings |
particleMappings |
protected Mappings |
soundMappings |
protected Mappings |
statisticsMappings |
protected java.util.Map<RegistryType,java.util.List<TagData>> |
tags |
Constructor and Description |
---|
MappingDataBase(java.lang.String oldVersion,
java.lang.String newVersion) |
MappingDataBase(java.lang.String oldVersion,
java.lang.String newVersion,
boolean hasDiffFile) |
Modifier and Type | Method and Description |
---|---|
protected int |
checkValidity(int id,
int mappedId,
java.lang.String type)
Returns the given mapped id if valid, else 0 with a warning logged to the console.
|
@Nullable FullMappings |
getArgumentTypeMappings() |
@Nullable Mappings |
getBlockEntityMappings() |
@Nullable Mappings |
getBlockMappings() |
@Nullable Mappings |
getBlockStateMappings() |
@Nullable Mappings |
getEnchantmentMappings() |
@Nullable FullMappings |
getEntityMappings() |
@Nullable Int2IntBiMap |
getItemMappings() |
protected java.util.logging.Logger |
getLogger() |
int |
getNewBlockId(int id)
Returns the mapped block id, or -1 if unmapped.
|
int |
getNewBlockStateId(int id)
Returns the mapped block state id, or -1 if unmapped.
|
int |
getNewItemId(int id)
Returns the mapped item id, or -1 if unmapped.
|
int |
getNewParticleId(int id)
Returns the mapped particle id, or -1 if unmapped.
|
int |
getOldItemId(int id)
Returns the backwards mapped item id, or -1 if unmapped.
|
@Nullable Mappings |
getPaintingMappings() |
@Nullable ParticleMappings |
getParticleMappings() |
@Nullable Mappings |
getSoundMappings() |
@Nullable Mappings |
getStatisticsMappings() |
@Nullable java.util.List<TagData> |
getTags(RegistryType type)
Returns a list of tags to send if present.
|
void |
load()
Loads the mapping data.
|
protected @Nullable com.google.gson.JsonObject |
loadDiffFile() |
protected void |
loadExtras(com.google.gson.JsonObject oldMappings,
com.google.gson.JsonObject newMappings,
@Nullable com.google.gson.JsonObject diffMappings)
To be overridden.
|
protected @Nullable Mappings |
loadFromArray(com.google.gson.JsonObject oldMappings,
com.google.gson.JsonObject newMappings,
@Nullable com.google.gson.JsonObject diffMappings,
java.lang.String key) |
protected @Nullable Mappings |
loadFromObject(com.google.gson.JsonObject oldMappings,
com.google.gson.JsonObject newMappings,
@Nullable com.google.gson.JsonObject diffMappings,
java.lang.String key) |
protected FullMappings |
loadFullMappings(com.google.gson.JsonObject oldMappings,
com.google.gson.JsonObject newMappings,
@Nullable com.google.gson.JsonObject diffMappings,
java.lang.String key) |
protected final java.lang.String oldVersion
protected final java.lang.String newVersion
protected final boolean hasDiffFile
protected Int2IntBiMap itemMappings
protected FullMappings argumentTypeMappings
protected FullMappings entityMappings
protected ParticleMappings particleMappings
protected Mappings blockMappings
protected Mappings blockStateMappings
protected Mappings blockEntityMappings
protected Mappings soundMappings
protected Mappings statisticsMappings
protected Mappings enchantmentMappings
protected Mappings paintingMappings
protected java.util.Map<RegistryType,java.util.List<TagData>> tags
protected boolean loadItems
public MappingDataBase(java.lang.String oldVersion, java.lang.String newVersion)
public MappingDataBase(java.lang.String oldVersion, java.lang.String newVersion, boolean hasDiffFile)
public void load()
MappingData
load
in interface MappingData
protected FullMappings loadFullMappings(com.google.gson.JsonObject oldMappings, com.google.gson.JsonObject newMappings, @Nullable com.google.gson.JsonObject diffMappings, java.lang.String key)
public int getNewBlockStateId(int id)
MappingData
getNewBlockStateId
in interface MappingData
id
- unmapped block state idpublic int getNewBlockId(int id)
MappingData
getNewBlockId
in interface MappingData
id
- unmapped block idpublic int getNewItemId(int id)
MappingData
getNewItemId
in interface MappingData
id
- unmapped item idpublic int getOldItemId(int id)
MappingData
getOldItemId
in interface MappingData
id
- mapped item idpublic int getNewParticleId(int id)
MappingData
getNewParticleId
in interface MappingData
id
- unmapped particle idpublic @Nullable java.util.List<TagData> getTags(RegistryType type)
MappingData
getTags
in interface MappingData
type
- registry tag typepublic @Nullable Int2IntBiMap getItemMappings()
getItemMappings
in interface MappingData
public @Nullable ParticleMappings getParticleMappings()
getParticleMappings
in interface MappingData
public @Nullable Mappings getBlockMappings()
getBlockMappings
in interface MappingData
public @Nullable Mappings getBlockEntityMappings()
getBlockEntityMappings
in interface MappingData
public @Nullable Mappings getBlockStateMappings()
getBlockStateMappings
in interface MappingData
public @Nullable Mappings getSoundMappings()
getSoundMappings
in interface MappingData
public @Nullable Mappings getStatisticsMappings()
getStatisticsMappings
in interface MappingData
public @Nullable Mappings getEnchantmentMappings()
getEnchantmentMappings
in interface MappingData
public @Nullable FullMappings getEntityMappings()
getEntityMappings
in interface MappingData
public @Nullable FullMappings getArgumentTypeMappings()
getArgumentTypeMappings
in interface MappingData
public @Nullable Mappings getPaintingMappings()
getPaintingMappings
in interface MappingData
protected @Nullable Mappings loadFromArray(com.google.gson.JsonObject oldMappings, com.google.gson.JsonObject newMappings, @Nullable com.google.gson.JsonObject diffMappings, java.lang.String key)
protected @Nullable Mappings loadFromObject(com.google.gson.JsonObject oldMappings, com.google.gson.JsonObject newMappings, @Nullable com.google.gson.JsonObject diffMappings, java.lang.String key)
protected @Nullable com.google.gson.JsonObject loadDiffFile()
protected java.util.logging.Logger getLogger()
protected int checkValidity(int id, int mappedId, java.lang.String type)
id
- unmapped idmappedId
- mapped idtype
- mapping type (e.g. "item")protected void loadExtras(com.google.gson.JsonObject oldMappings, com.google.gson.JsonObject newMappings, @Nullable com.google.gson.JsonObject diffMappings)
oldMappings
- old mappingsnewMappings
- new mappingsdiffMappings
- diff mappings if present