From 3cddb712c8ec4f37688608668d6c6ff20362e3b3 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Sun, 5 Mar 2023 21:57:47 +0100 Subject: [PATCH] Fix item loading in 1.13.2->1.13, 1.13->1.12 --- .../viaversion/viabackwards/api/data/BackwardsMappings.java | 2 +- .../protocol/protocol1_12_2to1_13/data/BackwardsMappings.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/common/src/main/java/com/viaversion/viabackwards/api/data/BackwardsMappings.java b/common/src/main/java/com/viaversion/viabackwards/api/data/BackwardsMappings.java index b5417a35..cf604dd2 100644 --- a/common/src/main/java/com/viaversion/viabackwards/api/data/BackwardsMappings.java +++ b/common/src/main/java/com/viaversion/viabackwards/api/data/BackwardsMappings.java @@ -89,7 +89,7 @@ public class BackwardsMappings extends MappingDataBase { if (key.equals("items") && vvProtocolClass != null) { final MappingData mappingData = Via.getManager().getProtocolManager().getProtocol(vvProtocolClass).getMappingData(); if (mappingData != null && mappingData.getItemMappings() != null) { - this.itemMappings = mappingData.getItemMappings().inverse(); + return mappingData.getItemMappings().inverse(); } } return super.loadBiMappings(data, key); diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_12_2to1_13/data/BackwardsMappings.java b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_12_2to1_13/data/BackwardsMappings.java index de585f06..d198086a 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_12_2to1_13/data/BackwardsMappings.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/protocol1_12_2to1_13/data/BackwardsMappings.java @@ -32,7 +32,6 @@ import org.checkerframework.checker.nullness.qual.Nullable; public class BackwardsMappings extends com.viaversion.viabackwards.api.data.BackwardsMappings { private final Int2ObjectMap statisticMappings = new Int2ObjectOpenHashMap<>(); private final Map translateMappings = new HashMap<>(); - private BiMappings itemMappings; public BackwardsMappings() { super("1.13", "1.12", Protocol1_13To1_12_2.class); @@ -42,7 +41,7 @@ public class BackwardsMappings extends com.viaversion.viabackwards.api.data.Back public void loadExtras(final CompoundTag data) { final Mappings itemsToMapped = loadMappings(data, "items"); final BiMappings itemsToUnmapped = Protocol1_13To1_12_2.MAPPINGS.getItemMappings(); - itemMappings = new BiMappings() { + this.itemMappings = new BiMappings() { @Override public BiMappings inverse() { return itemsToUnmapped;