From 97e58d8ca2d7158612b343d6733f31ddd2cf304a Mon Sep 17 00:00:00 2001 From: TrojanerHD Date: Thu, 1 Aug 2024 19:13:28 +0200 Subject: [PATCH] Check for stack size greater 1 before applying bone meal for farmer --- .../me/steven/indrev/blockentities/farms/FarmerBlockEntity.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/me/steven/indrev/blockentities/farms/FarmerBlockEntity.kt b/src/main/kotlin/me/steven/indrev/blockentities/farms/FarmerBlockEntity.kt index 6ec2778e1..fc3a62351 100644 --- a/src/main/kotlin/me/steven/indrev/blockentities/farms/FarmerBlockEntity.kt +++ b/src/main/kotlin/me/steven/indrev/blockentities/farms/FarmerBlockEntity.kt @@ -76,7 +76,7 @@ class FarmerBlockEntity(tier: Tier, pos: BlockPos, state: BlockState) val item = stack.item val isCropBlock = block is CropBlock || block is StemBlock || block is SweetBerryBushBlock || block is CocoaBlock || block is NetherWartBlock when { - item is BoneMealItem && isCropBlock && (block as? Fertilizable)?.isFertilizable(world, pos, state, false) == true && block.canGrow(world, world.random, pos, state) -> { + item is BoneMealItem && isCropBlock && (block as? Fertilizable)?.isFertilizable(world, pos, state, false) == true && block.canGrow(world, world.random, pos, state) && stack.count > 1 -> { stack.decrement(1) block.grow(world, world.random, pos, state) world.syncWorldEvent(2005, pos, 0) @@ -154,4 +154,4 @@ class FarmerBlockEntity(tier: Tier, pos: BlockPos, state: BlockState) else -> 1 } } -} \ No newline at end of file +}