mirror of
https://github.com/GTNewHorizons/CodeChickenCore.git
synced 2026-11-11 15:57:42 +00:00
Added informative exception when attempting to register a channel using a modID > 20 characters
This commit is contained in:
1 parent
93b1e5dbf0
commit
ba15e4b116
1 file changed
+6
-2
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user