From 119a6cbb349d88bc63db69127434eaaa5e8674bd Mon Sep 17 00:00:00 2001 From: Insane96 Date: Tue, 22 Dec 2020 21:21:08 +0100 Subject: [PATCH] Fixed a bug where more crystals would spawn too low --- .../progressivebosses/events/entities/Dragon.java | 6 ++++-- .../progressivebosses/events/entities/Wither.java | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/insane96mcp/progressivebosses/events/entities/Dragon.java b/src/main/java/insane96mcp/progressivebosses/events/entities/Dragon.java index 3c8df6e5..c0fd8c79 100644 --- a/src/main/java/insane96mcp/progressivebosses/events/entities/Dragon.java +++ b/src/main/java/insane96mcp/progressivebosses/events/entities/Dragon.java @@ -186,16 +186,18 @@ private static void moreCrystals(EnderDragonEntity dragon, float killedCount) { for (EnderCrystalEntity crystal : crystals) { BlockPos crystalPos = new BlockPos(crystal.getPosX(), crystal.getPosY() - 16, crystal.getPosZ()); + if (crystalPos.getY() < centerPodium.getY()) + crystalPos = new BlockPos(crystalPos.getX(), centerPodium.getY(), crystalPos.getZ()); Stream blocks = BlockPos.getAllInBox(crystalPos.add(-1, -1, -1), crystalPos.add(1, 1, 1)); blocks.forEach(pos -> dragon.world.setBlockState(pos, Blocks.AIR.getDefaultState())); - dragon.world.setBlockState(crystalPos.add(0, -1, 0), Blocks.OBSIDIAN.getDefaultState()); + dragon.world.setBlockState(crystalPos.add(0, -1, 0), Blocks.BEDROCK.getDefaultState()); dragon.world.createExplosion(dragon, crystalPos.getX() + .5f, crystalPos.getY(), crystalPos.getZ() + .5, 5f, Explosion.Mode.DESTROY); EnderCrystalEntity newCrystal = new EnderCrystalEntity(dragon.world, crystalPos.getX() + .5, crystalPos.getY(), crystalPos.getZ() + .5); - newCrystal.setShowBottom(false); + //newCrystal.setShowBottom(false); dragon.world.addEntity(newCrystal); crystalSpawned++; diff --git a/src/main/java/insane96mcp/progressivebosses/events/entities/Wither.java b/src/main/java/insane96mcp/progressivebosses/events/entities/Wither.java index 839d28d0..4e3260a9 100644 --- a/src/main/java/insane96mcp/progressivebosses/events/entities/Wither.java +++ b/src/main/java/insane96mcp/progressivebosses/events/entities/Wither.java @@ -361,7 +361,7 @@ private static void spawnSkeletons(WitherEntity wither, World world) { } } - private static final Predicate NOT_UNDEAD = livingEntity -> livingEntity instanceof LivingEntity && livingEntity.getCreatureAttribute() != CreatureAttribute.UNDEAD && livingEntity.attackable(); + private static final Predicate NOT_UNDEAD = livingEntity -> livingEntity != null && livingEntity.getCreatureAttribute() != CreatureAttribute.UNDEAD && livingEntity.attackable(); /* * Check if the mob has space to spawn and if sits on solid ground