diff --git a/Content.Server/Materials/MaterialReclaimerSystem.cs b/Content.Server/Materials/MaterialReclaimerSystem.cs index f6abcad7bc..d179284595 100644 --- a/Content.Server/Materials/MaterialReclaimerSystem.cs +++ b/Content.Server/Materials/MaterialReclaimerSystem.cs @@ -258,9 +258,22 @@ public sealed class MaterialReclaimerSystem : SharedMaterialReclaimerSystem } // if the item we inserted has reagents, add it in. - if (_solutionContainer.TryGetDrainableSolution(item, out _, out var drainableSolution)) + + if (reclaimerComponent.OnlyReclaimDrainable) { - totalChemicals.AddSolution(drainableSolution, _prototype); + // Are we a recycler? Only use drainable solution. + if (_solutionContainer.TryGetDrainableSolution(item, out _, out var drainableSolution)) + { + totalChemicals.AddSolution(drainableSolution, _prototype); + } + } + else + { + // Are we an industrial reagent grinder? Use extractable solution. + if (_solutionContainer.TryGetExtractableSolution(item, out _, out var extractableSolution)) + { + totalChemicals.AddSolution(extractableSolution, _prototype); + } } if (!_solutionContainer.TryGetSolution(reclaimer, reclaimerComponent.SolutionContainerId, out var outputSolution) || diff --git a/Content.Shared/Chemistry/EntitySystems/SharedSolutionContainerSystem.Capabilities.cs b/Content.Shared/Chemistry/EntitySystems/SharedSolutionContainerSystem.Capabilities.cs index ce0cfab002..ffdb608875 100644 --- a/Content.Shared/Chemistry/EntitySystems/SharedSolutionContainerSystem.Capabilities.cs +++ b/Content.Shared/Chemistry/EntitySystems/SharedSolutionContainerSystem.Capabilities.cs @@ -1,4 +1,5 @@ using Content.Shared.Chemistry.Components; +using Content.Shared.Kitchen.Components; using Content.Shared.Chemistry.Components.SolutionManager; using Content.Shared.Chemistry.Reaction; using Content.Shared.FixedPoint; @@ -34,6 +35,17 @@ public abstract partial class SharedSolutionContainerSystem return TryGetSolution((entity.Owner, entity.Comp2), entity.Comp1.Solution, out soln, out solution); } + public bool TryGetExtractableSolution(Entity entity, [NotNullWhen(true)] out Entity? soln, [NotNullWhen(true)] out Solution? solution) + { + if (!Resolve(entity, ref entity.Comp1, logMissing: false)) + { + (soln, solution) = (default!, null); + return false; + } + + return TryGetSolution((entity.Owner, entity.Comp2), entity.Comp1.GrindableSolution, out soln, out solution); + } + public bool TryGetDumpableSolution(Entity entity, [NotNullWhen(true)] out Entity? soln, [NotNullWhen(true)] out Solution? solution) { if (!Resolve(entity, ref entity.Comp1, logMissing: false)) diff --git a/Content.Shared/Materials/MaterialReclaimerComponent.cs b/Content.Shared/Materials/MaterialReclaimerComponent.cs index 372cd114ab..f48a1cb478 100644 --- a/Content.Shared/Materials/MaterialReclaimerComponent.cs +++ b/Content.Shared/Materials/MaterialReclaimerComponent.cs @@ -69,6 +69,13 @@ public sealed partial class MaterialReclaimerComponent : Component [DataField] public string? SolutionContainerId; + /// + /// If the reclaimer should attempt to reclaim all solutions or just drainable ones + /// Difference between Recycler and Industrial Reagent Grinder + /// + [DataField] + public bool OnlyReclaimDrainable = true; + /// /// a whitelist for what entities can be inserted into this reclaimer /// diff --git a/Resources/Prototypes/Entities/Structures/Machines/reagent_grinder.yml b/Resources/Prototypes/Entities/Structures/Machines/reagent_grinder.yml index 28aa464d21..39ab6a3276 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/reagent_grinder.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/reagent_grinder.yml @@ -75,6 +75,8 @@ tags: - HighRiskItem #ian meat efficiency: 0.9 + onlyReclaimDrainable: false + solutionContainerId: output - type: Sprite sprite: Structures/Machines/recycling.rsi layers: