Minecraft mc = Minecraft.getMinecraft();
EntityPlayer player = mc.thePlayer;
if (!mc.inGameHasFocus || (player == null)) return;
if (backpackOpen.isPressed() && (ItemBackpack.getBackpack(player) != null) &&
BetterStorage.globalConfig.getBoolean(GlobalConfig.enableBackpackOpen))
BetterStorage.networkChannel.sendToServer(new PacketBackpackOpen());
else if (drinkingHelmet.isPressed() && (player.getEquipmentInSlot(EquipmentSlot.HEAD) != null))
BetterStorage.networkChannel.sendToServer(new PacketDrinkingHelmetUse());
}