PrismarineJS / node-minecraft-protocol

Parse and serialize minecraft packets, plus authentication and encryption.
https://prismarinejs.github.io/node-minecraft-protocol/
BSD 3-Clause "New" or "Revised" License
1.22k stars 238 forks source link

Make node-minecraft-protocol protocol agnostic #509

Open rom1504 opened 7 years ago

rom1504 commented 7 years ago

Making node-minecraft-protocol protocol agnostic has been a long standing goal of the various refactoring of node-minecraft-protocol. The extraction of node-protodef has permitted to support easily various minecraft pc version. The recent refactoring of the server into plugins make the basic server implementation even more agnostic of the various ways to use the protocols.

A goal that was mentioned several time is to make node-minecraft-protocol "disapear", ie to have data in minecraft-data (or other places) and generic modules such as node-protodef and to have no specific code in node-minecraft-protocol.

This would allow to support more protocol, such as minecraft classic, minecraft pocket edition or even other games (minetest maybe, or even non voxel)

I believe we could extract the server and client implementation, along with their plugin systems and make them completely generic (remove all the minecraft specific code), put that in a node-network, and then use that in node-minecraft-protocol.

The code currently in https://github.com/PrismarineJS/node-minecraft-protocol/tree/master/src/client and https://github.com/PrismarineJS/node-minecraft-protocol/tree/master/src/server and https://github.com/PrismarineJS/node-minecraft-protocol/tree/master/src/transforms could probably go into something like a node-minecraft-client and a node-minecraft-server which would be plugins that could be used with node-network.

node-minecraft-protocol would then just use that to keep the API stable for users.

But real users could then stop actually using node-minecraft-protocol and just use node-minecraft-client as basic plugins for node-network for mineflayer for example.

And I guess we could then have a node-minecraft-pocket-client that could replace node-minecraft-client when we want to use pocket edition.

This has been discussed a long time ago with @wtfaremyinitials and @roblabla I believe.

Also I believe node-minecraft-protocol, mineflayer and flying-squid plugin systems can be merged into one that way.

rom1504 commented 7 years ago

related #235 #376 and maybe #176

plexigras commented 7 years ago

i feel like createClient.js and createServer.js should be in spreade packages from the lowerlevel client and server implementations.

ps.: client should be even lower level as far as im concerned and all the high level stuff should be inside createClient.

rom1504 commented 7 years ago

createClient and createServer are mostly low level now, have a look. What is high level are all the plugins there https://github.com/PrismarineJS/node-minecraft-protocol/tree/master/src/client

and yes indeed client might be a little more low level

rom1504 commented 7 years ago

createClient and createServer are basically just plugin systems now.

geekytime commented 6 years ago

Any luck with this? I quickly got tired of dealing with Java and Nukkit, but I don't see any other open source server that's kept up past Minecraft 1.2.2 (Formerly Minecraft PE).

pocket-minecraft-protocol seems to have stalled at 0.14.3...

plexigras commented 6 years ago

literally the first thing in the readme is

Note: If you're looking for experimental encryption or 1.0.* support, please see the 1.0 branch

geekytime commented 6 years ago

Yup. I tried the 1.0 branch. It doesn't build because there's a github dependency that's been deleted from Github. From what I've read, there's also a fairly significant difference between 1.0 and 1.2.

roblabla commented 6 years ago

1.2 support is only waiting for a contributor to happen :D