BlackBeltPanda / Transport-Pipes

Buildcraft without mods! This is a fork of the original Transport-Pipes plugin featuring support for newer versions of Spigot, many bug fixes, performance improvements, and end-user enhancements.
https://www.spigotmc.org/resources/transport-pipes.20873/
MIT License
39 stars 10 forks source link

Add more API methods other plugins can use to manipulate item transfer behavior #10

Closed JaidenW closed 3 years ago

JaidenW commented 3 years ago

Hey, not sure if this is something you'd be interested in adding support for (or if they'd have to add support for you) but when using item pipes on AdvancedChests chests, the items just void when they enter it

This is the link the the plugin in question, though it is a paid one. i'm happy to help with testing though. AdvancedChests

BlackBeltPanda commented 3 years ago

https://github.com/BlackBeltPanda/Transport-Pipes/pull/12 partially addresses this by allowing for event cancellation, but I may add compatibility for the AdvancedChests plugin to allow items to be inserted/extracted properly.

BlackBeltPanda commented 3 years ago

Okay, I've made some API improvements that should allow other developers to have better control over item transferring.

In the case of AdvancedChests, the dev should be able to listen to the ContainerUpdateEvent, check if event.adding is true, and check if the block is an "Advanced Chest". If so, they can cancel the event and use TransportPipesAPI.registerTransportPipesContainer to register their own TransportPipesContainer which allows them to override the ExtractItem and InsertItem methods.

If there's anything missing from the API that the dev would need, please let me know. =)