Comparators can't detect items being sold
Sti-jn opened this issue ยท 3 comments
Plugin Version
2.10-SNAPSHOT (build 128)
Plugin Config
Server Version
Paper version git-Paper-616 (MC: 1.13.2) (Implementing API version 1.13.2-R0.1-SNAPSHOT)
What other plugins are you running?
What is happening?
When buying an item from a chest it no longer triggers comparators. This means contraptions like this (see image below), which are often used to sell "random" items, no longer work. It seems like the fix for issue #169 broke this.
What did you expect to happen?
I expect to buy the only item in the chest which causes the comparator to send out a redstone signal allowing one new item to go into the chest and allowing one item to be dispensed from the dispenser.
Correct, but that doesn't work if you want to keep it automated. Since you can't have players open the chest or update it in any other way since that means you have to allow them to build in that area which defeats the purpose
Yeah I meant in the plugin directly, not a player manually. It's an interesting behaviour though, apparently "removing" the item from the chest by setting it's amount null does not result in the block getting updated in a way that would trigger a comparator where as before an inventory removal method was used which probably results in updates when used with a block's inventory.
Gonna have to think a bit about what would the right approach to fix this would be as just blindly sending a block update on the chest might result in other strange behaviour, but same thing could happen currently with setting the item's amount zero so I might just need to switch back some parts of the code to use the removal methods. I'll have to experiment a bit which one works best.