From 009b6c810ceb9bd06f4d8311029833b37b376614 Mon Sep 17 00:00:00 2001 From: EnZaXD Date: Sat, 26 Oct 2024 18:55:08 +0200 Subject: [PATCH] Fix and add missing javadocs in MappingData interface (#4202) --- .../viaversion/api/data/MappingData.java | 46 +++++++++++++++---- 1 file changed, 36 insertions(+), 10 deletions(-) diff --git a/api/src/main/java/com/viaversion/viaversion/api/data/MappingData.java b/api/src/main/java/com/viaversion/viaversion/api/data/MappingData.java index a81d4d33d..e9ed08785 100644 --- a/api/src/main/java/com/viaversion/viaversion/api/data/MappingData.java +++ b/api/src/main/java/com/viaversion/viaversion/api/data/MappingData.java @@ -35,56 +35,82 @@ public interface MappingData { void load(); /** - * Returns the mapped block state id, or -1 if unmapped. + * Returns the mapped block state id, or 0 if unmapped. * * @param id unmapped block state id - * @return mapped block state id, or -1 if unmapped + * @return mapped block state id, or 0 if unmapped * @throws NullPointerException if this mappingdata does not hold block state mappings */ int getNewBlockStateId(int id); /** - * Returns the mapped block id, or -1 if unmapped. + * Returns the mapped block id, or 0 if unmapped. * * @param id unmapped block id - * @return mapped block id, or -1 if unmapped + * @return mapped block id, or 0 if unmapped * @throws NullPointerException if this mappingdata does not hold block mappings */ int getNewBlockId(int id); + /** + * Returns the backwards mapped block id, or 1 if unmapped. + * + * @param id mapped block id + * @return backwards mapped block id, or 1 if unmapped + */ int getOldBlockId(int id); /** - * Returns the mapped item id, or -1 if unmapped. + * Returns the mapped item id, or 0 if unmapped. * * @param id unmapped item id - * @return mapped item id, or -1 if unmapped + * @return mapped item id, or 0 if unmapped * @throws NullPointerException if this mappingdata does not hold item mappings */ int getNewItemId(int id); /** - * Returns the backwards mapped item id, or -1 if unmapped. + * Returns the backwards mapped item id, or 1 if unmapped. * * @param id mapped item id - * @return backwards mapped item id, or -1 if unmapped + * @return backwards mapped item id, or 1 if unmapped * @throws NullPointerException if this mappingdata does not hold item mappings */ int getOldItemId(int id); /** - * Returns the mapped particle id, or -1 if unmapped. + * Returns the mapped particle id, or 0 if unmapped. * * @param id unmapped particle id - * @return mapped particle id, or -1 if unmapped + * @return mapped particle id, or 0 if unmapped * @throws NullPointerException if this mappingdata does not hold particle mappings */ int getNewParticleId(int id); + /** + * Returns the mapped attribute id, or 0 if unmapped. + * + * @param id unmapped attribute id + * @return mapped attribute id, or 0 if unmapped + * @throws NullPointerException if this mappingdata does not hold attribute mappings + */ int getNewAttributeId(int id); + /** + * Returns the mapped sound id, or 0 if unmapped. + * + * @param id unmapped sound id + * @return mapped sound id, or 0 if unmapped + * @throws NullPointerException if this mappingdata does not hold sound mappings + */ int getNewSoundId(int id); + /** + * Returns the backwards mapped sound id, or 1 if unmapped. + * + * @param i mapped sound id + * @return backwards mapped sound id, or 1 if unmapped + */ int getOldSoundId(int i); /**