3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-07-11 09:48:03 +02:00

Issue with the CanDestroy taglist (#1411)

* Fix for an issue with the CanDestroy tag

The CanDestroy taglist didn't go to lowercase when a 1.13+ user plays on a server equal to 1.12.2 or lower causing the taglist to not work any longer for items written in caps, this while a 1.12.2 client can use the item with the in caps written CanDestroy taglist on the server

* Added Locale.ROOT to the toLowerCase()

* Added the same functionality to CanPlaceOn
Dieser Commit ist enthalten in:
Thom 2019-07-29 12:19:30 +02:00 committet von Myles
Ursprung 8d97391bf3
Commit 99ac42c168

Datei anzeigen

@ -27,6 +27,7 @@ import us.myles.ViaVersion.protocols.protocol1_13to1_12_2.data.SpawnEggRewriter;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
public class InventoryPackets {
private static String NBT_TAG_NAME;
@ -404,13 +405,13 @@ public class InventoryPackets {
if (numberConverted != null) {
oldId = numberConverted;
}
String[] newValues = BlockIdData.blockIdMapping.get(oldId);
String[] newValues = BlockIdData.blockIdMapping.get(oldId.toLowerCase(Locale.ROOT));
if (newValues != null) {
for (String newValue : newValues) {
newCanPlaceOn.add(new StringTag("", newValue));
}
} else {
newCanPlaceOn.add(new StringTag("", oldId));
newCanPlaceOn.add(new StringTag("", oldId.toLowerCase(Locale.ROOT)));
}
}
tag.put(newCanPlaceOn);
@ -426,13 +427,13 @@ public class InventoryPackets {
if (numberConverted != null) {
oldId = numberConverted;
}
String[] newValues = BlockIdData.blockIdMapping.get(oldId);
String[] newValues = BlockIdData.blockIdMapping.get(oldId.toLowerCase(Locale.ROOT));
if (newValues != null) {
for (String newValue : newValues) {
newCanDestroy.add(new StringTag("", newValue));
}
} else {
newCanDestroy.add(new StringTag("", oldId));
newCanDestroy.add(new StringTag("", oldId.toLowerCase(Locale.ROOT)));
}
}
tag.put(newCanDestroy);