diff --git a/common/evilcraft/api/config/elementtypeaction/MobAction.java b/common/evilcraft/api/config/elementtypeaction/MobAction.java index db599a4a8c..1cc720e61a 100644 --- a/common/evilcraft/api/config/elementtypeaction/MobAction.java +++ b/common/evilcraft/api/config/elementtypeaction/MobAction.java @@ -1,7 +1,5 @@ package evilcraft.api.config.elementtypeaction; -import net.minecraft.entity.EntityEggInfo; -import net.minecraft.entity.EntityList; import net.minecraft.entity.EntityLiving; import net.minecraftforge.common.Configuration; import cpw.mods.fml.common.registry.EntityRegistry; @@ -34,24 +32,13 @@ public void postRun(MobConfig eConfig, Configuration config) { Class clazz = (Class) eConfig.ELEMENT; if (Helpers.isClientSide()) ClientProxy.ENTITY_RENDERERS.put(clazz, eConfig.getRender()); + EntityRegistry.registerGlobalEntityID(clazz, eConfig.NAMEDID, EntityRegistry.findGlobalUniqueEntityId(), eConfig.getBackgroundEggColor(), eConfig.getForegroundEggColor()); EntityRegistry.registerModEntity(clazz, eConfig.NAMEDID, eConfig.ID, EvilCraft._instance, 80, 3, true); // Add I18N LanguageRegistry.instance().addStringLocalization("entity." + Reference.MOD_ID + ".instance." + eConfig.NAMEDID + ".name", eConfig.NAME); LanguageRegistry.instance().addStringLocalization("entity." + Reference.MOD_ID + "." + eConfig.NAMEDID + ".name", eConfig.NAME); - registerSpawnEgg(clazz, eConfig.getBackgroundEggColor(), eConfig.getForegroundEggColor()); - } - - @SuppressWarnings("unchecked") - private static void registerSpawnEgg(Class entity, int backgroundColor, int foregroundColor) { - int globalEntityID = 0; - while (EntityList.getStringFromID(globalEntityID) != null){ - globalEntityID++; - } - - EntityList.IDtoClassMapping.put(globalEntityID, entity); - EntityList.entityEggs.put(globalEntityID, new EntityEggInfo(globalEntityID, backgroundColor, foregroundColor)); - + LanguageRegistry.instance().addStringLocalization("entity." + eConfig.NAMEDID + ".name", eConfig.NAME); // For global registering } }