3
0
Mirror von https://github.com/ViaVersion/ViaBackwards.git synchronisiert 2024-12-25 15:50:12 +01:00

Set mappings default values to -1

Dieser Commit ist enthalten in:
Nassim Jahnke 2021-11-17 19:52:31 +01:00
Ursprung 71f4012537
Commit 888441b81d
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 6BE3B555EBC5982B

Datei anzeigen

@ -21,6 +21,8 @@ import com.viaversion.viaversion.api.data.IntArrayMappings;
import com.viaversion.viaversion.api.data.MappingDataLoader; import com.viaversion.viaversion.api.data.MappingDataLoader;
import com.viaversion.viaversion.api.data.Mappings; import com.viaversion.viaversion.api.data.Mappings;
import java.util.Arrays;
public final class VBMappings extends IntArrayMappings { public final class VBMappings extends IntArrayMappings {
private VBMappings(final int[] oldToNew, final int mappedIds) { 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 size = this.size != -1 ? this.size : size(unmapped);
final int mappedSize = this.mappedSize != -1 ? this.mappedSize : size(mapped); final int mappedSize = this.mappedSize != -1 ? this.mappedSize : size(mapped);
final int[] mappings = new int[size]; 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 // Do conversion if one is an array and the other an object, otherwise directly map
if (unmapped.isJsonArray()) { if (unmapped.isJsonArray()) {
if (mapped.isJsonObject()) { if (mapped.isJsonObject()) {