Ignore errors in book conversion

This commit is contained in:
Nassim Jahnke 2024-01-29 10:17:50 +01:00
parent 1f3555df4a
commit 8759f059b7
No known key found for this signature in database
GPG Key ID: EF6771C01F6EF02F

View File

@ -20,6 +20,7 @@ package com.viaversion.viabackwards.protocol.protocol1_20_2to1_20_3.rewriter;
import com.viaversion.viabackwards.ViaBackwards;
import com.viaversion.viabackwards.api.rewriters.ItemRewriter;
import com.viaversion.viabackwards.protocol.protocol1_20_2to1_20_3.Protocol1_20_2To1_20_3;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.data.ParticleMappings;
import com.viaversion.viaversion.api.minecraft.item.Item;
import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
@ -188,8 +189,14 @@ public final class BlockItemPacketRewriter1_20_3 extends ItemRewriter<Clientboun
}
final StringTag stringTag = (StringTag) pageTag;
final JsonElement updatedComponent = ComponentUtil.convertJson(stringTag.getValue(), ComponentUtil.SerializerVersion.V1_20_3, ComponentUtil.SerializerVersion.V1_19_4);
stringTag.setValue(updatedComponent.toString());
try {
final JsonElement updatedComponent = ComponentUtil.convertJson(stringTag.getValue(), ComponentUtil.SerializerVersion.V1_20_3, ComponentUtil.SerializerVersion.V1_19_4);
stringTag.setValue(updatedComponent.toString());
} catch (final Exception e) {
if (Via.getManager().isDebug()) {
e.printStackTrace();
}
}
}
}
}