Fake resource pack acceptance

Some server requires that players install a resource pack, and will kick
them if they doesn't. With this new feature MCC will automatically respond
"successfully loaded" for every "resource pack send" packet it receives.
Suggested by Yoann166 in issue #91
This commit is contained in:
ORelio 2015-08-21 16:54:18 +02:00
parent de4322458a
commit 86711adba8

View file

@ -197,6 +197,12 @@ namespace MinecraftClient.Protocol.Handlers
if (protocolversion >= MC18Version) if (protocolversion >= MC18Version)
compression_treshold = readNextVarInt(ref packetData); compression_treshold = readNextVarInt(ref packetData);
break; break;
case 0x48: //Resource Pack Send
string url = readNextString(ref packetData);
string hash = readNextString(ref packetData);
//Send back a "successfully loaded" response for plugins making use of resource pack mandatory
SendPacket(0x19, concatBytes(getVarInt(hash.Length), Encoding.UTF8.GetBytes(hash), getVarInt(0)));
break;
default: default:
return false; //Ignored packet return false; //Ignored packet
} }