Shears Duplication using Cut Spell
ssblur opened this issue ยท 5 comments
Issue description
When using Projectile > Cut on an Arcane Pedestal, Shears are placed on the pedestal.
Steps to reproduce the issue
- Create a Projectile > Cut spell.
- Stand outside block interaction range of the pedestal.
- Cast your spell.
What's the expected result?
Nothing happens
What's the actual result?
Shears are placed on the pedestal.
Notes
- On version ars_nouveau-1.16.4-1.11.6, in the Enigmatica 6 modpack version 0.4.3.
- This issue seems to be replicable with any block which accepts an item into its inventory via right click, presumably because this spell directly simulates a right click with shears.
If anything, Cut should probably work like Break when striking a block, only with shears instead of a pick as the basis tool. The "use shears" behavior only makes sense when applied to entities, unless there is some kind of block that can be snipped without breaking it I'm unaware of.
As far as I can tell, vanilla naturally clones the itemstack with its internal stack splitting methods, which is what the pedestals, and other mods use to take an item from the inventory. I don't believe there is actually a way to still maintain a reference to the item once it has been inserted into a block.
Deleting it on item tick would be a good solution for stopping the duping, but it could still unfortunately clog block inventories.
Vanilla has pumpkin. As for other mods, I have checked Mystical Agriculture and Boold Magic, their implementations are so vary from Ars Nouveau one that I don't think there is a simple way to fix duplication in all mods.
You could do a check in EntityProjectileSpell::onHit for wether the impacted block has an inventory or something similar, and if it does, you stop the spell effect from resolving its effect.
(didn't really check much of the code just the mentioned entity class, so sorry if its a stupid suggestion :D )