Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-09-06 05:00:09 +02:00
Ignore unneeded sound warnings
Dieser Commit ist enthalten in:
Ursprung
66b9bfbbd5
Commit
b7b8bdc841
@ -110,11 +110,15 @@ public class MappingData {
|
||||
}
|
||||
|
||||
private static void mapIdentifiers(short[] output, JsonArray oldIdentifiers, JsonArray newIdentifiers) {
|
||||
mapIdentifiers(output, oldIdentifiers, newIdentifiers, true);
|
||||
}
|
||||
|
||||
private static void mapIdentifiers(short[] output, JsonArray oldIdentifiers, JsonArray newIdentifiers, boolean warnOnMissing) {
|
||||
for (int i = 0; i < oldIdentifiers.size(); i++) {
|
||||
JsonElement v = oldIdentifiers.get(i);
|
||||
Integer index = findIndex(newIdentifiers, v.getAsString());
|
||||
if (index == null) {
|
||||
if (!Via.getConfig().isSuppress1_13ConversionErrors() || Via.getManager().isDebug()) {
|
||||
if (warnOnMissing && !Via.getConfig().isSuppress1_13ConversionErrors() || Via.getManager().isDebug()) {
|
||||
Via.getPlatform().getLogger().warning("No key for " + v + " :( ");
|
||||
}
|
||||
continue;
|
||||
@ -150,10 +154,14 @@ public class MappingData {
|
||||
public static class SoundMappingShortArray implements SoundMappings {
|
||||
private short[] oldToNew;
|
||||
|
||||
public SoundMappingShortArray(JsonArray mapping1_13_2, JsonArray mapping1_14) {
|
||||
public SoundMappingShortArray(JsonArray mapping1_13_2, JsonArray mapping1_14, boolean warnOnMissing) {
|
||||
oldToNew = new short[mapping1_13_2.size()];
|
||||
Arrays.fill(oldToNew, (short) -1);
|
||||
mapIdentifiers(oldToNew, mapping1_13_2, mapping1_14);
|
||||
mapIdentifiers(oldToNew, mapping1_13_2, mapping1_14, warnOnMissing);
|
||||
}
|
||||
|
||||
public SoundMappingShortArray(JsonArray mapping1_13_2, JsonArray mapping1_14) {
|
||||
this(mapping1_13_2, mapping1_14, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -22,6 +22,7 @@ public class MappingData {
|
||||
Via.getPlatform().getLogger().info("Loading 1.14.4 -> 1.15 item mapping...");
|
||||
us.myles.ViaVersion.protocols.protocol1_14to1_13_2.data.MappingData.mapIdentifiers(oldToNewItems, mapping1_14_4.getAsJsonObject("items"), mapping1_15.getAsJsonObject("items"));
|
||||
Via.getPlatform().getLogger().info("Loading 1.14.4 -> 1.15 sound mapping...");
|
||||
soundMappings = new us.myles.ViaVersion.protocols.protocol1_14to1_13_2.data.MappingData.SoundMappingShortArray(mapping1_14_4.getAsJsonArray("sounds"), mapping1_15.getAsJsonArray("sounds"));
|
||||
// A few removed sounds we can simply ignore
|
||||
soundMappings = new us.myles.ViaVersion.protocols.protocol1_14to1_13_2.data.MappingData.SoundMappingShortArray(mapping1_14_4.getAsJsonArray("sounds"), mapping1_15.getAsJsonArray("sounds"), false);
|
||||
}
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren