Program: 187504
Project: 187504
Buggy source:
public boolean activate(){
  Player owner=myPet.getOwner().getPlayer();
  final Beacon beacon=this;
  IconMenu menu=new IconMenu(Util.cutString("String_Node_Str" + myPet.getPetName(),32),27,new IconMenu.OptionClickEventHandler(){
    List<Integer> selectedBuffs=beacon.selectedBuffs;
    boolean active=beacon.active;
    private BeaconReciever reciever=beacon.reciever;
    @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();
}
}
}
}
}
}
,MyPetPlugin.getPlugin());
if (beacon.active) {
menu.setOption(4,new IconMenuItem().setMaterial(EMERALD_BLOCK).setTitle(Util.formatText(Locales.getString("String_Node_Str",myPet.getOwner().getLanguage()),GREEN + Locales.getString("String_Node_Str",myPet.getOwner().getLanguage()))).addLoreLine(RESET + Locales.getString("String_Node_Str",myPet.getOwner().getLanguage())));
}
 else {
menu.setOption(4,new IconMenuItem().setMaterial(REDSTONE_BLOCK).setTitle(Util.formatText(Locales.getString("String_Node_Str",myPet.getOwner().getLanguage()),RED + Locales.getString("String_Node_Str",myPet.getOwner().getLanguage()))).addLoreLine(RESET + Locales.getString("String_Node_Str",myPet.getOwner().getLanguage())));
}
menu.setOption(3,new IconMenuItem().setMaterial(STAINED_GLASS_PANE).setData(5).setTitle(GREEN + Locales.getString("String_Node_Str",myPet.getOwner().getLanguage())));
menu.setOption(5,new IconMenuItem().setMaterial(STAINED_GLASS_PANE).setData(14).setTitle(RED + Locales.getString("String_Node_Str",myPet.getOwner().getLanguage())));
menu.setOption(21,new IconMenuItem().setMaterial(SKULL_ITEM).setData(3).setTitle(GOLD + Locales.getString("String_Node_Str",myPet.getOwner().getLanguage())).setGlowing(reciever == BeaconReciever.Owner));
if (PARTY_SUPPORT && PartyManager.isInParty(getMyPet().getOwner().getPlayer())) {
menu.setOption(22,new IconMenuItem().setMaterial(SKULL_ITEM).setData(1).setTitle(GOLD + Locales.getString("String_Node_Str",myPet.getOwner().getLanguage())).setGlowing(reciever == BeaconReciever.Party));
}
menu.setOption(23,new IconMenuItem().setMaterial(SKULL_ITEM).setData(2).setTitle(GOLD + Locales.getString("String_Node_Str",myPet.getOwner().getLanguage())).setGlowing(reciever == BeaconReciever.Everyone));
if (buffLevel.get(1) > 0) {
menu.setOption(0,new IconMenuItem().setMaterial(LEATHER_BOOTS).setAmount(buffLevel.get(1)).setTitle(GOLD + Locales.getString("String_Node_Str" + buffNames.get(1),myPet.getOwner().getLanguage()) + GRAY+ "String_Node_Str"+ Util.decimal2roman(buffLevel.get(1))));
}
if (buffLevel.get(3) > 0) {
menu.setOption(9,new IconMenuItem().setMaterial(GOLD_PICKAXE).setAmount(buffLevel.get(3)).setTitle(GOLD + Locales.getString("String_Node_Str" + buffNames.get(3),myPet.getOwner().getLanguage()) + GRAY+ "String_Node_Str"+ Util.decimal2roman(buffLevel.get(3))));
}
if (buffLevel.get(5) > 0) {
menu.setOption(18,new IconMenuItem().setMaterial(DIAMOND_SWORD).setAmount(buffLevel.get(5)).setTitle(GOLD + Locales.getString("String_Node_Str" + buffNames.get(5),myPet.getOwner().getLanguage()) + GRAY+ "String_Node_Str"+ Util.decimal2roman(buffLevel.get(5))));
}
if (buffLevel.get(8) > 0) {
menu.setOption(1,new IconMenuItem().setMaterial(FIREWORK).setAmount(buffLevel.get(8)).setTitle(GOLD + Locales.getString("String_Node_Str" + buffNames.get(8),myPet.getOwner().getLanguage()) + GRAY+ "String_Node_Str"+ Util.decimal2roman(buffLevel.get(8))));
}
if (buffLevel.get(10) > 0) {
menu.setOption(10,new IconMenuItem().setMaterial(APPLE).setAmount(buffLevel.get(10)).setTitle(GOLD + Locales.getString("String_Node_Str" + buffNames.get(10),myPet.getOwner().getLanguage()) + GRAY+ "String_Node_Str"+ Util.decimal2roman(buffLevel.get(10))));
}
if (buffLevel.get(11) > 0) {
menu.setOption(19,new IconMenuItem().setMaterial(DIAMOND_CHESTPLATE).setAmount(buffLevel.get(11)).setTitle(GOLD + Locales.getString("String_Node_Str" + buffNames.get(11),myPet.getOwner().getLanguage()) + GRAY+ "String_Node_Str"+ Util.decimal2roman(buffLevel.get(11))));
}
if (buffLevel.get(12) > 0) {
menu.setOption(7,new IconMenuItem().setMaterial(LAVA_BUCKET).setAmount(buffLevel.get(12)).setTitle(GOLD + Locales.getString("String_Node_Str" + buffNames.get(12),myPet.getOwner().getLanguage()) + GRAY+ "String_Node_Str"+ Util.decimal2roman(buffLevel.get(12))));
}
if (buffLevel.get(13) > 0) {
menu.setOption(16,new IconMenuItem().setMaterial(RAW_FISH).setAmount(buffLevel.get(13)).setTitle(GOLD + Locales.getString("String_Node_Str" + buffNames.get(13),myPet.getOwner().getLanguage()) + GRAY+ "String_Node_Str"+ Util.decimal2roman(buffLevel.get(13))));
}
if (buffLevel.get(14) > 0) {
menu.setOption(25,new IconMenuItem().setMaterial(EYE_OF_ENDER).setAmount(buffLevel.get(14)).setTitle(GOLD + Locales.getString("String_Node_Str" + buffNames.get(14),myPet.getOwner().getLanguage()) + GRAY+ "String_Node_Str"+ Util.decimal2roman(buffLevel.get(14))));
}
if (buffLevel.get(16) > 0) {
menu.setOption(8,new IconMenuItem().setMaterial(TORCH).setAmount(buffLevel.get(16)).setTitle(GOLD + Locales.getString("String_Node_Str" + buffNames.get(16),myPet.getOwner().getLanguage()) + GRAY+ "String_Node_Str"+ Util.decimal2roman(buffLevel.get(16))));
}
if (buffLevel.get(21) > 0) {
menu.setOption(17,new IconMenuItem().setMaterial(GOLDEN_APPLE).setAmount(buffLevel.get(21)).setTitle(GOLD + Locales.getString("String_Node_Str" + buffNames.get(21),myPet.getOwner().getLanguage()) + GRAY+ "String_Node_Str"+ Util.decimal2roman(buffLevel.get(21))));
}
if (buffLevel.get(22) > 0) {
menu.setOption(26,new IconMenuItem().setMaterial(SPONGE).setAmount(buffLevel.get(22)).setTitle(GOLD + Locales.getString("String_Node_Str" + buffNames.get(22),myPet.getOwner().getLanguage()) + GRAY+ "String_Node_Str"+ Util.decimal2roman(buffLevel.get(22))));
}
for (int buff : selectedBuffs) {
if (buffLevel.get(buff) > 0) {
menu.getOption(buffItemPositions.get(buff)).setGlowing(true);
}
 else {
selectedBuffs.remove(buff);
}
}
if (selectableBuffs > 1) {
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)));
}
}
menu.open(owner);
return true;
}

Fixed version (ground truth):
public boolean activate(){
  Player owner=myPet.getOwner().getPlayer();
  final Beacon beacon=this;
  IconMenu menu=new IconMenu(Util.cutString("String_Node_Str" + myPet.getPetName(),32),27,new IconMenu.OptionClickEventHandler(){
    List<Integer> selectedBuffs=new ArrayList<Integer>(beacon.selectedBuffs);
    boolean active=beacon.active;
    private BeaconReciever reciever=beacon.reciever;
    @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();
}
}
}
}
}
}
,MyPetPlugin.getPlugin());
if (beacon.active) {
menu.setOption(4,new IconMenuItem().setMaterial(EMERALD_BLOCK).setTitle(Util.formatText(Locales.getString("String_Node_Str",myPet.getOwner().getLanguage()),GREEN + Locales.getString("String_Node_Str",myPet.getOwner().getLanguage()))).addLoreLine(RESET + Locales.getString("String_Node_Str",myPet.getOwner().getLanguage())));
}
 else {
menu.setOption(4,new IconMenuItem().setMaterial(REDSTONE_BLOCK).setTitle(Util.formatText(Locales.getString("String_Node_Str",myPet.getOwner().getLanguage()),RED + Locales.getString("String_Node_Str",myPet.getOwner().getLanguage()))).addLoreLine(RESET + Locales.getString("String_Node_Str",myPet.getOwner().getLanguage())));
}
menu.setOption(3,new IconMenuItem().setMaterial(STAINED_GLASS_PANE).setData(5).setTitle(GREEN + Locales.getString("String_Node_Str",myPet.getOwner().getLanguage())));
menu.setOption(5,new IconMenuItem().setMaterial(STAINED_GLASS_PANE).setData(14).setTitle(RED + Locales.getString("String_Node_Str",myPet.getOwner().getLanguage())));
menu.setOption(21,new IconMenuItem().setMaterial(SKULL_ITEM).setData(3).setTitle(GOLD + Locales.getString("String_Node_Str",myPet.getOwner().getLanguage())).setGlowing(reciever == BeaconReciever.Owner));
if (PARTY_SUPPORT && PartyManager.isInParty(getMyPet().getOwner().getPlayer())) {
menu.setOption(22,new IconMenuItem().setMaterial(SKULL_ITEM).setData(1).setTitle(GOLD + Locales.getString("String_Node_Str",myPet.getOwner().getLanguage())).setGlowing(reciever == BeaconReciever.Party));
}
menu.setOption(23,new IconMenuItem().setMaterial(SKULL_ITEM).setData(2).setTitle(GOLD + Locales.getString("String_Node_Str",myPet.getOwner().getLanguage())).setGlowing(reciever == BeaconReciever.Everyone));
if (buffLevel.get(1) > 0) {
menu.setOption(0,new IconMenuItem().setMaterial(LEATHER_BOOTS).setAmount(buffLevel.get(1)).setTitle(GOLD + Locales.getString("String_Node_Str" + buffNames.get(1),myPet.getOwner().getLanguage()) + GRAY+ "String_Node_Str"+ Util.decimal2roman(buffLevel.get(1))));
}
if (buffLevel.get(3) > 0) {
menu.setOption(9,new IconMenuItem().setMaterial(GOLD_PICKAXE).setAmount(buffLevel.get(3)).setTitle(GOLD + Locales.getString("String_Node_Str" + buffNames.get(3),myPet.getOwner().getLanguage()) + GRAY+ "String_Node_Str"+ Util.decimal2roman(buffLevel.get(3))));
}
if (buffLevel.get(5) > 0) {
menu.setOption(18,new IconMenuItem().setMaterial(DIAMOND_SWORD).setAmount(buffLevel.get(5)).setTitle(GOLD + Locales.getString("String_Node_Str" + buffNames.get(5),myPet.getOwner().getLanguage()) + GRAY+ "String_Node_Str"+ Util.decimal2roman(buffLevel.get(5))));
}
if (buffLevel.get(8) > 0) {
menu.setOption(1,new IconMenuItem().setMaterial(FIREWORK).setAmount(buffLevel.get(8)).setTitle(GOLD + Locales.getString("String_Node_Str" + buffNames.get(8),myPet.getOwner().getLanguage()) + GRAY+ "String_Node_Str"+ Util.decimal2roman(buffLevel.get(8))));
}
if (buffLevel.get(10) > 0) {
menu.setOption(10,new IconMenuItem().setMaterial(APPLE).setAmount(buffLevel.get(10)).setTitle(GOLD + Locales.getString("String_Node_Str" + buffNames.get(10),myPet.getOwner().getLanguage()) + GRAY+ "String_Node_Str"+ Util.decimal2roman(buffLevel.get(10))));
}
if (buffLevel.get(11) > 0) {
menu.setOption(19,new IconMenuItem().setMaterial(DIAMOND_CHESTPLATE).setAmount(buffLevel.get(11)).setTitle(GOLD + Locales.getString("String_Node_Str" + buffNames.get(11),myPet.getOwner().getLanguage()) + GRAY+ "String_Node_Str"+ Util.decimal2roman(buffLevel.get(11))));
}
if (buffLevel.get(12) > 0) {
menu.setOption(7,new IconMenuItem().setMaterial(LAVA_BUCKET).setAmount(buffLevel.get(12)).setTitle(GOLD + Locales.getString("String_Node_Str" + buffNames.get(12),myPet.getOwner().getLanguage()) + GRAY+ "String_Node_Str"+ Util.decimal2roman(buffLevel.get(12))));
}
if (buffLevel.get(13) > 0) {
menu.setOption(16,new IconMenuItem().setMaterial(RAW_FISH).setAmount(buffLevel.get(13)).setTitle(GOLD + Locales.getString("String_Node_Str" + buffNames.get(13),myPet.getOwner().getLanguage()) + GRAY+ "String_Node_Str"+ Util.decimal2roman(buffLevel.get(13))));
}
if (buffLevel.get(14) > 0) {
menu.setOption(25,new IconMenuItem().setMaterial(EYE_OF_ENDER).setAmount(buffLevel.get(14)).setTitle(GOLD + Locales.getString("String_Node_Str" + buffNames.get(14),myPet.getOwner().getLanguage()) + GRAY+ "String_Node_Str"+ Util.decimal2roman(buffLevel.get(14))));
}
if (buffLevel.get(16) > 0) {
menu.setOption(8,new IconMenuItem().setMaterial(TORCH).setAmount(buffLevel.get(16)).setTitle(GOLD + Locales.getString("String_Node_Str" + buffNames.get(16),myPet.getOwner().getLanguage()) + GRAY+ "String_Node_Str"+ Util.decimal2roman(buffLevel.get(16))));
}
if (buffLevel.get(21) > 0) {
menu.setOption(17,new IconMenuItem().setMaterial(GOLDEN_APPLE).setAmount(buffLevel.get(21)).setTitle(GOLD + Locales.getString("String_Node_Str" + buffNames.get(21),myPet.getOwner().getLanguage()) + GRAY+ "String_Node_Str"+ Util.decimal2roman(buffLevel.get(21))));
}
if (buffLevel.get(22) > 0) {
menu.setOption(26,new IconMenuItem().setMaterial(SPONGE).setAmount(buffLevel.get(22)).setTitle(GOLD + Locales.getString("String_Node_Str" + buffNames.get(22),myPet.getOwner().getLanguage()) + GRAY+ "String_Node_Str"+ Util.decimal2roman(buffLevel.get(22))));
}
for (int buff : selectedBuffs) {
if (buffLevel.get(buff) > 0) {
menu.getOption(buffItemPositions.get(buff)).setGlowing(true);
}
 else {
selectedBuffs.remove(buff);
}
}
if (selectableBuffs > 1) {
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)));
}
}
menu.open(owner);
return true;
}