Skip to content

Fix dispenser duplication for explosives#207

Open
trevorgolden wants to merge 1 commit into
aurilisdev:1.21.1from
trevorgolden:1.21.1
Open

Fix dispenser duplication for explosives#207
trevorgolden wants to merge 1 commit into
aurilisdev:1.21.1from
trevorgolden:1.21.1

Conversation

@trevorgolden
Copy link
Copy Markdown

The dispense() method in BlockItemExplosive's DispenseItemBehavior returned the unmodified ItemStack, causing the dispenser to write it back to inventory unchanged. This allowed unlimited explosives to be dispensed from a single stack. Calling item.shrink(1) inside the success path consumes one item per dispense, matching vanilla dispenser behavior. Landmines are unaffected (already excluded from dispenser registration).

The dispense() method in BlockItemExplosive's DispenseItemBehavior
returned the unmodified ItemStack, causing the dispenser to write it
back to inventory unchanged. This allowed unlimited explosives to be
dispensed from a single stack. Calling item.shrink(1) inside the
success path consumes one item per dispense, matching vanilla
dispenser behavior. Landmines are unaffected (already excluded from
dispenser registration).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant