From 9af6449c60813a19333cdd9eb98d6b5fa87efea6 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Mon, 23 Jan 2023 11:09:47 +0000 Subject: [PATCH] Fixed replenish --- .../ecoenchants/enchants/impl/EnchantmentReplenish.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/enchants/impl/EnchantmentReplenish.kt b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/enchants/impl/EnchantmentReplenish.kt index ebe809e2..02b6a349 100644 --- a/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/enchants/impl/EnchantmentReplenish.kt +++ b/eco-core/core-plugin/src/main/kotlin/com/willfp/ecoenchants/enchants/impl/EnchantmentReplenish.kt @@ -58,9 +58,13 @@ class EnchantmentReplenish( if (enchant.config.getBool("consume-seeds")) { val item = ItemStack( - if (type == Material.WHEAT) { - Material.WHEAT_SEEDS - } else type + when (type) { + Material.WHEAT -> Material.WHEAT_SEEDS + Material.POTATOES -> Material.POTATO + Material.CARROTS -> Material.CARROT + Material.BEETROOTS -> Material.BEETROOT_SEEDS + else -> type + } ) val hasSeeds = player.inventory.removeItem(item).isEmpty()