Program: 187482
Project: 187482
Buggy source:
@Override public void onOptionClick(IconMenu.OptionClickEvent event){
  event.setWillClose(false);
  event.setWillDestroy(false);
  IconMenu menu=event.getMenu();
switch (event.getPosition()) {
case 5:
    event.setWillClose(true);
  event.setWillDestroy(true);
return;
case 4:
if (active) {
menu.getOption(4).setMaterial(REDSTONE_BLOCK).setTitle("String_Node_Str" + RED + "String_Node_Str").setLore(RESET + "String_Node_Str" + GREEN+ "String_Node_Str");
active=false;
}
 else {
menu.getOption(4).setMaterial(EMERALD_BLOCK).setTitle("String_Node_Str" + GREEN + "String_Node_Str").setLore(RESET + "String_Node_Str" + RED+ "String_Node_Str");
active=true;
}
menu.update();
break;
case 3:
beacon.active=active;
beacon.selectedBuffs.clear();
beacon.selectedBuffs.addAll(selectedBuffs);
beacon.reciever=reciever;
event.setWillClose(true);
event.setWillDestroy(true);
break;
case 21:
if (reciever != BeaconReciever.Owner) {
menu.getOption(21).setMeta(ownerMeta,false,false);
if (menu.getOption(22) != null) {
menu.getOption(22).setMeta(partyMeta);
}
menu.getOption(23).setMeta(disabledMeta);
reciever=BeaconReciever.Owner;
menu.update();
}
break;
case 22:
if (reciever != BeaconReciever.Party) {
menu.getOption(21).setMeta(disabledMeta);
menu.getOption(22).setMeta(partyMeta);
menu.getOption(23).setMeta(disabledMeta);
reciever=BeaconReciever.Party;
menu.update();
}
break;
case 23:
if (reciever != BeaconReciever.Everyone) {
menu.getOption(21).setMeta(disabledMeta);
if (menu.getOption(22) != null) {
menu.getOption(22).setMeta(disabledMeta);
}
menu.getOption(23).setMeta(everyoneMeta);
reciever=BeaconReciever.Everyone;
menu.update();
}
break;
default :
if (buffPositionItems.containsKey(event.getPosition())) {
int selectedBuff=buffPositionItems.get(event.getPosition());
if (selectableBuffs > 1) {
if (selectedBuffs.indexOf(selectedBuff) != -1) {
selectedBuffs.remove(selectedBuffs.indexOf(selectedBuff));
menu.getOption(buffItemPositions.get(selectedBuff)).setGlowing(false);
menu.update();
}
 else if (selectableBuffs > selectedBuffs.size()) {
selectedBuffs.add(selectedBuff);
menu.getOption(buffItemPositions.get(selectedBuff)).setGlowing(true);
menu.update();
}
 else {
break;
}
if (selectableBuffs > selectedBuffs.size()) {
menu.setOption(13,new IconMenuItem().setMaterial(POTION).setTitle(BLUE + Util.formatText(Translation.getString("String_Node_Str",myPet.getOwner().getLanguage()),selectableBuffs - selectedBuffs.size())).setAmount(selectableBuffs - selectedBuffs.size()));
}
 else {
menu.setOption(13,new IconMenuItem().setMaterial(GLASS_BOTTLE).setTitle(GRAY + Util.formatText(Translation.getString("String_Node_Str",myPet.getOwner().getLanguage()),0)));
}
}
 else {
if (!selectedBuffs.contains(selectedBuff)) {
if (selectedBuffs.size() != 0 && menu.getOption(buffItemPositions.get(selectedBuff)) != null) {
menu.getOption(buffItemPositions.get(selectedBuffs.get(0))).setGlowing(false);
selectedBuffs.clear();
}
selectedBuffs.add(selectedBuff);
menu.getOption(buffItemPositions.get(selectedBuff)).setGlowing(true);
menu.update();
}
}
}
}
}

Fixed version (ground truth):
@Override public void onOptionClick(IconMenu.OptionClickEvent event){
  event.setWillClose(false);
  event.setWillDestroy(false);
  IconMenu menu=event.getMenu();
switch (event.getPosition()) {
case 5:
    event.setWillClose(true);
  event.setWillDestroy(true);
return;
case 4:
if (active) {
menu.getOption(4).setMaterial(REDSTONE_BLOCK).setTitle(Util.formatText(Translation.getString("String_Node_Str",myPet.getOwner().getLanguage()),RED + Translation.getString("String_Node_Str",myPet.getOwner().getLanguage()))).setLore(RESET + Translation.getString("String_Node_Str",myPet.getOwner().getLanguage()));
active=false;
}
 else {
menu.getOption(4).setMaterial(EMERALD_BLOCK).setTitle(Util.formatText(Translation.getString("String_Node_Str",myPet.getOwner().getLanguage()),GREEN + Translation.getString("String_Node_Str",myPet.getOwner().getLanguage()))).setLore(RESET + Translation.getString("String_Node_Str",myPet.getOwner().getLanguage()));
active=true;
}
menu.update();
break;
case 3:
beacon.active=active;
beacon.selectedBuffs.clear();
beacon.selectedBuffs.addAll(selectedBuffs);
beacon.reciever=reciever;
event.setWillClose(true);
event.setWillDestroy(true);
break;
case 21:
if (reciever != BeaconReciever.Owner) {
menu.getOption(21).setMeta(ownerMeta,false,false);
if (menu.getOption(22) != null) {
menu.getOption(22).setMeta(partyMeta);
}
menu.getOption(23).setMeta(disabledMeta);
reciever=BeaconReciever.Owner;
menu.update();
}
break;
case 22:
if (reciever != BeaconReciever.Party) {
menu.getOption(21).setMeta(disabledMeta);
menu.getOption(22).setMeta(partyMeta);
menu.getOption(23).setMeta(disabledMeta);
reciever=BeaconReciever.Party;
menu.update();
}
break;
case 23:
if (reciever != BeaconReciever.Everyone) {
menu.getOption(21).setMeta(disabledMeta);
if (menu.getOption(22) != null) {
menu.getOption(22).setMeta(disabledMeta);
}
menu.getOption(23).setMeta(everyoneMeta);
reciever=BeaconReciever.Everyone;
menu.update();
}
break;
default :
if (buffPositionItems.containsKey(event.getPosition())) {
int selectedBuff=buffPositionItems.get(event.getPosition());
if (selectableBuffs > 1) {
if (selectedBuffs.indexOf(selectedBuff) != -1) {
selectedBuffs.remove(selectedBuffs.indexOf(selectedBuff));
menu.getOption(buffItemPositions.get(selectedBuff)).setGlowing(false);
menu.update();
}
 else if (selectableBuffs > selectedBuffs.size()) {
selectedBuffs.add(selectedBuff);
menu.getOption(buffItemPositions.get(selectedBuff)).setGlowing(true);
menu.update();
}
 else {
break;
}
if (selectableBuffs > selectedBuffs.size()) {
menu.setOption(13,new IconMenuItem().setMaterial(POTION).setTitle(BLUE + Util.formatText(Translation.getString("String_Node_Str",myPet.getOwner().getLanguage()),selectableBuffs - selectedBuffs.size())).setAmount(selectableBuffs - selectedBuffs.size()));
}
 else {
menu.setOption(13,new IconMenuItem().setMaterial(GLASS_BOTTLE).setTitle(GRAY + Util.formatText(Translation.getString("String_Node_Str",myPet.getOwner().getLanguage()),0)));
}
}
 else {
if (!selectedBuffs.contains(selectedBuff)) {
if (selectedBuffs.size() != 0 && menu.getOption(buffItemPositions.get(selectedBuff)) != null) {
menu.getOption(buffItemPositions.get(selectedBuffs.get(0))).setGlowing(false);
selectedBuffs.clear();
}
selectedBuffs.add(selectedBuff);
menu.getOption(buffItemPositions.get(selectedBuff)).setGlowing(true);
menu.update();
}
}
}
}
}