Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-28 17:10:13 +01:00
Set mappings default values to -1
Dieser Commit ist enthalten in:
Ursprung
c133552d04
Commit
bc11bd4caf
@ -26,6 +26,8 @@ import com.google.gson.JsonArray;
|
|||||||
import com.google.gson.JsonElement;
|
import com.google.gson.JsonElement;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
public interface Mappings {
|
public interface Mappings {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -146,6 +148,7 @@ public interface Mappings {
|
|||||||
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()) {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren