use of cpw.mods.fml.common.registry.EntityRegistry.EntityRegistration in project MineFactoryReloaded by powercrystals.
the class TwilightForestEggHandler method getEgg.
@SuppressWarnings("unchecked")
@Override
public EntityEggInfo getEgg(ItemStack safariNet) {
Class<? extends Entity> entityClass = (Class<? extends Entity>) EntityList.stringToClassMapping.get(safariNet.getTagCompound().getString("id"));
if (entityClass == null) {
return null;
}
EntityRegistration er = EntityRegistry.instance().lookupModSpawn(entityClass, true);
if (er != null && er.getContainer() == TwilightForest.twilightForestContainer) {
return (EntityEggInfo) TwilightForest.entityEggs.get(er.getModEntityId());
}
return null;
}
use of cpw.mods.fml.common.registry.EntityRegistry.EntityRegistration in project ArsMagica2 by Mithion.
the class CompendiumUnlockHandler method onEntityDeath.
/**
* This should handle all mobs and the Astral Barrier
*
* @param event
*/
@SubscribeEvent
public void onEntityDeath(LivingDeathEvent event) {
if (event.entityLiving.worldObj.isRemote && event.source.getSourceOfDamage() instanceof EntityPlayer) {
if (event.entity instanceof EntityEnderman) {
ArcaneCompendium.instance.unlockEntry("blockastralbarrier");
} else {
EntityRegistration reg = EntityRegistry.instance().lookupModSpawn(event.entityLiving.getClass(), true);
if (reg != null && reg.getContainer().matches(AMCore.instance)) {
String id = reg.getEntityName();
ArcaneCompendium.instance.unlockEntry(id);
}
}
}
}
Aggregations