Slimefun4
Slimefun4 copied to clipboard
Add MultiBlockCraftEvent
Description
This allows addons to listen for MultiBlockMachine crafts and cancel them if wanted. It's mainly for my advancements addon, but it can definitely be useful in other addons as well.
Proposed changes
Create MultiBlockCraftEvent, which fires whenever a player crafts an item using a multiblock machine. Call the event whenever a MultiBlockMachine crafts, and cancel the craft if needed.
Related Issues (if applicable)
N/A
Checklist
- [x] I have fully tested the proposed changes and promise that they will not break everything into chaos.
- [ ] I have also tested the proposed changes in combination with various popular addons and can confirm my changes do not break them.
- [x] I followed the existing code standards and didn't mess up the formatting.
- [x] I did my best to add documentation to any public classes or methods I added.
- [x] I have added
Nonnull
andNullable
annotations to my methods to indicate their behaviour for null values - [ ] I added sufficient Unit Tests to cover my code.
now this is useful for other addons
If #3269 get's merged then this PR will have to get updated so I'm going to wait for that 👍
why is that? is it just a merge conflict or something, i don't see how adding new recipes to existing multiblocks would affect this
If #3269 get's merged then this PR will have to get updated so I'm going to wait for that 👍
why is that? is it just a merge conflict or something, i don't see how adding new recipes to existing multiblocks would affect this
The logic you use when calling the event. If the PR in question gets merged there A. Will be merge conflicts but B. The input materials are stored in a set and are not guaranteed to be one or the other so you will have to change the logic you use. Like that ternary operation wouldn't be accurate.
Final thing is can we add inputs to this aswell? Instead of just output
Is this still being worked on. Would be a nice event to have. Added label stale
we should close this
Closed in favor of #3928