Prevent erroneous materials from being placed in lathes. (#9454)

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
Nemanja
2022-07-06 23:44:31 -04:00
committed by GitHub
parent 9800701978
commit 52d2cc1de2
4 changed files with 44 additions and 6 deletions

View File

@@ -3,6 +3,9 @@ using Content.Shared.Research.Prototypes;
using Robust.Server.GameObjects;
using Content.Shared.Sound;
using Content.Shared.Whitelist;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
using Content.Shared.Materials;
namespace Content.Server.Lathe.Components
{
@@ -16,6 +19,13 @@ namespace Content.Server.Lathe.Components
[DataField("whitelist")]
public EntityWhitelist? LatheWhitelist;
/// <summary>
/// Whitelist generated on runtime for what items are specifically used for the lathe's recipes.
/// </summary>
[ViewVariables]
[DataField("materialWhiteList", customTypeSerializer: typeof(PrototypeIdListSerializer<MaterialPrototype>))]
public List<string> MaterialWhiteList = new();
/// <summary>
/// The lathe's construction queue
/// </summary>
@@ -60,4 +70,4 @@ namespace Content.Server.Lathe.Components
/// </summary>
[ViewVariables] public BoundUserInterface? UserInterface;
}
}
}