2013-05-03 13:00:44 +00:00
|
|
|
package biomesoplenty.configuration;
|
|
|
|
|
2013-05-29 01:05:27 +00:00
|
|
|
import net.minecraft.entity.Entity;
|
|
|
|
import net.minecraft.entity.EntityEggInfo;
|
|
|
|
import net.minecraft.entity.EntityList;
|
|
|
|
import net.minecraft.entity.EnumCreatureType;
|
2013-05-03 13:00:44 +00:00
|
|
|
import biomesoplenty.BiomesOPlenty;
|
|
|
|
import biomesoplenty.api.Biomes;
|
2013-05-07 01:02:25 +00:00
|
|
|
import biomesoplenty.items.projectiles.EntityDart;
|
2013-05-03 13:00:44 +00:00
|
|
|
import biomesoplenty.items.projectiles.EntityMudball;
|
2013-05-12 03:37:49 +00:00
|
|
|
import biomesoplenty.items.projectiles.EntityPoisonDart;
|
2013-05-17 07:18:08 +00:00
|
|
|
import biomesoplenty.mobs.EntityGlob;
|
2013-05-03 13:00:44 +00:00
|
|
|
import biomesoplenty.mobs.EntityJungleSpider;
|
|
|
|
import biomesoplenty.mobs.EntityRosester;
|
|
|
|
import cpw.mods.fml.common.registry.EntityRegistry;
|
|
|
|
import cpw.mods.fml.common.registry.LanguageRegistry;
|
|
|
|
|
|
|
|
public class BOPEntities {
|
|
|
|
|
|
|
|
//Eggs
|
|
|
|
public static int eggIdCounter = 300;
|
|
|
|
|
|
|
|
//Find the first available egg ID after our egg ID counter
|
|
|
|
public static int getUniqueEntityEggId() {
|
|
|
|
do {
|
|
|
|
eggIdCounter++;
|
|
|
|
} while (EntityList.getStringFromID(eggIdCounter) != null);
|
|
|
|
|
|
|
|
return eggIdCounter;
|
|
|
|
}
|
|
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
|
|
|
public static void registerEntityEgg(Class<? extends Entity> entity, int primaryColor, int secondaryColor) {
|
|
|
|
int id = getUniqueEntityEggId();
|
|
|
|
EntityList.IDtoClassMapping.put(id, entity);
|
|
|
|
EntityList.entityEggs.put(id, new EntityEggInfo(id, primaryColor, secondaryColor));
|
|
|
|
}
|
|
|
|
|
|
|
|
public static void init()
|
|
|
|
{
|
2013-05-11 12:51:16 +00:00
|
|
|
EntityRegistry.registerModEntity(EntityMudball.class, "MudBall", BOPConfiguration.entityMudballID, BiomesOPlenty.instance, 80, 3, true);
|
|
|
|
EntityRegistry.registerModEntity(EntityDart.class, "Dart", BOPConfiguration.entityDartID, BiomesOPlenty.instance, 80, 3, true);
|
2013-05-12 03:37:49 +00:00
|
|
|
EntityRegistry.registerModEntity(EntityPoisonDart.class, "PoisonDart", BOPConfiguration.entityPoisonDartID, BiomesOPlenty.instance, 80, 3, true);
|
2013-05-17 07:18:08 +00:00
|
|
|
|
2013-05-03 13:00:44 +00:00
|
|
|
EntityRegistry.registerModEntity(EntityJungleSpider.class, "JungleSpider", BOPConfiguration.jungleSpiderID, BiomesOPlenty.instance, 80, 3, true);
|
|
|
|
EntityRegistry.registerModEntity(EntityRosester.class, "Rosester", BOPConfiguration.rosesterID, BiomesOPlenty.instance, 80, 3, true);
|
2013-05-17 07:18:08 +00:00
|
|
|
EntityRegistry.registerModEntity(EntityGlob.class, "Glob", BOPConfiguration.globID, BiomesOPlenty.instance, 80, 3, true);
|
2013-05-03 13:00:44 +00:00
|
|
|
|
|
|
|
registerEntityEgg(EntityJungleSpider.class, 5147192, 11013646);
|
|
|
|
registerEntityEgg(EntityRosester.class, 14831439, 16756224);
|
2013-05-17 09:59:08 +00:00
|
|
|
registerEntityEgg(EntityGlob.class, 6836276, 8414787);
|
2013-05-03 13:00:44 +00:00
|
|
|
|
|
|
|
if (Biomes.jungleNew.isPresent() && Biomes.tropicalRainforest.isPresent() && Biomes.oasis.isPresent() && Biomes.tropics.isPresent())
|
|
|
|
{
|
|
|
|
EntityRegistry.addSpawn(EntityJungleSpider.class, 8, 1, 3, EnumCreatureType.monster, Biomes.jungleNew.get(), Biomes.tropicalRainforest.get(), Biomes.oasis.get(), Biomes.tropics.get());
|
|
|
|
}
|
2013-05-17 09:59:08 +00:00
|
|
|
|
|
|
|
if (Biomes.bog.isPresent() && Biomes.deadSwamp.isPresent() && Biomes.fen.isPresent() && Biomes.moor.isPresent() && Biomes.quagmire.isPresent() && Biomes.swamplandNew.isPresent())
|
|
|
|
{
|
|
|
|
EntityRegistry.addSpawn(EntityJungleSpider.class, 1, 1, 1, EnumCreatureType.creature, Biomes.bog.get(), Biomes.deadSwamp.get(), Biomes.fen.get(), Biomes.moor.get(), Biomes.quagmire.get(), Biomes.swamplandNew.get());
|
|
|
|
}
|
2013-05-03 13:00:44 +00:00
|
|
|
|
|
|
|
if (Biomes.garden.isPresent())
|
|
|
|
{
|
|
|
|
EntityRegistry.addSpawn(EntityRosester.class, 10, 2, 4, EnumCreatureType.creature, Biomes.garden.get());
|
|
|
|
}
|
|
|
|
|
|
|
|
LanguageRegistry.instance().addStringLocalization("entity.BiomesOPlenty.JungleSpider.name", "en_US", "Jungle Spider");
|
|
|
|
LanguageRegistry.instance().addStringLocalization("entity.BiomesOPlenty.Rosester.name", "en_US", "Rosester");
|
2013-05-17 07:18:08 +00:00
|
|
|
LanguageRegistry.instance().addStringLocalization("entity.BiomesOPlenty.Glob.name", "en_US", "Glob");
|
2013-05-03 13:00:44 +00:00
|
|
|
}
|
|
|
|
}
|