# SPDX-FileCopyrightText: 2020 Peter Wedder <burneddi@gmail.com>
# SPDX-FileCopyrightText: 2020 namespace-Memory <66768086+namespace-Memory@users.noreply.github.com>
# SPDX-FileCopyrightText: 2020 scuffedjays <yetanotherscuffed@gmail.com>
# SPDX-FileCopyrightText: 2021 20kdc <asdd2808@gmail.com>
# SPDX-FileCopyrightText: 2021 Acruid <shatter66@gmail.com>
# SPDX-FileCopyrightText: 2021 Metal Gear Sloth <metalgearsloth@gmail.com>
# SPDX-FileCopyrightText: 2021 Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
# SPDX-FileCopyrightText: 2021 Swept <sweptwastaken@protonmail.com>
# SPDX-FileCopyrightText: 2021 SweptWasTaken <sweptwastaken@protonmail.com>
# SPDX-FileCopyrightText: 2021 Vera Aguilera Puerto <6766154+Zumorica@users.noreply.github.com>
# SPDX-FileCopyrightText: 2021 Vera Aguilera Puerto <zddm@outlook.es>
# SPDX-FileCopyrightText: 2021 Visne <39844191+Visne@users.noreply.github.com>
# SPDX-FileCopyrightText: 2021 metalgearsloth <comedian_vs_clown@hotmail.com>
# SPDX-FileCopyrightText: 2022 0x6273 <0x40@keemail.me>
# SPDX-FileCopyrightText: 2022 Jacob Tong <10494922+ShadowCommander@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Leon Friedrich <60421075+ElectroJr@users.noreply.github.com>
# SPDX-FileCopyrightText: 2022 Peptide90 <78795277+Peptide90@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 Jeff <velcroboy333@hotmail.com>
# SPDX-FileCopyrightText: 2023 Nemanja <98561806+EmoGarbage404@users.noreply.github.com>
# SPDX-FileCopyrightText: 2023 TemporalOroboros <TemporalOroboros@gmail.com>
# SPDX-FileCopyrightText: 2023 Velcroboy <107660393+ChilbroBaggins@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Aidenkrz <aiden@djkraz.com>
# SPDX-FileCopyrightText: 2024 Boaz1111 <149967078+Boaz1111@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 Cojoke <83733158+Cojoke-dot@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 LucasTheDrgn <kirbyfan.95@gmail.com>
# SPDX-FileCopyrightText: 2024 OnyxTheBrave <131422822+OnyxTheBrave@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 ShadowCommander <10494922+ShadowCommander@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 lzk <124214523+lzk228@users.noreply.github.com>
# SPDX-FileCopyrightText: 2024 metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
# SPDX-FileCopyrightText: 2025 GoobBot <uristmchands@proton.me>
# SPDX-FileCopyrightText: 2025 deltanedas <@deltanedas:kde.org>
# SPDX-FileCopyrightText: 2025 Łukasz Lindert <lukasz.lindert@protonmail.com>
#
# SPDX-License-Identifier: AGPL-3.0-or-later

- type: entity
  id: KitchenReagentGrinder
  parent: [ BaseMachinePowered, SmallConstructibleMachine ]
  name: reagent grinder
  description: From BlenderTech. Will It Blend? Let's find out!
  suffix: grinder/juicer
  components:
  - type: ReagentGrinder
  - type: ActivatableUI
    key: enum.ReagentGrinderUiKey.Key
  - type: UserInterface
    interfaces:
      enum.ReagentGrinderUiKey.Key:
        type: ReagentGrinderBoundUserInterface
  - type: Appearance
  - type: GenericVisualizer
    visuals:
      enum.ReagentGrinderVisualState.BeakerAttached:
        grinder:
          True: {state: "grinder_beaker_attached"}
          False: {state: "grinder_empty"}
  - type: Physics
  - type: Fixtures
    fixtures:
      fix1:
        shape:
          !type:PhysShapeAabb
          bounds: "-0.17,0,0.20,0.4"
        mask:
        - TabletopMachineMask
        layer:
        - TabletopMachineLayer
  - type: Sprite
    sprite: Structures/Machines/grinder.rsi
    drawdepth: LargeObjects
    snapCardinals: true
    offset: "0.0,0.4"
    layers:
    - map: [ "grinder" ]
      state: "grinder_empty"
    - map: [ "enum.SolutionContainerLayers.Fill" ]
      state: beakerSlot1
  - type: SolutionContainerVisuals # Goobstation
    maxFillLevels: 4
    insertedItemSlotID: beakerSlot
    fillBaseName: beakerSlot
  - type: ApcPowerReceiver
    powerLoad: 300
  - type: ItemSlots
    slots:
      beakerSlot:
        whitelist:
          components:
          - FitsInDispenser
  - type: AutomationSlots # Goobstation
    slots:
    - !type:AutomatedItemSlot
      input: AutomationSlotBeaker
      output: AutomationSlotBeaker
      slotId: beakerSlot
    - !type:AutomatedContainer
      input: AutomationSlotInput
      output: AutomationSlotInput
      whitelist:
        components:
        - Extractable # shitcode doesnt require this with container attempt events just in interaction
      containerId: inputContainer
      maxItems: 6 # manually have to sync it with ReagentGrinderComponent :)
    - !type:AutomatedBeakerSlot
      input: PlumbingDispenser
      output: PlumbingDispenser
  - type: Machine
    board: ReagentGrinderMachineCircuitboard
  - type: ContainerContainer
    containers:
      beakerSlot: !type:ContainerSlot
      inputContainer: !type:Container
      machine_board: !type:Container
      machine_parts: !type:Container

- type: entity
  parent: Recycler #too different so different parent
  id: ReagentGrinderIndustrial
  name: industrial reagent grinder
  description: An industrial reagent grinder.
  components:
  - type: SolutionContainerManager
    solutions:
      output:
        maxVol: 400 #*slaps roof of machine* This baby can fit so much omnizine in it
  - type: MaterialReclaimer
    whitelist:
      components:
      - Extractable #same as reagent grinder
    blacklist:
      tags:
      - HighRiskItem #ian meat
    efficiency: 0.9
    onlyReclaimDrainable: false
    solutionContainerId: output
  - type: Sprite
    sprite: Structures/Machines/recycling.rsi
    layers:
      - state: grinder-b0
  - type: AutomationSlots # Goobstation
    slots:
    - !type:AutomatedSolution
      output: PlumbingOutput
      solutionName: output
  - type: Machine
    board: ReagentGrinderIndustrialMachineCircuitboard
  - type: GenericVisualizer
    visuals:
      enum.ConveyorVisuals.State:
        enum.ConveyorState.Off:
          Forward: { state: grinder-b1 }
          Reverse: { state: grinder-b1 }
          Off: { state: grinder-b0 }
  - type: ContainerContainer
    containers:
      machine_board: !type:Container
      machine_parts: !type:Container
  - type: Construction
    graph: Machine
    node: machine
    containers:
    - machine_parts
    - machine_board
  - type: DrainableSolution
    solution: output
  - type: ExaminableSolution
    solution: output
