Program: 8260
Project: 8260
Buggy source:
@Override public IMessage onMessage(final KeyPressPKT message,final MessageContext ctx){
  EntityPlayerMP player=ctx.getServerHandler().playerEntity;
  ItemStack stack=player.getHeldItem();
switch (message.key) {
case ARMOR_TOGGLE:
    if (player.isSneaking()) {
      ItemStack helm=player.inventory.armorItemInSlot(3);
      if (helm != null && helm.getItem() == ObjHandler.gemHelmet) {
        GemHelmet.toggleNightVision(helm,player);
      }
    }
 else {
      ItemStack boots=player.inventory.armorItemInSlot(0);
      if (boots != null && boots.getItem() == ObjHandler.gemFeet) {
        ((GemFeet)ObjHandler.gemFeet).toggleStepAssist(boots,player);
      }
    }
  break;
case CHARGE:
if (stack != null && stack.getItem() instanceof IItemCharge) {
  ((IItemCharge)stack.getItem()).changeCharge(player,stack);
}
 else if (stack == null || ProjectEConfig.unsafeKeyBinds) {
  if (GemArmorBase.hasAnyPiece(player)) {
    PlayerChecks.setGemState(player,!PlayerChecks.getGemState(player));
    player.addChatMessage(new ChatComponentTranslation(PlayerChecks.getGemState(player) ? "String_Node_Str" : "String_Node_Str"));
  }
}
break;
case EXTRA_FUNCTION:
if (stack != null && stack.getItem() instanceof IExtraFunction) {
((IExtraFunction)stack.getItem()).doExtraFunction(stack,player);
}
 else if (stack == null || ProjectEConfig.unsafeKeyBinds) {
if (PlayerChecks.getGemState(player) && player.inventory.armorInventory[2] != null && player.inventory.armorInventory[2].getItem() == ObjHandler.gemChest) {
((GemChest)ObjHandler.gemChest).doExplode(player);
}
}
break;
case FIRE_PROJECTILE:
if (stack != null && stack.getItem() instanceof IProjectileShooter) {
if (((IProjectileShooter)stack.getItem()).shootProjectile(player,stack)) {
PlayerHelper.swingItem((player));
}
}
 else if (stack == null || ProjectEConfig.unsafeKeyBinds) {
if (PlayerChecks.getGemState(player) && player.inventory.armorInventory[3] != null && player.inventory.armorInventory[3].getItem() == ObjHandler.gemHelmet) {
((GemHelmet)ObjHandler.gemHelmet).doZap(player);
}
}
break;
case MODE:
if (stack != null && stack.getItem() instanceof IModeChanger) {
((IModeChanger)stack.getItem()).changeMode(player,stack);
}
break;
}
return null;
}

Fixed version (ground truth):
@Override public IMessage onMessage(final KeyPressPKT message,final MessageContext ctx){
  EntityPlayerMP player=ctx.getServerHandler().playerEntity;
  ItemStack stack=player.getHeldItem();
switch (message.key) {
case ARMOR_TOGGLE:
    if (player.isSneaking()) {
      ItemStack helm=player.inventory.armorItemInSlot(3);
      if (helm != null && helm.getItem() == ObjHandler.gemHelmet) {
        GemHelmet.toggleNightVision(helm,player);
      }
    }
 else {
      ItemStack boots=player.inventory.armorItemInSlot(0);
      if (boots != null && boots.getItem() == ObjHandler.gemFeet) {
        ((GemFeet)ObjHandler.gemFeet).toggleStepAssist(boots,player);
      }
    }
  break;
case CHARGE:
if (stack != null && stack.getItem() instanceof IItemCharge) {
  ((IItemCharge)stack.getItem()).changeCharge(player,stack);
}
 else if (stack == null || ProjectEConfig.unsafeKeyBinds) {
  if (GemArmorBase.hasAnyPiece(player)) {
    PlayerChecks.setGemState(player,!PlayerChecks.getGemState(player));
    player.addChatMessage(new ChatComponentTranslation(PlayerChecks.getGemState(player) ? "String_Node_Str" : "String_Node_Str"));
  }
}
break;
case EXTRA_FUNCTION:
if (stack != null && stack.getItem() instanceof IExtraFunction) {
((IExtraFunction)stack.getItem()).doExtraFunction(stack,player);
}
 else if (stack == null || ProjectEConfig.unsafeKeyBinds) {
if (PlayerChecks.getGemState(player) && player.inventory.armorInventory[2] != null && player.inventory.armorInventory[2].getItem() == ObjHandler.gemChest) {
((GemChest)ObjHandler.gemChest).doExplode(player);
}
}
break;
case FIRE_PROJECTILE:
if (stack != null && stack.getItem() instanceof IProjectileShooter) {
if (PlayerChecks.getCooldown(player) <= 0) {
if (((IProjectileShooter)stack.getItem()).shootProjectile(player,stack)) {
PlayerHelper.swingItem((player));
}
PlayerChecks.resetCooldown(player);
}
}
 else if (stack == null || ProjectEConfig.unsafeKeyBinds) {
if (PlayerChecks.getGemState(player) && player.inventory.armorInventory[3] != null && player.inventory.armorInventory[3].getItem() == ObjHandler.gemHelmet) {
((GemHelmet)ObjHandler.gemHelmet).doZap(player);
}
}
break;
case MODE:
if (stack != null && stack.getItem() instanceof IModeChanger) {
((IModeChanger)stack.getItem()).changeMode(player,stack);
}
break;
}
return null;
}