Search in sources :

Example 1 with LootBlocker

use of party.lemons.biomemakeover.util.extensions.LootBlocker in project Biome-Makeover by Lemonszz.

the class RavagerChargePhase method onEnterPhase.

@Override
public void onEnterPhase() {
    super.onEnterPhase();
    adjudicator.setState(AdjudicatorState.FIGHTING);
    RavagerEntity ravager = EntityType.RAVAGER.create(world);
    ((LootBlocker) ravager).setLootBlocked(true);
    ravager.updatePositionAndAngles(adjudicator.getX(), adjudicator.getY(), adjudicator.getZ(), adjudicator.yaw, adjudicator.pitch);
    world.spawnEntity(ravager);
    adjudicator.clearArea(ravager);
    adjudicator.startRiding(ravager, true);
    ItemStack stack = new ItemStack(Items.CROSSBOW);
    stack.addEnchantment(Enchantments.MULTISHOT, 3);
    adjudicator.setStackInHand(Hand.MAIN_HAND, stack);
    adjudicator.playSound(BMEffects.ADJUDICATOR_SPELL_GRUNT, 1F, 1F);
}
Also used : LootBlocker(party.lemons.biomemakeover.util.extensions.LootBlocker) RavagerEntity(net.minecraft.entity.mob.RavagerEntity) ItemStack(net.minecraft.item.ItemStack)

Example 2 with LootBlocker

use of party.lemons.biomemakeover.util.extensions.LootBlocker in project Biome-Makeover by Lemonszz.

the class StoneGolemPhase method onEnterPhase.

@Override
public void onEnterPhase() {
    super.onEnterPhase();
    adjudicator.setState(AdjudicatorState.FIGHTING);
    StoneGolemEntity golem = BMEntities.STONE_GOLEM.create(world);
    ((LootBlocker) golem).setLootBlocked(true);
    golem.setStackInHand(Hand.MAIN_HAND, new ItemStack(Items.CROSSBOW));
    golem.updatePositionAndAngles(adjudicator.getX(), adjudicator.getY(), adjudicator.getZ(), adjudicator.yaw, adjudicator.pitch);
    world.spawnEntity(golem);
    adjudicator.startRiding(golem, true);
    adjudicator.clearArea(golem);
    ItemStack stack = new ItemStack(Items.BOW);
    stack.addEnchantment(Enchantments.PUNCH, 1);
    adjudicator.setStackInHand(Hand.MAIN_HAND, stack);
    adjudicator.playSound(BMEffects.ADJUDICATOR_SPELL_GRUNT, 1F, 1F);
}
Also used : LootBlocker(party.lemons.biomemakeover.util.extensions.LootBlocker) StoneGolemEntity(party.lemons.biomemakeover.entity.StoneGolemEntity) ItemStack(net.minecraft.item.ItemStack)

Example 3 with LootBlocker

use of party.lemons.biomemakeover.util.extensions.LootBlocker in project Biome-Makeover by Lemonszz.

the class MimicPhase method onEnterPhase.

@Override
public void onEnterPhase() {
    super.onEnterPhase();
    List<BlockPos> setPositions = Lists.newArrayList();
    int mimicCount = RandomUtil.randomRange(3, 6);
    for (int i = 0; i < mimicCount; i++) {
        BlockPos spawnPos;
        do {
            spawnPos = adjudicator.findSuitableArenaPos();
        } while (setPositions.contains(spawnPos));
        setPositions.add(spawnPos);
        if (world.getBlockState(spawnPos.down()).isAir())
            world.setBlockState(spawnPos.down(), Blocks.COBBLESTONE.getDefaultState());
        AdjudicatorMimicEntity mimic = BMEntities.ADJUDICATOR_MIMIC.create(world);
        ((LootBlocker) mimic).setLootBlocked(true);
        mimic.initialize((ServerWorldAccess) world, world.getLocalDifficulty(spawnPos), SpawnReason.NATURAL, null, null);
        mimic.refreshPositionAndAngles(spawnPos.getX() + 0.5F, spawnPos.getY(), spawnPos.getZ() + 0.5F, 0, 0);
        world.spawnEntity(mimic);
        adjudicator.clearArea(mimic);
        NetworkUtil.doEnderParticles(world, mimic, 10);
    }
    NetworkUtil.doEnderParticles(world, adjudicator, 10);
}
Also used : AdjudicatorMimicEntity(party.lemons.biomemakeover.entity.adjudicator.AdjudicatorMimicEntity) LootBlocker(party.lemons.biomemakeover.util.extensions.LootBlocker) BlockPos(net.minecraft.util.math.BlockPos)

Example 4 with LootBlocker

use of party.lemons.biomemakeover.util.extensions.LootBlocker in project Biome-Makeover by Lemonszz.

the class SummonPhase method spawnEntity.

protected void spawnEntity() {
    BlockPos spawnPos = spawnPositions[spawnIndex];
    if (world.getBlockState(spawnPos.down()).isAir())
        world.setBlockState(spawnPos.down(), Blocks.COBBLESTONE.getDefaultState());
    LivingEntity entity = entities[random.nextInt(entities.length)].create(world);
    if (entity instanceof MobEntity)
        ((MobEntity) entity).initialize((ServerWorldAccess) world, world.getLocalDifficulty(spawnPos), SpawnReason.EVENT, null, null);
    ((LootBlocker) entity).setLootBlocked(true);
    entity.refreshPositionAndAngles((double) spawnPos.getX() + 0.5D, (double) spawnPos.getY(), (double) spawnPos.getZ() + 0.5D, 0.0F, 0.0F);
    world.spawnEntity(entity);
    adjudicator.clearArea(entity);
    if (entity instanceof EvokerEntity) {
        GoalSelectorExtension.removeGoal((MobEntity) entity, EvokerEntity.SummonVexGoal.class);
    }
    world.playSound(null, spawnPos, SoundEvents.ENTITY_EVOKER_CAST_SPELL, SoundCategory.HOSTILE, 10F, 1F);
}
Also used : LivingEntity(net.minecraft.entity.LivingEntity) LootBlocker(party.lemons.biomemakeover.util.extensions.LootBlocker) ServerWorldAccess(net.minecraft.world.ServerWorldAccess) EvokerEntity(net.minecraft.entity.mob.EvokerEntity) BlockPos(net.minecraft.util.math.BlockPos) MobEntity(net.minecraft.entity.mob.MobEntity)

Aggregations

LootBlocker (party.lemons.biomemakeover.util.extensions.LootBlocker)4 ItemStack (net.minecraft.item.ItemStack)2 BlockPos (net.minecraft.util.math.BlockPos)2 LivingEntity (net.minecraft.entity.LivingEntity)1 EvokerEntity (net.minecraft.entity.mob.EvokerEntity)1 MobEntity (net.minecraft.entity.mob.MobEntity)1 RavagerEntity (net.minecraft.entity.mob.RavagerEntity)1 ServerWorldAccess (net.minecraft.world.ServerWorldAccess)1 StoneGolemEntity (party.lemons.biomemakeover.entity.StoneGolemEntity)1 AdjudicatorMimicEntity (party.lemons.biomemakeover.entity.adjudicator.AdjudicatorMimicEntity)1