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

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