Program: 625
Project: 625
Buggy source:
@Override public void applyParameters(Material program){
  super.applyParameters(program);
  Optional<Texture> terrain=Assets.getTexture("String_Node_Str");
  Optional<Texture> terrainNormal=Assets.getTexture("String_Node_Str");
  Optional<Texture> terrainHeight=Assets.getTexture("String_Node_Str");
  Optional<Texture> water=Assets.getTexture("String_Node_Str");
  Optional<Texture> lava=Assets.getTexture("String_Node_Str");
  Optional<Texture> waterNormal=Assets.getTexture("String_Node_Str");
  Optional<Texture> waterNormalAlt=Assets.getTexture("String_Node_Str");
  Optional<Texture> effects=Assets.getTexture("String_Node_Str");
  if (!terrain.isPresent() || !water.isPresent() || !lava.isPresent()|| !waterNormal.isPresent()|| !effects.isPresent()) {
    return;
  }
  DynamicFBOsManager dynamicFBOsManager=CoreRegistry.get(DynamicFBOsManager.class);
  RenderingConfig renderingConfig=CoreRegistry.get(Config.class).getRendering();
  int texId=0;
  GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId);
  glBindTexture(GL11.GL_TEXTURE_2D,terrain.get().getId());
  program.setInt("String_Node_Str",texId++,true);
  GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId);
  glBindTexture(GL11.GL_TEXTURE_2D,water.get().getId());
  program.setInt("String_Node_Str",texId++,true);
  GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId);
  glBindTexture(GL11.GL_TEXTURE_2D,lava.get().getId());
  program.setInt("String_Node_Str",texId++,true);
  GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId);
  glBindTexture(GL11.GL_TEXTURE_2D,waterNormal.get().getId());
  program.setInt("String_Node_Str",texId++,true);
  GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId);
  glBindTexture(GL11.GL_TEXTURE_2D,waterNormalAlt.get().getId());
  program.setInt("String_Node_Str",texId++,true);
  GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId);
  glBindTexture(GL11.GL_TEXTURE_2D,effects.get().getId());
  program.setInt("String_Node_Str",texId++,true);
  GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId);
  dynamicFBOsManager.bindFboColorTexture(WorldReflectionNode.REFLECTED_URN);
  program.setInt("String_Node_Str",texId++,true);
  GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId);
  dynamicFBOsManager.bindFboColorTexture(DefaultDynamicFBOs.ReadOnlyGBuffer.getName());
  program.setInt("String_Node_Str",texId++,true);
  if (renderingConfig.isNormalMapping()) {
    GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId);
    glBindTexture(GL11.GL_TEXTURE_2D,terrainNormal.get().getId());
    program.setInt("String_Node_Str",texId++,true);
    if (renderingConfig.isParallaxMapping()) {
      GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId);
      glBindTexture(GL11.GL_TEXTURE_2D,terrainHeight.get().getId());
      program.setInt("String_Node_Str",texId++,true);
      program.setFloat4("String_Node_Str",parallaxBias,parallaxScale,0.0f,0.0f,true);
    }
  }
  Vector4f lightingSettingsFrag=new Vector4f();
  lightingSettingsFrag.z=waterSpecExp;
  program.setFloat4("String_Node_Str",lightingSettingsFrag,true);
  Vector4f waterSettingsFrag=new Vector4f();
  waterSettingsFrag.x=waterNormalBias;
  waterSettingsFrag.y=waterRefraction;
  waterSettingsFrag.z=waterFresnelBias;
  waterSettingsFrag.w=waterFresnelPow;
  program.setFloat4("String_Node_Str",waterSettingsFrag,true);
  Vector4f alternativeWaterSettingsFrag=new Vector4f();
  alternativeWaterSettingsFrag.x=waterTint;
  program.setFloat4("String_Node_Str",alternativeWaterSettingsFrag,true);
  if (renderingConfig.isAnimateWater()) {
    program.setFloat("String_Node_Str",waveIntensFalloff,true);
    program.setFloat("String_Node_Str",waveSizeFalloff,true);
    program.setFloat("String_Node_Str",waveSize,true);
    program.setFloat("String_Node_Str",waveSpeedFalloff,true);
    program.setFloat("String_Node_Str",waveSpeed,true);
    program.setFloat("String_Node_Str",waveIntens,true);
    program.setFloat("String_Node_Str",waterOffsetY,true);
    program.setFloat("String_Node_Str",waveOverallScale,true);
  }
}

Fixed version (ground truth):
@Override public void applyParameters(Material program){
  super.applyParameters(program);
  Optional<Texture> terrain=Assets.getTexture("String_Node_Str");
  Optional<Texture> terrainNormal=Assets.getTexture("String_Node_Str");
  Optional<Texture> terrainHeight=Assets.getTexture("String_Node_Str");
  Optional<Texture> water=Assets.getTexture("String_Node_Str");
  Optional<Texture> lava=Assets.getTexture("String_Node_Str");
  Optional<Texture> waterNormal=Assets.getTexture("String_Node_Str");
  Optional<Texture> waterNormalAlt=Assets.getTexture("String_Node_Str");
  Optional<Texture> effects=Assets.getTexture("String_Node_Str");
  if (!terrain.isPresent() || !water.isPresent() || !lava.isPresent()|| !waterNormal.isPresent()|| !effects.isPresent()) {
    return;
  }
  DynamicFBOsManager dynamicFBOsManager=CoreRegistry.get(DynamicFBOsManager.class);
  RenderingConfig renderingConfig=CoreRegistry.get(Config.class).getRendering();
  int texId=0;
  GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId);
  glBindTexture(GL11.GL_TEXTURE_2D,terrain.get().getId());
  program.setInt("String_Node_Str",texId++,true);
  GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId);
  glBindTexture(GL11.GL_TEXTURE_2D,water.get().getId());
  program.setInt("String_Node_Str",texId++,true);
  GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId);
  glBindTexture(GL11.GL_TEXTURE_2D,lava.get().getId());
  program.setInt("String_Node_Str",texId++,true);
  GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId);
  glBindTexture(GL11.GL_TEXTURE_2D,waterNormal.get().getId());
  program.setInt("String_Node_Str",texId++,true);
  GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId);
  glBindTexture(GL11.GL_TEXTURE_2D,waterNormalAlt.get().getId());
  program.setInt("String_Node_Str",texId++,true);
  GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId);
  glBindTexture(GL11.GL_TEXTURE_2D,effects.get().getId());
  program.setInt("String_Node_Str",texId++,true);
  GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId);
  dynamicFBOsManager.bindFboColorTexture(WorldReflectionNode.REFLECTED_URN);
  program.setInt("String_Node_Str",texId++,true);
  GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId);
  dynamicFBOsManager.bindFboColorTexture(DefaultDynamicFBOs.READ_ONLY_GBUFFER.getName());
  program.setInt("String_Node_Str",texId++,true);
  if (renderingConfig.isNormalMapping()) {
    GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId);
    glBindTexture(GL11.GL_TEXTURE_2D,terrainNormal.get().getId());
    program.setInt("String_Node_Str",texId++,true);
    if (renderingConfig.isParallaxMapping()) {
      GL13.glActiveTexture(GL13.GL_TEXTURE0 + texId);
      glBindTexture(GL11.GL_TEXTURE_2D,terrainHeight.get().getId());
      program.setInt("String_Node_Str",texId++,true);
      program.setFloat4("String_Node_Str",parallaxBias,parallaxScale,0.0f,0.0f,true);
    }
  }
  Vector4f lightingSettingsFrag=new Vector4f();
  lightingSettingsFrag.z=waterSpecExp;
  program.setFloat4("String_Node_Str",lightingSettingsFrag,true);
  Vector4f waterSettingsFrag=new Vector4f();
  waterSettingsFrag.x=waterNormalBias;
  waterSettingsFrag.y=waterRefraction;
  waterSettingsFrag.z=waterFresnelBias;
  waterSettingsFrag.w=waterFresnelPow;
  program.setFloat4("String_Node_Str",waterSettingsFrag,true);
  Vector4f alternativeWaterSettingsFrag=new Vector4f();
  alternativeWaterSettingsFrag.x=waterTint;
  program.setFloat4("String_Node_Str",alternativeWaterSettingsFrag,true);
  if (renderingConfig.isAnimateWater()) {
    program.setFloat("String_Node_Str",waveIntensFalloff,true);
    program.setFloat("String_Node_Str",waveSizeFalloff,true);
    program.setFloat("String_Node_Str",waveSize,true);
    program.setFloat("String_Node_Str",waveSpeedFalloff,true);
    program.setFloat("String_Node_Str",waveSpeed,true);
    program.setFloat("String_Node_Str",waveIntens,true);
    program.setFloat("String_Node_Str",waterOffsetY,true);
    program.setFloat("String_Node_Str",waveOverallScale,true);
  }
}