autoVersion plugin: add hooks to allow Forge/FML to extend this plugin

This commit is contained in:
deathcap 2016-02-06 23:52:43 -08:00
parent cc73c2de24
commit dc9768eaf5

View File

@ -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');
});