Search in sources :

Example 1 with EntityEggInfo

use of net.minecraft.entity.EntityEggInfo 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;
}
Also used : Entity(net.minecraft.entity.Entity) EntityEggInfo(net.minecraft.entity.EntityEggInfo) EntityRegistration(cpw.mods.fml.common.registry.EntityRegistry.EntityRegistration)

Aggregations

EntityRegistration (cpw.mods.fml.common.registry.EntityRegistry.EntityRegistration)1 Entity (net.minecraft.entity.Entity)1 EntityEggInfo (net.minecraft.entity.EntityEggInfo)1