Program: 187503
Project: 187503
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=selectedBuffs;
beacon.reciever=reciever;
event.setWillClose(true);
event.setWillDestroy(true);
break;
case 21:
if (reciever != BeaconReciever.Owner) {
menu.getOption(21).setGlowing(true);
if (menu.getOption(22) != null) {
menu.getOption(22).setGlowing(false);
}
menu.getOption(23).setGlowing(false);
reciever=BeaconReciever.Owner;
menu.update();
}
break;
case 22:
if (reciever != BeaconReciever.Party) {
menu.getOption(21).setGlowing(false);
menu.getOption(22).setGlowing(true);
menu.getOption(23).setGlowing(false);
reciever=BeaconReciever.Party;
menu.update();
}
break;
case 23:
if (reciever != BeaconReciever.Everyone) {
menu.getOption(21).setGlowing(false);
if (menu.getOption(22) != null) {
menu.getOption(22).setGlowing(false);
}
menu.getOption(23).setGlowing(true);
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(Locales.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(Locales.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("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).setGlowing(true);
if (menu.getOption(22) != null) {
menu.getOption(22).setGlowing(false);
}
menu.getOption(23).setGlowing(false);
reciever=BeaconReciever.Owner;
menu.update();
}
break;
case 22:
if (reciever != BeaconReciever.Party) {
menu.getOption(21).setGlowing(false);
menu.getOption(22).setGlowing(true);
menu.getOption(23).setGlowing(false);
reciever=BeaconReciever.Party;
menu.update();
}
break;
case 23:
if (reciever != BeaconReciever.Everyone) {
menu.getOption(21).setGlowing(false);
if (menu.getOption(22) != null) {
menu.getOption(22).setGlowing(false);
}
menu.getOption(23).setGlowing(true);
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(Locales.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(Locales.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();
}
}
}
}
}