Program: 81861
Project: 81861
Buggy source:
@Override public void initGui(){
  super.initGui();
  resetGuiElements();
  xSize=372;
  ySize=250;
  ScaledResolution var8=new ScaledResolution(mc);
  int scaledWidth=var8.getScaledWidth();
  int scaledHeight=var8.getScaledHeight();
  xCenter=scaledWidth / 2;
  yCenter=scaledHeight / 2;
  xStart=xCenter - xSize / 2;
  yStart=yCenter - ySize / 2;
  int guiPadding=8;
  int xStartPadded=xStart + guiPadding - 1;
  int yStartPadded=yStart + guiPadding - 1;
  int btnWidth=80;
  int btnWidthAndPadding=84;
  int btnWidthBool=50;
  int btnHeight=20;
  int btnHeightAndPadding=24;
  int padding=1;
  int btnSpacing=22;
  int yEleSize2=44;
  int xStartPadded2=xStartPadded + 168;
  int yStartPadded2=yStartPadded + 30;
  int yStartPadded3=yStartPadded2 + 20;
  int btnDimIndex=btnDimIndexStart;
  addButton(new GuiButton(CMD_CLOSE,xStart + xSize - guiPadding - btnWidth,yStart + ySize - guiPadding - btnHeight,btnWidth,btnHeight,"String_Node_Str"));
  addButton(new GuiButton(CMD_ADVANCED,xStart + xSize - guiPadding - btnWidth - btnWidthAndPadding,yStart + ySize - guiPadding - btnHeight,btnWidth,btnHeight,"String_Node_Str"));
  addButton(new GuiButton(CMD_SUBGUI_PERFORMANCE,xStartPadded + btnWidthAndPadding * 0,yStartPadded,btnWidth,btnHeight,(guiCur.equals(GUI_SUBGUI_PERFORMANCE) ? "String_Node_Str" + '2' : "String_Node_Str") + GUI_SUBGUI_PERFORMANCE));
  addButton(new GuiButton(CMD_SUBGUI_COMPATIBILITY,xStartPadded + btnWidthAndPadding * 1,yStartPadded,btnWidth,btnHeight,(guiCur.equals(GUI_SUBGUI_COMPATIBILITY) ? "String_Node_Str" + '2' : "String_Node_Str") + GUI_SUBGUI_COMPATIBILITY));
  addButton(new GuiButton(CMD_SUBGUI_PREFERENCE,xStartPadded + btnWidthAndPadding * 2,yStartPadded,btnWidth,btnHeight,(guiCur.equals(GUI_SUBGUI_PREFERENCE) ? "String_Node_Str" + '2' : "String_Node_Str") + GUI_SUBGUI_PREFERENCE));
  addButton(new GuiButton(CMD_SUBGUI_DIMENSIONS,xStartPadded + btnWidthAndPadding * 3,yStartPadded,btnWidth,btnHeight,(guiCur.equals(GUI_SUBGUI_DIMENSIONS) ? "String_Node_Str" + '2' : "String_Node_Str") + GUI_SUBGUI_DIMENSIONS));
  if (guiCur.equals(GUI_SUBGUI_PERFORMANCE)) {
    addButton(new GuiButtonCycle(WeatherUtilConfig.CMD_BTN_PERF_STORM,xStartPadded2 + btnWidthAndPadding * 0,yStartPadded2,btnWidth,btnHeight,WeatherUtilConfig.LIST_RATES,0));
    addButton(new GuiButtonCycle(WeatherUtilConfig.CMD_BTN_PERF_NATURE,xStartPadded2 + btnWidthAndPadding * 0,yStartPadded2 + btnHeightAndPadding * 1,btnWidth,btnHeight,WeatherUtilConfig.LIST_RATES2,0));
    addButton(new GuiButtonCycle(WeatherUtilConfig.CMD_BTN_PERF_PRECIPRATE,xStartPadded2 + btnWidthAndPadding * 0,yStartPadded2 + btnHeightAndPadding * 2,btnWidth,btnHeight,WeatherUtilConfig.LIST_RATES2,0));
  }
 else   if (guiCur.equals(GUI_SUBGUI_COMPATIBILITY)) {
    addButton(new GuiButtonCycle(WeatherUtilConfig.CMD_BTN_COMP_STORM,xStartPadded2 + btnWidthAndPadding * 0,yStartPadded2,btnWidth,btnHeight,WeatherUtilConfig.LIST_STORMSWHEN,0));
    addButton(new GuiButtonCycle(WeatherUtilConfig.CMD_BTN_COMP_LOCK,xStartPadded2 + btnWidthAndPadding * 0,yStartPadded2 + btnHeightAndPadding * 1,btnWidth,btnHeight,WeatherUtilConfig.LIST_LOCK,0));
    addButton(new GuiButtonCycle(WeatherUtilConfig.CMD_BTN_COMP_PARTICLEPRECIP,xStartPadded2 + btnWidthAndPadding * 0,yStartPadded2 + btnHeightAndPadding * 2,btnWidth,btnHeight,WeatherUtilConfig.LIST_TOGGLE,1));
    addButton(new GuiButtonCycle(WeatherUtilConfig.CMD_BTN_COMP_SNOWFALLBLOCKS,xStartPadded2 + btnWidthAndPadding * 0,yStartPadded2 + btnHeightAndPadding * 3,btnWidth,btnHeight,WeatherUtilConfig.LIST_TOGGLE,0));
    addButton(new GuiButtonCycle(WeatherUtilConfig.CMD_BTN_COMP_PARTICLESNOMODS,xStartPadded2 + btnWidthAndPadding * 0,yStartPadded2 + btnHeightAndPadding * 4,btnWidth,btnHeight,WeatherUtilConfig.LIST_TOGGLE,0));
  }
 else   if (guiCur.equals(GUI_SUBGUI_PREFERENCE)) {
    addButton(new GuiButtonCycle(WeatherUtilConfig.CMD_BTN_PREF_RATEOFSTORM,xStartPadded2 + btnWidthAndPadding * 0,yStartPadded2,btnWidth,btnHeight,WeatherUtilConfig.LIST_CHANCE,1));
    addButton(new GuiButtonCycle(WeatherUtilConfig.CMD_BTN_PREF_CHANCEOFSTORM,xStartPadded2 + btnWidthAndPadding * 0,yStartPadded2 + btnHeightAndPadding * 1,btnWidth,btnHeight,WeatherUtilConfig.LIST_RATES,0));
    addButton(new GuiButtonCycle(WeatherUtilConfig.CMD_BTN_PREF_CHANCEOFRAIN,xStartPadded2 + btnWidthAndPadding * 0,yStartPadded2 + btnHeightAndPadding * 2,btnWidth,btnHeight,WeatherUtilConfig.LIST_RATES2,0));
    addButton(new GuiButtonCycle(WeatherUtilConfig.CMD_BTN_PREF_BLOCKDESTRUCTION,xStartPadded2 + btnWidthAndPadding * 0,yStartPadded2 + btnHeightAndPadding * 3,btnWidth,btnHeight,WeatherUtilConfig.LIST_TOGGLE,1));
    addButton(new GuiButtonCycle(WeatherUtilConfig.CMD_BTN_PREF_TORNADOANDCYCLONES,xStartPadded2 + btnWidthAndPadding * 0,yStartPadded2 + btnHeightAndPadding * 4,btnWidth,btnHeight,WeatherUtilConfig.LIST_TOGGLE,1));
    addButton(new GuiButtonCycle(WeatherUtilConfig.CMD_BTN_PREF_SANDSTORMS,xStartPadded2 + btnWidthAndPadding * 0,yStartPadded2 + btnHeightAndPadding * 5,btnWidth,btnHeight,WeatherUtilConfig.LIST_TOGGLE,1));
    addButton(new GuiButtonCycle(WeatherUtilConfig.CMD_BTN_PREF_GLOBALRATE,xStartPadded2 + btnWidthAndPadding * 0,yStartPadded2 + btnHeightAndPadding * 6,btnWidth,btnHeight,WeatherUtilConfig.LIST_GLOBALRATE,1));
  }
 else   if (guiCur.equals(GUI_SUBGUI_DIMENSIONS)) {
    addButton(new GuiButton(CMD_BUTTON_DIMENSIONS_PREV,xStartPadded,yStart + ySize - guiPadding - btnHeight,60,20,"String_Node_Str"));
    addButton(new GuiButton(CMD_BUTTON_DIMENSIONS_NEXT,xStartPadded + 20 + btnWidthAndPadding * 1,yStart + ySize - guiPadding - btnHeight,60,20,"String_Node_Str"));
    for (int i=0; i < curDimListCountPerPage; i++) {
      addButton(new GuiButtonCycle(btnDimIndex++,xStartPadded + 46,yStartPadded3 + yEleSize2 * i,40,20,WeatherUtilConfig.LIST_TOGGLE,1));
      addButton(new GuiButtonCycle(btnDimIndex++,xStartPadded + 132,yStartPadded3 + yEleSize2 * i,40,20,WeatherUtilConfig.LIST_TOGGLE,1));
      addButton(new GuiButtonCycle(btnDimIndex++,xStartPadded + 218,yStartPadded3 + yEleSize2 * i,40,20,WeatherUtilConfig.LIST_TOGGLE,1));
      addButton(new GuiButtonCycle(btnDimIndex++,xStartPadded + 306,yStartPadded3 + yEleSize2 * i,40,20,WeatherUtilConfig.LIST_TOGGLE,1));
    }
  }
  if (guiCur.equals("String_Node_Str")) {
  }
  updateGuiElements();
}

Fixed version (ground truth):
@Override public void initGui(){
  super.initGui();
  resetGuiElements();
  xSize=372;
  ySize=250;
  ScaledResolution var8=new ScaledResolution(mc);
  int scaledWidth=var8.getScaledWidth();
  int scaledHeight=var8.getScaledHeight();
  xCenter=scaledWidth / 2;
  yCenter=scaledHeight / 2;
  xStart=xCenter - xSize / 2;
  yStart=yCenter - ySize / 2;
  int guiPadding=8;
  int xStartPadded=xStart + guiPadding - 1;
  int yStartPadded=yStart + guiPadding - 1;
  int btnWidth=80;
  int btnWidthAndPadding=84;
  int btnWidthBool=50;
  int btnHeight=20;
  int btnHeightAndPadding=24;
  int padding=1;
  int btnSpacing=22;
  int yEleSize2=44;
  int xStartPadded2=xStartPadded + 168;
  int yStartPadded2=yStartPadded + 30;
  int yStartPadded3=yStartPadded2 + 20;
  int btnDimIndex=btnDimIndexStart;
  addButton(new GuiButton(CMD_CLOSE,xStart + xSize - guiPadding - btnWidth,yStart + ySize - guiPadding - btnHeight,btnWidth,btnHeight,"String_Node_Str"));
  addButton(new GuiButton(CMD_ADVANCED,xStart + xSize - guiPadding - btnWidth - btnWidthAndPadding,yStart + ySize - guiPadding - btnHeight,btnWidth,btnHeight,"String_Node_Str"));
  addButton(new GuiButton(CMD_SUBGUI_PERFORMANCE,xStartPadded + btnWidthAndPadding * 0,yStartPadded,btnWidth,btnHeight,(guiCur.equals(GUI_SUBGUI_PERFORMANCE) ? "String_Node_Str" + '2' : "String_Node_Str") + GUI_SUBGUI_PERFORMANCE));
  addButton(new GuiButton(CMD_SUBGUI_COMPATIBILITY,xStartPadded + btnWidthAndPadding * 1,yStartPadded,btnWidth,btnHeight,(guiCur.equals(GUI_SUBGUI_COMPATIBILITY) ? "String_Node_Str" + '2' : "String_Node_Str") + GUI_SUBGUI_COMPATIBILITY));
  addButton(new GuiButton(CMD_SUBGUI_PREFERENCE,xStartPadded + btnWidthAndPadding * 2,yStartPadded,btnWidth,btnHeight,(guiCur.equals(GUI_SUBGUI_PREFERENCE) ? "String_Node_Str" + '2' : "String_Node_Str") + GUI_SUBGUI_PREFERENCE));
  addButton(new GuiButton(CMD_SUBGUI_DIMENSIONS,xStartPadded + btnWidthAndPadding * 3,yStartPadded,btnWidth,btnHeight,(guiCur.equals(GUI_SUBGUI_DIMENSIONS) ? "String_Node_Str" + '2' : "String_Node_Str") + GUI_SUBGUI_DIMENSIONS));
  if (guiCur.equals(GUI_SUBGUI_PERFORMANCE)) {
    addButton(new GuiButtonCycle(WeatherUtilConfig.CMD_BTN_PERF_STORM,xStartPadded2 + btnWidthAndPadding * 0,yStartPadded2,btnWidth,btnHeight,WeatherUtilConfig.LIST_RATES,1));
    addButton(new GuiButtonCycle(WeatherUtilConfig.CMD_BTN_PERF_NATURE,xStartPadded2 + btnWidthAndPadding * 0,yStartPadded2 + btnHeightAndPadding * 1,btnWidth,btnHeight,WeatherUtilConfig.LIST_RATES2,1));
    addButton(new GuiButtonCycle(WeatherUtilConfig.CMD_BTN_PERF_PRECIPRATE,xStartPadded2 + btnWidthAndPadding * 0,yStartPadded2 + btnHeightAndPadding * 2,btnWidth,btnHeight,WeatherUtilConfig.LIST_RATES2,1));
  }
 else   if (guiCur.equals(GUI_SUBGUI_COMPATIBILITY)) {
    addButton(new GuiButtonCycle(WeatherUtilConfig.CMD_BTN_COMP_STORM,xStartPadded2 + btnWidthAndPadding * 0,yStartPadded2,btnWidth,btnHeight,WeatherUtilConfig.LIST_STORMSWHEN,0));
    addButton(new GuiButtonCycle(WeatherUtilConfig.CMD_BTN_COMP_LOCK,xStartPadded2 + btnWidthAndPadding * 0,yStartPadded2 + btnHeightAndPadding * 1,btnWidth,btnHeight,WeatherUtilConfig.LIST_LOCK,0));
    addButton(new GuiButtonCycle(WeatherUtilConfig.CMD_BTN_COMP_PARTICLEPRECIP,xStartPadded2 + btnWidthAndPadding * 0,yStartPadded2 + btnHeightAndPadding * 2,btnWidth,btnHeight,WeatherUtilConfig.LIST_TOGGLE,1));
    addButton(new GuiButtonCycle(WeatherUtilConfig.CMD_BTN_COMP_SNOWFALLBLOCKS,xStartPadded2 + btnWidthAndPadding * 0,yStartPadded2 + btnHeightAndPadding * 3,btnWidth,btnHeight,WeatherUtilConfig.LIST_TOGGLE,0));
    addButton(new GuiButtonCycle(WeatherUtilConfig.CMD_BTN_COMP_PARTICLESNOMODS,xStartPadded2 + btnWidthAndPadding * 0,yStartPadded2 + btnHeightAndPadding * 4,btnWidth,btnHeight,WeatherUtilConfig.LIST_TOGGLE,0));
  }
 else   if (guiCur.equals(GUI_SUBGUI_PREFERENCE)) {
    addButton(new GuiButtonCycle(WeatherUtilConfig.CMD_BTN_PREF_RATEOFSTORM,xStartPadded2 + btnWidthAndPadding * 0,yStartPadded2,btnWidth,btnHeight,WeatherUtilConfig.LIST_CHANCE,1));
    addButton(new GuiButtonCycle(WeatherUtilConfig.CMD_BTN_PREF_CHANCEOFSTORM,xStartPadded2 + btnWidthAndPadding * 0,yStartPadded2 + btnHeightAndPadding * 1,btnWidth,btnHeight,WeatherUtilConfig.LIST_RATES,0));
    addButton(new GuiButtonCycle(WeatherUtilConfig.CMD_BTN_PREF_CHANCEOFRAIN,xStartPadded2 + btnWidthAndPadding * 0,yStartPadded2 + btnHeightAndPadding * 2,btnWidth,btnHeight,WeatherUtilConfig.LIST_RATES2,0));
    addButton(new GuiButtonCycle(WeatherUtilConfig.CMD_BTN_PREF_BLOCKDESTRUCTION,xStartPadded2 + btnWidthAndPadding * 0,yStartPadded2 + btnHeightAndPadding * 3,btnWidth,btnHeight,WeatherUtilConfig.LIST_TOGGLE,1));
    addButton(new GuiButtonCycle(WeatherUtilConfig.CMD_BTN_PREF_TORNADOANDCYCLONES,xStartPadded2 + btnWidthAndPadding * 0,yStartPadded2 + btnHeightAndPadding * 4,btnWidth,btnHeight,WeatherUtilConfig.LIST_TOGGLE,1));
    addButton(new GuiButtonCycle(WeatherUtilConfig.CMD_BTN_PREF_SANDSTORMS,xStartPadded2 + btnWidthAndPadding * 0,yStartPadded2 + btnHeightAndPadding * 5,btnWidth,btnHeight,WeatherUtilConfig.LIST_TOGGLE,1));
    addButton(new GuiButtonCycle(WeatherUtilConfig.CMD_BTN_PREF_GLOBALRATE,xStartPadded2 + btnWidthAndPadding * 0,yStartPadded2 + btnHeightAndPadding * 6,btnWidth,btnHeight,WeatherUtilConfig.LIST_GLOBALRATE,1));
  }
 else   if (guiCur.equals(GUI_SUBGUI_DIMENSIONS)) {
    addButton(new GuiButton(CMD_BUTTON_DIMENSIONS_PREV,xStartPadded,yStart + ySize - guiPadding - btnHeight,60,20,"String_Node_Str"));
    addButton(new GuiButton(CMD_BUTTON_DIMENSIONS_NEXT,xStartPadded + 20 + btnWidthAndPadding * 1,yStart + ySize - guiPadding - btnHeight,60,20,"String_Node_Str"));
    for (int i=0; i < curDimListCountPerPage; i++) {
      addButton(new GuiButtonCycle(btnDimIndex++,xStartPadded + 46,yStartPadded3 + yEleSize2 * i,40,20,WeatherUtilConfig.LIST_TOGGLE,1));
      addButton(new GuiButtonCycle(btnDimIndex++,xStartPadded + 132,yStartPadded3 + yEleSize2 * i,40,20,WeatherUtilConfig.LIST_TOGGLE,1));
      addButton(new GuiButtonCycle(btnDimIndex++,xStartPadded + 218,yStartPadded3 + yEleSize2 * i,40,20,WeatherUtilConfig.LIST_TOGGLE,1));
      addButton(new GuiButtonCycle(btnDimIndex++,xStartPadded + 306,yStartPadded3 + yEleSize2 * i,40,20,WeatherUtilConfig.LIST_TOGGLE,1));
    }
  }
  if (guiCur.equals("String_Node_Str")) {
  }
  updateGuiElements();
}