-
-
Notifications
You must be signed in to change notification settings - Fork 961
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider extracting network plugins in mineflayer-* kind of modules #1151
Comments
It could also make sense to instead of having flying-squid-* and mineflayer-* , to instead have pnetwork-* (or another better name) that would handle both client and server side of interaction. It could make sense as for example pnetwork-physics would use prismarine-physics both for client and server interaction |
One benefit of this is that such a pnetwork-physics module (or prismarine-windows) could be 99% feature complete and stable much more easily. |
idea of thing to try here: extract all the windows handling in a prismarine-network-windows . Will have features to handle windows in a minecraft context for both a client and a server. Will talk with a pworld for the state (or a proxy over pworld exposing only windows) |
In Prismarine-Design there was a discussion above implementing a higher-level API on top of Minecraft-Protocol. It might be useful to build Prismarine-Network-Windows directly on top of that. It would nicely allow for a clean API for window implementation without relying on anything from Mineflayer or other modules. It would make it pretty easy to plugin into MC-Protocol alone if you need to do something like connecting to a server that uses an inventory hub without needing all of Mineflayer if the bot doesn't need to do anything. |
I agree in theory |
That sounds like a good approach to me. |
For example there would be a mineflayer-windows and a mineflayer-physics.
These things would get packets and do actions on a prismarine-world.
Benefit of extracting them out may be to make it easier to use them in a https://github.com/PrismarineJS/prismarine-proxy
However this is a bit dangerous and risk creating friction, so it should be done very carefully, and making sure not to introduce high coupling between independent packages
This issue is meant to keep the idea around, but we are not ready to implement this right now.
#1145 may help on this
The end state of this would make mineflayer just a set of mineflayer-* all acting on prismarine-*, it would contain almost no line of code and anyone could make his own version based on node-minecraft-protocol easily
The main thing mineflayer repo would provide is the brand and the organization / examples / central point for documentation.
(in a similar way there would be flying-squid-*)
As said this idea is to be thought about properly before trying it, for example one thing we don't want would be to create one package for each of the current mineflayer plugin. It wouldn't work because :
So among the things to do to make this kind of refactoring possible we need to :
It is not obvious that the second step is possible.
The text was updated successfully, but these errors were encountered: