The bug
Pressing the Esc (escape) key when the server resource pack prompt is open does not send the packet telling the server that the player refused to download the pack to the server.
How to reproduce
- Connect to play.cubecraft.net
- Use the "Travel" compass to get to "Lucky Islands" (sponge block)
- Click "No"
→ A notification appears in chat - Repeat steps 1 and 2 and press Esc this time
→ No message appears in chat
Code analysis
Based on 1.11.2 decompiled using MCP 9.35 rc1
The GUI net.minecraft.client.network.NetHandlerPlayClient.handleResourcePack().new Runnable() {...}.run().new GuiYesNoCallback() {...}.() only sends the net.minecraft.network.play.client.CPacketResourcePackStatus.Action.DECLINED value to the server when the player clicks "No", but not when the Esc key is pressed (see method net.minecraft.client.gui.GuiScreen.keyTyped(char, int)).