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

Don't assume CanPlaceOn tag is ListTag

I guess somewhere in my testing I made a CanPlaceOn tag that was a byte value and the client disconnected on me when I put ViaBackwards on my testing instance. This commit doesn't translate the CanPlaceOn tag if it isn't a ListTag.
Dieser Commit ist enthalten in:
DoctorMacc 2020-08-16 23:15:20 -04:00 committet von Nassim
Ursprung 03ec04cc8d
Commit e03da34f55

Datei anzeigen

@ -625,6 +625,8 @@ public class BlockItemPackets1_13 extends nl.matsv.viabackwards.api.rewriters.It
}
private void rewriteCanPlaceToClient(CompoundTag tag, String tagName) {
// The tag was manually created incorrectly so ignore rewriting it
if (!(tag.get(tagName) instanceof ListTag)) return;
ListTag blockTag = tag.get(tagName);
if (blockTag == null) return;
@ -865,6 +867,7 @@ public class BlockItemPackets1_13 extends nl.matsv.viabackwards.api.rewriters.It
}
private void rewriteCanPlaceToServer(CompoundTag tag, String tagName) {
if (!(tag.get(tagName) instanceof ListTag)) return;
ListTag blockTag = tag.remove(extraNbtTag + "|" + tagName);
if (blockTag != null) {
tag.put(ConverterRegistry.convertToTag(tagName, ConverterRegistry.convertToValue(blockTag)));