Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2025-01-11 15:41:01 +01: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:
Ursprung
8d97391bf3
Commit
99ac42c168
@ -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);
|
||||
|
Laden…
x
In neuem Issue referenzieren
Einen Benutzer sperren