mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-12 16:27:47 +00:00
And handle the other way to globally register an entity
This commit is contained in:
1 parent
869cf78e98
commit
9d812f12cc
1 file changed
+16
-2
@@ -179,8 +179,7 @@ public class EntityRegistry
|
||||
}
|
||||
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.severe("There is a rogue mod failing to register entities from outside the context of mod loading. This is incredibly dangerous and should be stopped.");
|
||||
}
|
||||
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;
|
||||
@@ -222,6 +221,21 @@ public class EntityRegistry
|
||||
|
||||
public static void registerGlobalEntityID(Class <? extends Entity > entityClass, String entityName, int id, int backgroundEggColour, int foregroundEggColour)
|
||||
{
|
||||
if (EntityList.field_75626_c.containsKey(entityClass))
|
||||
{
|
||||
ModContainer activeModContainer = Loader.instance().activeModContainer();
|
||||
String modId = "unknown";
|
||||
if (activeModContainer != null)
|
||||
{
|
||||
modId = activeModContainer.getModId();
|
||||
}
|
||||
else
|
||||
{
|
||||
FMLLog.severe("There is a rogue mod failing to register entities from outside the context of mod loading. This is incredibly dangerous and should be stopped.");
|
||||
}
|
||||
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;
|
||||
}
|
||||
instance().validateAndClaimId(id);
|
||||
EntityList.func_75614_a(entityClass, entityName, id, backgroundEggColour, foregroundEggColour);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user