// Brass & Sigil -- Supplementaries cross-mod bridges
//
// Supplementaries already does tag work (c:crops/flax, c:fiber/flax,
// c:drinks/lumisene, etc.) and Create auto-generates Millstone +
// 9x packing recipes from those tags. So most integration is done.
//
// What's left -- two small bridges:
//   1. Flax -> String via Mechanical Press (Create doesn't map
//      c:fiber -> string natively; this fills the gap so flax becomes
//      a viable string-source for textile builds).
//   2. Plunderer drops 1-3 Numismatics spurs so the hostile NPC pulls
//      into the server economy. Plunderers are rare so this is a
//      mild bounty, not a farmable currency source.
//
// Lumisene -> Ars Source was on the list but Ars Nouveau 5.11.x's
// sourcelink recipe schema needs verification before we add it.
// Parked for a follow-up.

ServerEvents.recipes(event => {
    // 2 flax pressed -> 1 string. Cheaper than wool->4 string but
    // requires a Press (kinetic infrastructure) -- balanced.
    //
    // Uses the kubejs_create mod's builder API (added in pack v0.27.0).
    // Before that, the bare event.recipes.create.pressing() signature
    // didn't match Create 6.x's recipe shape and we had to use a raw
    // event.custom({type: 'create:pressing', ...}) call.
    event.recipes.create.pressing('2x minecraft:string', 'supplementaries:flax')
        .id('bns:press_flax_to_string');
    console.info('[bns/supplementaries_bridges] added flax -> string press recipe');
});

// Plunderer is a hostile mob that raids unprotected chests. Adding
// a small spur bounty makes them a mini-event rather than a pure
// nuisance. Range tuned low: 1-3 spurs = trivial vs. the player
// economy but creates a "go hunt the plunderer" hook.
//
// KubeJS 2101.7.2 doesn't expose ServerEvents.entityLootTables on
// NeoForge -- we use EntityEvents.drops (filtered by entity id) and
// add items via event.addDrop instead.
EntityEvents.drops('supplementaries:plunderer', event => {
    const count = 1 + Math.floor(Math.random() * 3);
    event.addDrop(Item.of('numismatics:spur', count));
});
console.info('[bns/supplementaries_bridges] registered plunderer -> spur drops handler');
