From 628448dca347cf007025ed86025364331ac44391 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Sat, 28 Aug 2021 19:48:28 +0100 Subject: [PATCH] i am going to die here --- .../willfp/ecoskills/effects/effects/EffectSpelunking.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectSpelunking.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectSpelunking.kt index 344f9f8..79f8f98 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectSpelunking.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoskills/effects/effects/EffectSpelunking.kt @@ -78,9 +78,11 @@ class EffectSpelunking : Effect( val dropEvent = BlockDropItemEvent(block, block.state, player, event.items.map { item -> val stack = item.itemStack stack.amount = stack.amount * amount - if (stack.type == Material.AIR) return@map null + if (stack.type == Material.AIR || stack.amount <= 0) { + return@map null + } item.itemStack = stack - if(stack.type == Material.AIR) null else item + item }.filter { Objects.nonNull(it) }.toMutableList()) noRepeat.add(dropEvent)