diff --git a/src/codechicken/lib/packet/PacketCustom.java b/src/codechicken/lib/packet/PacketCustom.java index 7e238f2..bd4586b 100644 --- a/src/codechicken/lib/packet/PacketCustom.java +++ b/src/codechicken/lib/packet/PacketCustom.java @@ -145,8 +145,12 @@ public final class PacketCustom implements MCDataInput, MCDataOutput public static String channelName(Object channelKey) { if (channelKey instanceof String) return (String) channelKey; - if (channelKey instanceof ModContainer) - return ((ModContainer) channelKey).getModId(); + if (channelKey instanceof ModContainer) { + String s = ((ModContainer) channelKey).getModId(); + if(s.length() > 20) + throw new IllegalArgumentException("Mod ID ("+s+") too long for use as channel (20 chars). Use a string identifier"); + return s; + } ModContainer mc = FMLCommonHandler.instance().findContainerFor(channelKey); if (mc != null)