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);
}
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);
}
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);
}
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);
}
Aggregations