-
-
Notifications
You must be signed in to change notification settings - Fork 222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1.7 custom_payload 0x3f varshort for Forge compatibility #120
Conversation
This can now be moved to nmp-forge using https://github.com/PrismarineJS/node-minecraft-protocol/blob/master/examples/client_custom_packets/client_custom_packets.js (expose a customPackets in nmp-forge probably to be used along createClient probably ? maybe there should be a better way to install this but I'm not sure what) |
Hmm I can't see how I can use the |
@deathcap what about providing a require('minecraft-protocol-forge').customPackets ? |
"custom_payload": {
"id": "0x3f",
"fields": [
{
"name": "channel",
"type": "string"
},
{
"name": "data",
"type": [
"buffer",
{
"countType": "varshort"
}
]
}
]
}, in src/client/forgeHandshake (the node-minecraft-protocol "plugin"), exports this function to augment
would like to also augment it to change the custom_payload 0x3f protocol definition. By this time, the constructor for createClient() has already been called. Trying to access |
@deathcap I really don't understand what is the problem with doing this: var mc = require('minecraft-protocol');
var forgeHandshake = require('minecraft-protocol-forge').forgeHandshake;
var client = mc.createClient({
host: host,
port: port,
username: username,
password: password,
customPackets: require('minecraft-protocol-forge').customPackets
});
forgeHandshake(client, {forgeMods: [
{ modid: 'mcp', version: '9.18' },
{ modid: 'FML', version: '8.0.99.99' },
{ modid: 'Forge', version: '11.15.0.1715' },
{ modid: 'IronChest', version: '6.0.121.768' }
]); Also see https://github.com/PrismarineJS/node-minecraft-protocol/blob/master/examples/client_custom_packets/client_custom_packets.js#L8 |
(if you really want to modify the serializer after it has been created you could expose and call createProtocol (https://github.com/PrismarineJS/node-minecraft-protocol/blob/master/src/transforms/serializer.js#L19) and then change the protocol in serializer) edit: except this would be really annoying to do because there are several serializers/parsers (8) |
Oh and customPackets are merged, so for example https://github.com/PrismarineJS/node-minecraft-protocol/blob/master/examples/client_custom_packets/client_custom_packets.js#L8 adds a packet, it doesn't remove them all. |
tracked elsewhere |
Requires ProtoDef-io/node-protodef#52
http://wiki.vg/Minecraft_Forge_Handshake#Differences_from_Forge_1.7.10 "However, forge makes some more changes to the server to client packet [0x3f](but not the client to server packet [0x17]): Rather than using a short for the length, a varshort is used"
Note this is backwards-compatibile with vanilla 1.7, since short lengths would never be negative. varshorts extend short by adding an extra byte (to extend 16-bit range to 23-bit) following the negative short with MSB set. Tested on forge-1.7.10-10.13.4.1614. Would like this for PrismarineJS/node-minecraft-protocol-forge#7 (couldn't make the change there since it is a lower-level protocol change, but at least this is backwards-compatible with vanilla, so it should be safe - only extends the protocol)