Skip to content

Commit

Permalink
Disarming: Added null check for armour item.
Browse files Browse the repository at this point in the history
  • Loading branch information
SugarCaney committed Mar 21, 2022
1 parent d747455 commit c2ebadc
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ open class DisarmingBow(plugin: DirtyArrows) : BowAbility(

// Chance to drop armour.
val newArmour = target.equipment.armorContents.map { item ->
if (item.type != Material.AIR && Random.nextDouble() <= dropArmourChance) {
if (item != null && item.type != Material.AIR && Random.nextDouble() <= dropArmourChance) {
target.world.dropItem(target.location, item)
item.type = Material.AIR
}
Expand Down

0 comments on commit c2ebadc

Please sign in to comment.