mindcraft
mindcraft copied to clipboard
Dynamic Minecraft version / host port
Added functionality such that if in settings.js:
- If "port" is -1, the Minecraft LAN ports are scanned on the host for a LAN server.
- If "minecraft_version" is set to "auto", it'll use the server version for mcdata and joining.
Changes:
- Added
mcserver.js, responsible for new server-related functionality. (Retrieving a valid server, pinging, and error handling.) mcdata.jsnow exports a class with mc-related functionality.- Host, port, and version are now passed to agent processes and now used instead of
settings.jsduring bot init. - Added better error handling for server/version issues:
- Server not found.
- Server is using an unsupported Minecraft version. (Then lists compatible versions from minecraft-protocol.)
- Server doesn't use expected Minecraft version.
@Nimikita I am now getting to this PR. If you update with main I will review.
I know it has been a while, but if you would like to migrate this PR to Mindcraft-CE, I would be happy to merge this PR! https://github.com/mindcraft-ce/mindcraft-ce