Program: 156864
Project: 156864
Buggy source:
@Override protected void drawGuiContainerBackgroundLayer(float f,int x,int y){
  container.synchronize();
  ResourceLocation texture=container.getGateGuiFile();
  GL11.glColor4f(1.0F,1.0F,1.0F,1.0F);
  mc.renderEngine.bindTexture(texture);
  int cornerX=(width - xSize) / 2;
  int cornerY=(height - ySize) / 2;
  drawTexturedModalRect(cornerX,cornerY,0,0,xSize,ySize);
  int triggerTracker=0;
  boolean allTriggersActive=true;
  for (  AdvancedSlot slot : slots) {
    if (slot instanceof TriggerSlot) {
      boolean active=container.triggerState[triggerTracker++];
      if (slot.isDefined() && ((TriggerSlot)slot).getTrigger() != null && !active) {
        allTriggersActive=false;
        break;
      }
    }
  }
  triggerTracker=0;
  for (int s=0; s < slots.length; ++s) {
    AdvancedSlot slot=slots[s];
    if (slot instanceof TriggerSlot) {
      ITrigger trigger=((TriggerSlot)slot).getTrigger();
      boolean halfWidth=pipe.gate.logic == GateDefinition.GateLogic.AND && !allTriggersActive;
      if (pipe.gate.material.hasParameterSlot) {
        if (container.triggerState[triggerTracker++]) {
          mc.renderEngine.bindTexture(texture);
          drawTexturedModalRect(cornerX + slot.x + 35,cornerY + slot.y + 6,176,18,halfWidth ? 9 : 18,4);
        }
        if (trigger == null || !trigger.hasParameter()) {
          mc.renderEngine.bindTexture(texture);
          drawTexturedModalRect(cornerX + slot.x + 17,cornerY + slot.y - 1,176,0,18,18);
        }
      }
 else       if (container.triggerState[triggerTracker++]) {
        mc.renderEngine.bindTexture(texture);
        drawTexturedModalRect(cornerX + slot.x + 17,cornerY + slot.y + 6,176,18,halfWidth ? 9 : 18,4);
      }
    }
 else     if (slot instanceof TriggerParameterSlot) {
      TriggerParameterSlot paramSlot=(TriggerParameterSlot)slot;
      TriggerSlot trigger=(TriggerSlot)slots[s - numSlots * 2];
      if (trigger.isDefined() && trigger.getTrigger().requiresParameter()) {
        if (paramSlot.getItemStack() == null) {
          mc.renderEngine.bindTexture(texture);
          drawTexturedModalRect(cornerX + slot.x - 1,cornerY + slot.y - 1,176,22,18,18);
        }
      }
    }
  }
  drawBackgroundSlots();
}

Fixed version (ground truth):
@Override protected void drawGuiContainerBackgroundLayer(float f,int x,int y){
  container.synchronize();
  ResourceLocation texture=container.getGateGuiFile();
  GL11.glColor4f(1.0F,1.0F,1.0F,1.0F);
  mc.renderEngine.bindTexture(texture);
  int cornerX=(width - xSize) / 2;
  int cornerY=(height - ySize) / 2;
  drawTexturedModalRect(cornerX,cornerY,0,0,xSize,ySize);
  int actionTracker=0;
  actionTracker=0;
  for (int s=0; s < slots.length; ++s) {
    AdvancedSlot slot=slots[s];
    if (slot instanceof TriggerSlot) {
      ITrigger trigger=((TriggerSlot)slot).getTrigger();
      boolean halfWidth=container.actionsState[actionTracker] == ActionState.Partial;
      if (pipe.gate.material.hasParameterSlot) {
        if (container.actionsState[actionTracker] != ActionState.Deactivated) {
          mc.renderEngine.bindTexture(texture);
          drawTexturedModalRect(cornerX + slot.x + 35,cornerY + slot.y + 6,176,18,halfWidth ? 9 : 18,4);
        }
        if (trigger == null || !trigger.hasParameter()) {
          mc.renderEngine.bindTexture(texture);
          drawTexturedModalRect(cornerX + slot.x + 17,cornerY + slot.y - 1,176,0,18,18);
        }
      }
 else       if (container.actionsState[actionTracker] != ActionState.Deactivated) {
        mc.renderEngine.bindTexture(texture);
        drawTexturedModalRect(cornerX + slot.x + 17,cornerY + slot.y + 6,176,18,halfWidth ? 9 : 18,4);
      }
      actionTracker++;
    }
 else     if (slot instanceof TriggerParameterSlot) {
      TriggerParameterSlot paramSlot=(TriggerParameterSlot)slot;
      TriggerSlot trigger=(TriggerSlot)slots[s - numSlots * 2];
      if (trigger.isDefined() && trigger.getTrigger().requiresParameter()) {
        if (paramSlot.getItemStack() == null) {
          mc.renderEngine.bindTexture(texture);
          drawTexturedModalRect(cornerX + slot.x - 1,cornerY + slot.y - 1,176,22,18,18);
        }
      }
    }
  }
  drawBackgroundSlots();
}