diff --git a/src/client/autoVersion.js b/src/client/autoVersion.js index 4c45abc..1beef38 100644 --- a/src/client/autoVersion.js +++ b/src/client/autoVersion.js @@ -36,15 +36,13 @@ module.exports = function(client, options) { client.version = versionInfo.majorVersion; client.state = states.HANDSHAKING; - if (response.modinfo && response.modinfo.type === 'FML') { - // Use the list of Forge mods from the server ping, so client will match server - const forgeMods = response.modinfo.modList; - debug('Using forgeMods:',forgeMods); - // TODO: https://github.com/PrismarineJS/node-minecraft-protocol/issues/114 - // https://github.com/PrismarineJS/node-minecraft-protocol/pull/326 - // TODO: modify client object to set forgeMods and enable forgeHandshake - throw new Error('FML/Forge not yet supported'); + // Let other plugins such as Forge/FML (modinfo) respond to the ping response + if (client.autoVersionHooks) { + client.autoVersionHooks.forEach((hook) => { + hook(response, client, options); + }); } + // Finished configuring client object, let connection proceed client.emit('connect_allowed'); });