Content update for NetEntities (#18935)

This commit is contained in:
metalgearsloth
2023-09-11 09:42:41 +10:00
committed by GitHub
parent 389c8d1a2c
commit 5a0fc68be2
526 changed files with 3058 additions and 2215 deletions

View File

@@ -9,6 +9,8 @@ namespace Content.Server.Administration.Commands
[AdminCommand(AdminFlags.Fun)]
public sealed class SetSolutionCapacity : IConsoleCommand
{
[Dependency] private readonly IEntityManager _entManager = default!;
public string Command => "setsolutioncapacity";
public string Description => "Set the capacity (maximum volume) of some solution.";
public string Help => $"Usage: {Command} <target> <solution> <new capacity>";
@@ -21,13 +23,13 @@ namespace Content.Server.Administration.Commands
return;
}
if (!EntityUid.TryParse(args[0], out var uid))
if (!NetEntity.TryParse(args[0], out var uidNet))
{
shell.WriteLine($"Invalid entity id.");
return;
}
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(uid, out SolutionContainerManagerComponent? man))
if (!_entManager.TryGetEntity(uidNet, out var uid) || !_entManager.TryGetComponent(uid, out SolutionContainerManagerComponent? man))
{
shell.WriteLine($"Entity does not have any solutions.");
return;
@@ -54,7 +56,7 @@ namespace Content.Server.Administration.Commands
}
var quantity = FixedPoint2.New(quantityFloat);
EntitySystem.Get<SolutionContainerSystem>().SetCapacity(uid, solution, quantity);
_entManager.System<SolutionContainerSystem>().SetCapacity(uid.Value, solution, quantity);
}
}
}