Fixed an issue with spawning bosses in water on 1.8

This commit is contained in:
Brianna 2019-10-22 11:51:01 -04:00
parent 10b37f8867
commit 2f64dc55af
1 changed files with 9 additions and 3 deletions

View File

@ -53,8 +53,6 @@ public class BossSpawnListener implements Listener {
Action action = event.getAction();
if (!event.hasItem()) return;
if (action != Action.RIGHT_CLICK_BLOCK) return;
if (block.getType() == Material.AIR) return;
Map<BossEntity, ItemStack> entitiesAndSpawnItems = this.bossEntityManager.getMapOfEntitiesAndSpawnItems();
ItemStack itemStack = player.getItemInHand();
@ -67,7 +65,15 @@ public class BossSpawnListener implements Listener {
}
}
if (bossEntity == null) return;
if (bossEntity == null)
return;
else {
if (action != Action.RIGHT_CLICK_BLOCK
|| block.getType() == Material.AIR) {
event.setCancelled(true);
return;
}
}
if (bossEntity.isEditing()) {
Message.Boss_Edit_CannotSpawn.msg(player);