ServerEvents.recipes((event) => {
    // =========================================
    // Sophisticated Backpack and Storage Recipes
    // =========================================
  
    // Backpack
    event
      .shaped("sophisticatedbackpacks:backpack", [
        "ABA", 
        "ACA", 
        "DDD"
      ], 
      {
        A: "supplementaries:rope",
        B: "supplementaries:sack",
        C: "#forge:chests/wooden",
        D: "minecraft:leather",
      }).id('sophisticatedbackpacks:backpack')

    // Backpack Upgrade Base
    event.remove({ id: "sophisticatedbackpacks:upgrade_base"});
    event
      .shaped("sophisticatedbackpacks:upgrade_base", [
        "ABA", 
        "BCB", 
        "ABA"
      ], 
      {
        A: "supplementaries:rope",
        B: "#forge:ingots/zinc",
        C: "minecraft:leather",
      })
      .id("sophisticatedbackpacks:upgrade_base_custom");
  
    // Storage Upgrade Base
    event.remove({ id: "sophisticatedstorage:upgrade_base"});
    event
      .shaped("sophisticatedstorage:upgrade_base", [
        "ABA", 
        "BCB", 
        "ABA"
      ], 
      {
        A: "spawn:rotten_planks",
        B: "#forge:ingots/zinc",
        C: "labels:label",
      })
      .id("sophisticatedstorage:upgrade_base_custom");
    
    // Sophisticated Controller
    event
      .shaped("sophisticatedstorage:controller", [
        "ABA", 
        "DCE", 
        "AFA"
      ], 
      {
        A: "#warp_pipes:warp_pipes",
        B: "create:redstone_link",
        C: "#sophisticatedstorage:base_tier_wooden_storage",
        D: "nethers_exoticism:bouddha_s_hand",
        E: "crabbersdelight:pearl",
        F: "sophisticatedstorage:hopper_upgrade",
      })
      .id("sophisticatedstorage:controller");
  
    // Sophisticated Storage Link
    event.remove({ id: "sophisticatedstorage:storage_link_from_controller" });
    event.remove({ id: "sophisticatedstorage:storage_link" });
    event
      .shaped("3x sophisticatedstorage:storage_link", [
        "ABA", 
        "CDE", 
        "AFA"
      ], 
      {
        A: "#warp_pipes:warp_pipes",
        B: "create:redstone_link",
        C: "nethers_exoticism:bouddha_s_hand",
        D: "sophisticatedstorage:controller",
        E: "crabbersdelight:pearl",
        F: "sophisticatedstorage:hopper_upgrade",
      })
      .id("sophisticatedstorage:storage_link_custom");

    // Tier 1 Upgrades Iron -> Silver
    event.replaceInput(
      { input: "#forge:ingots/iron", mod: "sophisticatedstorage" }, 
      "#forge:ingots/iron", 
      "#forge:ingots/silver" 
    );
    event.replaceInput(
      { input: "#forge:storage_blocks/iron", mod: "sophisticatedstorage" }, 
      "#forge:storage_blocks/iron", 
      "#forge:storage_blocks/silver" 
    );
    event.replaceInput(
      { input: "#forge:ingots/iron", mod: "sophisticatedbackpacks" }, 
      "#forge:ingots/iron", 
      "#forge:ingots/silver" 
    );
    event.replaceInput(
      { input: "#forge:storage_blocks/iron", mod: "sophisticatedbackpacks" }, 
      "#forge:storage_blocks/iron", 
      "#forge:storage_blocks/silver" 
    );
  
    // Tier 2 Upgrades Gold -> Dawnstone
    event.replaceInput(
      { input: "#forge:ingots/gold", mod: "sophisticatedstorage" }, 
      "#forge:ingots/gold", 
      "#forge:ingots/dawnstone" 
    );
    event.replaceInput(
      { input: "#forge:storage_blocks/gold", mod: "sophisticatedstorage" }, 
      "#forge:storage_blocks/gold", 
      "#forge:storage_blocks/dawnstone" 
    );
    event.replaceInput(
      { input: "#forge:ingots/gold", mod: "sophisticatedbackpacks" }, 
      "#forge:ingots/gold", 
      "#forge:ingots/dawnstone" 
    );
    event.replaceInput(
      { input: "#forge:storage_blocks/gold", mod: "sophisticatedbackpacks" }, 
      "#forge:storage_blocks/gold", 
      "#forge:storage_blocks/dawnstone" 
    );
  
    // Tier 3 Upgrades Diamond -> Enderium
    event.replaceInput(
      { input: "#forge:gems/diamond", mod: "sophisticatedstorage" }, 
      "#forge:gems/diamond", 
      "#forge:ingots/enderium" 
    );
    event.replaceInput(
      { input: "#forge:storage_blocks/diamond", mod: "sophisticatedstorage" }, 
      "#forge:storage_blocks/diamond", 
      "#forge:storage_blocks/enderium" 
    );
    event.replaceInput(
      { input: "#forge:gems/diamond", mod: "sophisticatedbackpacks" }, 
      "#forge:gems/diamond", 
      "#forge:ingots/enderium" 
    );
    event.replaceInput(
      { input: "#forge:storage_blocks/diamond", mod: "sophisticatedbackpacks" }, 
      "#forge:storage_blocks/diamond", 
      "#forge:storage_blocks/enderium" 
    );
  
    // Tier 4 Upgrades Netherite -> Ostrum
    event.replaceInput(
      { input: "#forge:ingots/netherite", mod: "sophisticatedstorage" }, 
      "#forge:ingots/netherite", 
      "#forge:ingots/ostrum" 
    );
    event.replaceInput(
      { input: "#forge:storage_blocks/netherite", mod: "sophisticatedstorage" }, 
      "#forge:storage_blocks/netherite", 
      "#forge:storage_blocks/ostrum" 
    );
    event.replaceInput(
      { input: "#forge:ingots/netherite", mod: "sophisticatedbackpacks" }, 
      "#forge:ingots/netherite", 
      "#forge:ingots/ostrum" 
    );
    event.replaceInput(
      { input: "#forge:storage_blocks/netherite", mod: "sophisticatedbackpacks" }, 
      "#forge:storage_blocks/netherite", 
      "#forge:storage_blocks/ostrum" 
    );
    event.replaceInput(
      { input: "#minecraft:logs", mod: "sophisticatedstorage" }, 
      "#minecraft:logs", 
      "spawn:rotten_planks" 
    );
  });
  