mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-22 18:15:39 +01:00
Don't throw an exception on hover parse failure
This commit is contained in:
parent
4473f863c6
commit
0ee80dc41f
@ -129,7 +129,7 @@ public class TagRewriter {
|
||||
};
|
||||
}
|
||||
|
||||
public void handle(PacketWrapper wrapper, @Nullable IdRewriteFunction rewriteFunction, List<TagData> newTags) throws Exception {
|
||||
public void handle(PacketWrapper wrapper, @Nullable IdRewriteFunction rewriteFunction, @Nullable List<TagData> newTags) throws Exception {
|
||||
int tagsSize = wrapper.read(Type.VAR_INT);
|
||||
wrapper.write(Type.VAR_INT, newTags != null ? tagsSize + newTags.size() : tagsSize); // add new tags count
|
||||
|
||||
|
@ -58,8 +58,11 @@ public class ComponentRewriter1_13 extends ComponentRewriter {
|
||||
try {
|
||||
tag = BinaryTagIO.readString(text);
|
||||
} catch (Exception e) {
|
||||
Via.getPlatform().getLogger().warning("Error reading NBT in show_item:" + text);
|
||||
throw new RuntimeException(e);
|
||||
if (!Via.getConfig().isSuppressConversionWarnings() || Via.getManager().isDebug()) {
|
||||
Via.getPlatform().getLogger().warning("Error reading NBT in show_item:" + text);
|
||||
e.printStackTrace();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
CompoundTag itemTag = tag.get("tag");
|
||||
|
@ -24,6 +24,7 @@ import us.myles.ViaVersion.api.data.UserConnection;
|
||||
import us.myles.ViaVersion.api.protocol.ClientboundPacketType;
|
||||
import us.myles.ViaVersion.api.protocol.Protocol;
|
||||
import us.myles.ViaVersion.api.remapper.PacketRemapper;
|
||||
import us.myles.ViaVersion.api.rewriters.MetadataRewriter;
|
||||
import us.myles.ViaVersion.api.rewriters.RegistryType;
|
||||
import us.myles.ViaVersion.api.rewriters.SoundRewriter;
|
||||
import us.myles.ViaVersion.api.rewriters.StatisticsRewriter;
|
||||
@ -50,7 +51,7 @@ public class Protocol1_17To1_16_4 extends Protocol<ClientboundPackets1_16_2, Cli
|
||||
|
||||
@Override
|
||||
protected void registerPackets() {
|
||||
new MetadataRewriter1_17To1_16_4(this);
|
||||
MetadataRewriter metadataRewriter = new MetadataRewriter1_17To1_16_4(this);
|
||||
|
||||
EntityPackets.register(this);
|
||||
InventoryPackets.register(this);
|
||||
@ -87,7 +88,7 @@ public class Protocol1_17To1_16_4 extends Protocol<ClientboundPackets1_16_2, Cli
|
||||
}
|
||||
});
|
||||
|
||||
new StatisticsRewriter(this, null).register(ClientboundPackets1_16_2.STATISTICS);
|
||||
new StatisticsRewriter(this, metadataRewriter::getNewEntityId).register(ClientboundPackets1_16_2.STATISTICS);
|
||||
|
||||
SoundRewriter soundRewriter = new SoundRewriter(this);
|
||||
soundRewriter.registerSound(ClientboundPackets1_16_2.SOUND);
|
||||
|
Loading…
Reference in New Issue
Block a user