3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-27 08:30:09 +01:00

Use SerializerVersion#toTag when converting 1.20.5->1.20.3 block predicates (#4024)

Dieser Commit ist enthalten in:
EnZaXD 2024-07-19 10:54:40 +02:00 committet von GitHub
Ursprung cc87c02020
Commit 275b09bdbb
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: B5690EEEBB952194

Datei anzeigen

@ -17,7 +17,6 @@
*/ */
package com.viaversion.viaversion.protocols.v1_20_3to1_20_5.rewriter; package com.viaversion.viaversion.protocols.v1_20_3to1_20_5.rewriter;
import com.viaversion.nbt.stringified.SNBT;
import com.viaversion.nbt.tag.ByteTag; import com.viaversion.nbt.tag.ByteTag;
import com.viaversion.nbt.tag.CompoundTag; import com.viaversion.nbt.tag.CompoundTag;
import com.viaversion.nbt.tag.IntArrayTag; import com.viaversion.nbt.tag.IntArrayTag;
@ -859,7 +858,7 @@ public final class BlockItemPacketRewriter1_20_5 extends ItemRewriter<Clientboun
CompoundTag tag = null; CompoundTag tag = null;
if (tagStartIndex != -1 && tagEndIndex != -1) { if (tagStartIndex != -1 && tagEndIndex != -1) {
try { try {
tag = SNBT.deserializeCompoundTag(rawPredicate.substring(tagStartIndex, tagEndIndex + 1)); tag = (CompoundTag) SerializerVersion.V1_20_3.toTag(rawPredicate.substring(tagStartIndex, tagEndIndex + 1));
} catch (final Exception e) { } catch (final Exception e) {
if (Via.getManager().isDebug()) { if (Via.getManager().isDebug()) {
Protocol1_20_3To1_20_5.LOGGER.log(Level.SEVERE, "Failed to parse block predicate tag: " + rawPredicate.substring(tagStartIndex, tagEndIndex + 1), e); Protocol1_20_3To1_20_5.LOGGER.log(Level.SEVERE, "Failed to parse block predicate tag: " + rawPredicate.substring(tagStartIndex, tagEndIndex + 1), e);