예제 #1
0
 public static void registerGlobalEntityID(Class <? extends Entity > entityClass, String entityName, int id, int backgroundEggColour, int foregroundEggColour)
 {
     if (EntityList.classToStringMapping.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.addMapping(entityClass, entityName, id, backgroundEggColour, foregroundEggColour);
 }