// InsaneCraft S2 - bounded Replication recipe traversal.
// Replication 1.1.3 exposes MAX_RECIPE_DEPTH as a public field but does not
// register it with its TOML config. Set it in memory so the official jar can
// be used unchanged in a CurseForge export.

if (Platform.isLoaded('replication')) {
  try {
    var icReplicationRecipeCalculation = Java.loadClass('com.buuz135.replication.ReplicationConfig$RecipeCalculation')
    icReplicationRecipeCalculation.MAX_RECIPE_DEPTH = 6
    console.info('[InsaneCraft] Replication recipe depth capped at 6; supported visit cap is 24.')
  } catch (error) {
    console.warn('[InsaneCraft] Could not apply the optional Replication performance cap: ' + error)
  }
}
