+ public static Map<Class <? extends Entity>, String> entityTypeMap = Maps.newHashMap(); // Cauldron - used by CraftCustomEntity
+ public static Map<String, Class <? extends Entity>> entityClassMap = Maps.newHashMap(); // Cauldron - used by CraftWorld
public static EntityRegistry instance()
{
return INSTANCE;
@@ -147,6 +155,7 @@
public static void registerModEntity(Class<? extends Entity> entityClass, String entityName, int id, Object mod, int trackingRange, int updateFrequency, boolean sendsVelocityUpdates)
+ entityName = entityName.replaceAll("[^A-Za-z0-9]", ""); // remove all non-digits/alphanumeric
+ if (activeModContainer != null)
+ modId = activeModContainer.getModId();
+ entityName = modId + "-" + entityName;
+ entityTypeMap.put(entityClass, entityName);
+ entityClassMap.put(entityName, entityClass);
+ }
+
+ // used by CraftCustomEntity
+ public static String getCustomEntityTypeName(Class <? extends Entity > entityClass)
+ {
+ return entityTypeMap.get(entityClass);
+ }
+ // Cauldron end
+
public static void addSpawn(Class <? extends EntityLiving > entityClass, int weightedProb, int min, int max, EnumCreatureType typeOfCreature, BiomeGenBase... biomes)