From d20b03f4c51cc8ccb849304fd8bfde7c0d6a4b93 Mon Sep 17 00:00:00 2001 From: shg <43142906-xenshreyas@users.noreply.gitlab.com> Date: Thu, 8 Oct 2026 00:42:25 +0000 Subject: [PATCH] Fix Medicinal Leek not being edible Closes #1492 --- CHANGELOG.md | 1 + .../com/cobblemon/mod/common/item/MedicinalLeekItem.kt | 10 +++------- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0100f965f7..dc6896e3bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ - Burmy changes its cloak after a battle it took part in, based on the biome: Trash Cloak in the Deep Dark, Nether and End, Plant Cloak in lush biomes such as forests, jungles, plains and swamps, and Sandy Cloak in sandy biomes, beaches and caves. ### Fixes +- Medicinal Leeks can now be eaten when they aren't being planted, matching their food properties. - Fixed #updateMovesOnFormChange not properly initializing a form-swapped Pokemon's non-form_change moves. ### TEST ### Pokémon Added diff --git a/common/src/main/kotlin/com/cobblemon/mod/common/item/MedicinalLeekItem.kt b/common/src/main/kotlin/com/cobblemon/mod/common/item/MedicinalLeekItem.kt index 88e303111c..6dc5d5cd6b 100644 --- a/common/src/main/kotlin/com/cobblemon/mod/common/item/MedicinalLeekItem.kt +++ b/common/src/main/kotlin/com/cobblemon/mod/common/item/MedicinalLeekItem.kt @@ -35,14 +35,10 @@ class MedicinalLeekItem(block: MedicinalLeekBlock, settings: Properties) : ItemN val blockHitResult2 = blockHitResult.withPosition(blockHitResult.blockPos.above()) val placeResult = this.place(BlockPlaceContext(UseOnContext(user, hand, blockHitResult2))) val stack = user.getItemInHand(hand) - // This will always be true but just in case we change it down the line. - /* - if (!placeResult.isAccepted && this.isFood && user.canConsume(this.foodComponent?.isAlwaysEdible == true)) { - user.setCurrentHand(hand) - return TypedInteractionResult.consume(stack) + // If the leek couldn't be planted, fall back to the default item behaviour so its food component lets it be eaten + if (!placeResult.consumesAction()) { + return super.use(world, user, hand) } - - */ return InteractionResultHolder(placeResult, stack) }