From 888441b81df46c833455c9d53073cfa05e655877 Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Wed, 17 Nov 2021 19:52:31 +0100 Subject: [PATCH] Set mappings default values to -1 --- .../java/com/viaversion/viabackwards/api/data/VBMappings.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/src/main/java/com/viaversion/viabackwards/api/data/VBMappings.java b/common/src/main/java/com/viaversion/viabackwards/api/data/VBMappings.java index 55dccd84..748dbe32 100644 --- a/common/src/main/java/com/viaversion/viabackwards/api/data/VBMappings.java +++ b/common/src/main/java/com/viaversion/viabackwards/api/data/VBMappings.java @@ -21,6 +21,8 @@ import com.viaversion.viaversion.api.data.IntArrayMappings; import com.viaversion.viaversion.api.data.MappingDataLoader; import com.viaversion.viaversion.api.data.Mappings; +import java.util.Arrays; + public final class VBMappings extends IntArrayMappings { private VBMappings(final int[] oldToNew, final int mappedIds) { @@ -42,6 +44,7 @@ public final class VBMappings extends IntArrayMappings { final int size = this.size != -1 ? this.size : size(unmapped); final int mappedSize = this.mappedSize != -1 ? this.mappedSize : size(mapped); final int[] mappings = new int[size]; + Arrays.fill(mappings, -1); // Do conversion if one is an array and the other an object, otherwise directly map if (unmapped.isJsonArray()) { if (mapped.isJsonObject()) {