Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for stack size greater 1 before applying bone meal for farmer #601

Open
wants to merge 1 commit into
base: 1.20
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -154,4 +154,4 @@ class FarmerBlockEntity(tier: Tier, pos: BlockPos, state: BlockState)
else -> 1
}
}
}
}