ResorecePackSend: Attempt to resolve #1667

This commit is contained in:
ReinforceZwei 2021-07-08 14:22:27 +08:00
parent 029762e0a9
commit 581095e03e

View file

@ -863,14 +863,11 @@ namespace MinecraftClient.Protocol.Handlers
if (hash.Length != 40) if (hash.Length != 40)
break; break;
//Send back "accepted" and "successfully loaded" responses for plugins or server config making use of resource pack mandatory //Send back "accepted" and "successfully loaded" responses for plugins or server config making use of resource pack mandatory
if (forced) byte[] responseHeader = new byte[0];
{ if (protocolversion < MC110Version) //MC 1.10 does not include resource pack hash in responses
byte[] responseHeader = new byte[0]; responseHeader = dataTypes.ConcatBytes(dataTypes.GetVarInt(hash.Length), Encoding.UTF8.GetBytes(hash));
if (protocolversion < MC110Version) //MC 1.10 does not include resource pack hash in responses SendPacket(PacketTypesOut.ResourcePackStatus, dataTypes.ConcatBytes(responseHeader, dataTypes.GetVarInt(3))); //Accepted pack
responseHeader = dataTypes.ConcatBytes(dataTypes.GetVarInt(hash.Length), Encoding.UTF8.GetBytes(hash)); SendPacket(PacketTypesOut.ResourcePackStatus, dataTypes.ConcatBytes(responseHeader, dataTypes.GetVarInt(0))); //Successfully loaded
SendPacket(PacketTypesOut.ResourcePackStatus, dataTypes.ConcatBytes(responseHeader, dataTypes.GetVarInt(3))); //Accepted pack
SendPacket(PacketTypesOut.ResourcePackStatus, dataTypes.ConcatBytes(responseHeader, dataTypes.GetVarInt(0))); //Successfully loaded
}
break; break;
case PacketTypesIn.SpawnEntity: case PacketTypesIn.SpawnEntity:
if (handler.GetEntityHandlingEnabled()) if (handler.GetEntityHandlingEnabled())