mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-16 18:45:09 +00:00
Fix up mods trying to register entities outside of modloading. Now you'll get a big fat warning for doing such a derpy thing.
This commit is contained in:
1 parent
186680cd8c
commit
869cf78e98
1 file changed
+12
-1
@@ -171,7 +171,18 @@ public class EntityRegistry
|
|||||||
{
|
{
|
||||||
if (EntityList.field_75626_c.containsKey(entityClass))
|
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;
|
return;
|
||||||
}
|
}
|
||||||
id = instance().validateAndClaimId(id);
|
id = instance().validateAndClaimId(id);
|
||||||
|
|||||||
Reference in new issue
Block a user