Search in sources :

Example 1 with EntityCaveSpider

use of net.minecraft.entity.monster.EntityCaveSpider in project Bewitchment by Um-Mitternacht.

the class SpiderNightmareBrew method onFinish.

@Override
public void onFinish(World world, BlockPos pos, EntityLivingBase entity, int amplifier) {
    if (amplifier >= 3) {
        EntityCaveSpider spider = new EntityCaveSpider(world);
        spider.setPosition(pos.getX(), pos.getY(), pos.getZ());
        world.spawnEntity(spider);
    }
    int box = 1 + (int) (amplifier / 2F);
    BlockPos posI = pos.add(box, box, box);
    BlockPos posF = pos.add(-box, -box, -box);
    BlockPos.getAllInBox(posI, posF).forEach(pos1 -> {
        if (world.getBlockState(pos1).getBlock() == Blocks.AIR)
            world.setBlockState(pos1, Blocks.WEB.getDefaultState());
    });
}
Also used : EntityCaveSpider(net.minecraft.entity.monster.EntityCaveSpider) BlockPos(net.minecraft.util.math.BlockPos)

Example 2 with EntityCaveSpider

use of net.minecraft.entity.monster.EntityCaveSpider in project BetterWithAddons by DaedalusGame.

the class AnimalCrossbreedHandler method initialize.

public static void initialize() {
    inLove = ReflectionHelper.findField(EntityAnimal.class, "field_70881_d", "inLove");
    // Standard
    mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnBabyAt(world, pos, new EntityCow(world)), 100));
    mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnBabyAt(world, pos, new EntitySheep(world)), 100));
    mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnBabyAt(world, pos, new EntityPig(world)), 100));
    // Lower chance for egg hatching animal
    mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnBabyAt(world, pos, new EntityChicken(world)), 50));
    mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnBabyAt(world, pos, new EntityRabbit(world)), 75));
    // Parent species
    mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnBabyAt(world, pos, mother.createChild(mother)), 100));
    mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnBabyAt(world, pos, father.createChild(father)), 100));
    // Abominations
    mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnEntityAt(world, pos, new EntitySilverfish(world)), 200));
    mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnEntityAt(world, pos, new EntityCaveSpider(world)), 100));
    mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnEntityAt(world, pos, new EntitySlime(world)), 50));
    // Enviroment dependent
    mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnEntityAt(world, pos, new EntitySquid(world)), 0).setCustomWeight(AnimalCrossbreedHandler::getSquidWeight));
    mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnBabyAt(world, pos, new EntityWolf(world)), 0).setCustomWeight(AnimalCrossbreedHandler::getWolfWeight));
    mutationSet.add(new AnimalMutation((world, pos, mother, father) -> spawnBabyAt(world, pos, new EntityOcelot(world)), 0).setCustomWeight(AnimalCrossbreedHandler::getOcelotWeight));
}
Also used : net.minecraft.entity.passive(net.minecraft.entity.passive) AxisAlignedBB(net.minecraft.util.math.AxisAlignedBB) EntitySlime(net.minecraft.entity.monster.EntitySlime) ReflectionHelper(net.minecraftforge.fml.relauncher.ReflectionHelper) EntityAgeable(net.minecraft.entity.EntityAgeable) ArrayList(java.util.ArrayList) PotionEffect(net.minecraft.potion.PotionEffect) EntitySilverfish(net.minecraft.entity.monster.EntitySilverfish) Vec3d(net.minecraft.util.math.Vec3d) BiomeDictionary(net.minecraftforge.common.BiomeDictionary) Entity(net.minecraft.entity.Entity) World(net.minecraft.world.World) BlockPos(net.minecraft.util.math.BlockPos) Field(java.lang.reflect.Field) Collectors(java.util.stream.Collectors) IBlockState(net.minecraft.block.state.IBlockState) List(java.util.List) LivingEvent(net.minecraftforge.event.entity.living.LivingEvent) Material(net.minecraft.block.material.Material) EntityLivingBase(net.minecraft.entity.EntityLivingBase) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent) EntityCaveSpider(net.minecraft.entity.monster.EntityCaveSpider) MobEffects(net.minecraft.init.MobEffects) Biome(net.minecraft.world.biome.Biome) WeightedRandom(net.minecraft.util.WeightedRandom) EntityCaveSpider(net.minecraft.entity.monster.EntityCaveSpider) EntitySlime(net.minecraft.entity.monster.EntitySlime) EntitySilverfish(net.minecraft.entity.monster.EntitySilverfish)

Example 3 with EntityCaveSpider

use of net.minecraft.entity.monster.EntityCaveSpider in project MineFactoryReloaded by powercrystals.

the class VanillaMobProvider method getRandomMobs.

@Override
public List<RandomMob> getRandomMobs(World world) {
    List<RandomMob> mobs = new ArrayList<RandomMob>();
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntityMooshroom.class, world), 20));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntitySlime.class, world), 20));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntityCow.class, world), 100));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntityChicken.class, world), 100));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntitySheep.class, world), 100));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntityWitch.class, world), 10));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntityGhast.class, world), 15));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntityPig.class, world), 100));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntityCreeper.class, world), 25));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntitySquid.class, world), 30));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntityMinecartHopper.class, world), 15));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntityOcelot.class, world), 20));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntityWolf.class, world), 20));
    mobs.add(new RandomMob(MFRUtil.prepareMob(EntityBat.class, world), 35));
    EntityCreeper chargedCreeper = (EntityCreeper) MFRUtil.prepareMob(EntityCreeper.class, world);
    NBTTagCompound creeperNBT = new NBTTagCompound();
    chargedCreeper.writeToNBT(creeperNBT);
    creeperNBT.setBoolean("powered", true);
    creeperNBT.setShort("Fuse", (short) 120);
    chargedCreeper.readFromNBT(creeperNBT);
    mobs.add(new RandomMob(chargedCreeper, 5));
    EntityTNTPrimed armedTNT = (EntityTNTPrimed) MFRUtil.prepareMob(EntityTNTPrimed.class, world);
    armedTNT.fuse = 120;
    mobs.add(new RandomMob(armedTNT, 5));
    EntitySlime invisislime = (EntitySlime) MFRUtil.prepareMob(EntitySlime.class, world);
    invisislime.addPotionEffect(new PotionEffect(Potion.invisibility.id, 120 * 20));
    mobs.add(new RandomMob(invisislime, 5));
    EntityMooshroom invisishroom = (EntityMooshroom) MFRUtil.prepareMob(EntityMooshroom.class, world);
    invisishroom.addPotionEffect(new PotionEffect(Potion.invisibility.id, 120 * 20));
    mobs.add(new RandomMob(invisishroom, 5));
    EntitySkeleton skeleton1 = (EntitySkeleton) MFRUtil.prepareMob(EntitySkeleton.class, world);
    EntitySkeleton skeleton2 = (EntitySkeleton) MFRUtil.prepareMob(EntitySkeleton.class, world);
    EntitySkeleton skeleton3 = (EntitySkeleton) MFRUtil.prepareMob(EntitySkeleton.class, world);
    EntitySkeleton skeleton4 = (EntitySkeleton) MFRUtil.prepareMob(EntitySkeleton.class, world);
    skeleton4.mountEntity(skeleton3);
    skeleton3.mountEntity(skeleton2);
    skeleton2.mountEntity(skeleton1);
    mobs.add(new RandomMob(skeleton1, 2));
    EntityBlaze blazeJockey = (EntityBlaze) MFRUtil.prepareMob(EntityBlaze.class, world);
    EntityGhast blazeMount = (EntityGhast) MFRUtil.prepareMob(EntityGhast.class, world);
    blazeJockey.mountEntity(blazeMount);
    mobs.add(new RandomMob(blazeMount, 2));
    EntityCreeper creeperJockey = (EntityCreeper) MFRUtil.prepareMob(EntityCreeper.class, world);
    EntityCaveSpider creeperMount = (EntityCaveSpider) MFRUtil.prepareMob(EntityCaveSpider.class, world);
    creeperJockey.mountEntity(creeperMount);
    mobs.add(new RandomMob(creeperMount, 2));
    return mobs;
}
Also used : EntityMooshroom(net.minecraft.entity.passive.EntityMooshroom) RandomMob(powercrystals.minefactoryreloaded.api.RandomMob) EntityCaveSpider(net.minecraft.entity.monster.EntityCaveSpider) PotionEffect(net.minecraft.potion.PotionEffect) EntityTNTPrimed(net.minecraft.entity.item.EntityTNTPrimed) EntitySlime(net.minecraft.entity.monster.EntitySlime) EntitySkeleton(net.minecraft.entity.monster.EntitySkeleton) ArrayList(java.util.ArrayList) NBTTagCompound(net.minecraft.nbt.NBTTagCompound) EntityGhast(net.minecraft.entity.monster.EntityGhast) EntityBlaze(net.minecraft.entity.monster.EntityBlaze) EntityCreeper(net.minecraft.entity.monster.EntityCreeper)

Aggregations

EntityCaveSpider (net.minecraft.entity.monster.EntityCaveSpider)3 ArrayList (java.util.ArrayList)2 EntitySlime (net.minecraft.entity.monster.EntitySlime)2 PotionEffect (net.minecraft.potion.PotionEffect)2 BlockPos (net.minecraft.util.math.BlockPos)2 Field (java.lang.reflect.Field)1 List (java.util.List)1 Collectors (java.util.stream.Collectors)1 Material (net.minecraft.block.material.Material)1 IBlockState (net.minecraft.block.state.IBlockState)1 Entity (net.minecraft.entity.Entity)1 EntityAgeable (net.minecraft.entity.EntityAgeable)1 EntityLivingBase (net.minecraft.entity.EntityLivingBase)1 EntityTNTPrimed (net.minecraft.entity.item.EntityTNTPrimed)1 EntityBlaze (net.minecraft.entity.monster.EntityBlaze)1 EntityCreeper (net.minecraft.entity.monster.EntityCreeper)1 EntityGhast (net.minecraft.entity.monster.EntityGhast)1 EntitySilverfish (net.minecraft.entity.monster.EntitySilverfish)1 EntitySkeleton (net.minecraft.entity.monster.EntitySkeleton)1 net.minecraft.entity.passive (net.minecraft.entity.passive)1