diff --git a/common/src/main/java/us/myles/ViaVersion/api/protocol/Protocol.java b/common/src/main/java/us/myles/ViaVersion/api/protocol/Protocol.java index 56e8c2fcc..119359495 100644 --- a/common/src/main/java/us/myles/ViaVersion/api/protocol/Protocol.java +++ b/common/src/main/java/us/myles/ViaVersion/api/protocol/Protocol.java @@ -406,15 +406,36 @@ public abstract class Protocol packetTypeClass = direction == Direction.OUTGOING ? oldClientboundPacketEnum : newServerboundPacketEnum; + if (packetTypeClass != null) { + PacketType[] enumConstants = packetTypeClass.getEnumConstants(); + PacketType packetType = oldId < enumConstants.length && oldId >= 0 ? enumConstants[oldId] : null; + Via.getPlatform().getLogger().warning("ERROR IN " + getClass().getSimpleName() + " IN REMAP OF " + packetType + " (" + oldId + ")"); + } else { + Via.getPlatform().getLogger().warning("ERROR IN " + getClass().getSimpleName() + + " IN REMAP OF 0x" + Integer.toHexString(oldId) + "->0x" + Integer.toHexString(newId)); + } + throw e; + } + + if (packetWrapper.isCancelled()) { + throw Via.getManager().isDebug() ? new CancelException() : CancelException.CACHED; } }