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.23k stars 239 forks source link

Forge Support #114

Closed roblabla closed 8 years ago

roblabla commented 9 years ago

It has recently been suggested in the gitter that support for the forge protocol would be interesting. BungeeCord supports Forge servers and clients now, so it could be used as a reference.

mrfrase3 commented 9 years ago

Before I start, I should mention that I have been actively running large public forge servers since tekkit first came out, and have been a fairly silent member of this community for years now. My two cents on this topic:

Anyway, just thought I might weigh in, I'll keep tabs and lemme know if you need anything ;)

Corgano commented 9 years ago

Just wanted to note, from what I have seen on server lists most the community is on 1.7 or later. This site has various statistics: http://www.gametracker.com/games/minecraft/ . I would count on forge support for anything before 1.7 IMHO

roblabla commented 9 years ago

node-forge-protocol will be implemented in its own module, in the following form :

module.exports = function injectForge(mc) {
  if (mc == null)
    mc = require('node-minecraft-protocol');
  if (mc.protocol.version == '1.7')
    return injectForge1_7(mc);
  else if (mc.protocol.version == '1.6')
    return injectForge1_6(mc);
  else
    return null;
}

This should avoid the problem of protocol support somewhat.

As for how horrible forge's protocol hack is, that's not a problem. I'm quite used to reading decompiled minecraft source by now :smile:.

The biggest problem you mention here is the mods reserving their own protocol packets (which is stupid, since they should be using custom_payload packet). However, that doesn't really matter, since I believe node-minecraft-protocol ignores unknown packets (this is actually an undefined behavior that's a side-effect of an optimization I made. Heh. Should standardize this). So unless the mod involved does really weird stuff with the protocol, we should be alright.

Furthermore, those packets which have added info can be supported by injecting their own packets through the same way I'll inject forge's packet. Though again, if mods do this, they're doing it wrong.

overjt commented 8 years ago

Any news about this?

roblabla commented 8 years ago

Not really. Attention has gone elsewhere (mainly supporting multiple protocol versions, and right now we're migrating the binary parser to its own repo, ProtoDef). It's still in my personal todo though.

rom1504 commented 8 years ago

related http://wiki.vg/User:Pokechu22/Forge

overjt commented 8 years ago

related https://gist.github.com/overjt/39010b23a2fa5e29113c

deathcap commented 8 years ago

Updated documentation: http://wiki.vg/Minecraft_Forge_Handshake

deathcap commented 8 years ago

Forge support working in https://github.com/PrismarineJS/node-minecraft-protocol/pull/326 [WIP] Forge client, but I'm only doing the client-side for now, so I'd suggest still keeping this issue open for server-side Forge support

rom1504 commented 8 years ago

Client support is in https://github.com/PrismarineJS/node-minecraft-protocol-forge Missing for this issue : server support.

I think https://github.com/PrismarineJS/node-minecraft-protocol-forge should be added in a plugins section in the readme, along with an explanation into how to create plugins like https://github.com/PrismarineJS/mineflayer#third-party-plugins and https://github.com/PrismarineJS/mineflayer/blob/master/doc/contribute.md#creating-a-third-party-plugin

deathcap commented 8 years ago

https://github.com/PrismarineJS/node-minecraft-protocol#third-party-plugins is listed in the readme, https://www.npmjs.com/package/minecraft-protocol-forge now published. I think this issue can now be closed, future issues tracked in the nmp-f repository. Opened one for server-side Forge support: https://github.com/PrismarineJS/node-minecraft-protocol-forge/issues/6

rom1504 commented 8 years ago

Alright, let's close it :)