From 869cf78e98f0dc1ee82781774155ef6577527dcb Mon Sep 17 00:00:00 2001 From: Christian Date: Mon, 3 Sep 2012 21:32:21 -0400 Subject: [PATCH] Fix up mods trying to register entities outside of modloading. Now you'll get a big fat warning for doing such a derpy thing. --- .../mods/fml/common/registry/EntityRegistry.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/common/cpw/mods/fml/common/registry/EntityRegistry.java b/common/cpw/mods/fml/common/registry/EntityRegistry.java index bf9d90cb02..df2c6bab4a 100644 --- a/common/cpw/mods/fml/common/registry/EntityRegistry.java +++ b/common/cpw/mods/fml/common/registry/EntityRegistry.java @@ -171,7 +171,18 @@ public class EntityRegistry { if (EntityList.field_75626_c.containsKey(entityClass)) { - FMLLog.warning("The mod %s tried to register the entity class %s which was already registered - if you wish to override default naming for FML mod entities, register it here first", Loader.instance().activeModContainer().getModId(), entityClass); + ModContainer activeModContainer = Loader.instance().activeModContainer(); + String modId = "unknown"; + if (activeModContainer != null) + { + modId = activeModContainer.getModId(); + } + else + { + FMLLog.severe("There is a rogue mod trying to register entities from outside the context of mod loading. This is incredibly dangerous and should be stopped."); + Thread.dumpStack(); + } + FMLLog.warning("The mod %s tried to register the entity class %s which was already registered - if you wish to override default naming for FML mod entities, register it here first", modId, entityClass); return; } id = instance().validateAndClaimId(id);