Revert the other arch changes (#21871)
This commit is contained in:
@@ -11,9 +11,6 @@ namespace Content.Server.Sandbox.Commands
|
||||
[AnyCommand]
|
||||
public sealed class ColorNetworkCommand : IConsoleCommand
|
||||
{
|
||||
[Dependency] private readonly IAdminManager _adminManager = default!;
|
||||
[Dependency] private readonly IEntityManager _entManager = default!;
|
||||
|
||||
public string Command => "colornetwork";
|
||||
public string Description => Loc.GetString("color-network-command-description");
|
||||
public string Help => Loc.GetString("color-network-command-help-text", ("command",Command));
|
||||
@@ -33,21 +30,25 @@ namespace Content.Server.Sandbox.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
var entityManager = IoCManager.Resolve<IEntityManager>();
|
||||
|
||||
if (!int.TryParse(args[0], out var targetId))
|
||||
{
|
||||
shell.WriteLine(Loc.GetString("shell-argument-must-be-number"));
|
||||
return;
|
||||
}
|
||||
|
||||
var nent = new NetEntity(targetId);
|
||||
var eUid = new EntityUid(targetId);
|
||||
|
||||
if (!_entManager.TryGetEntity(nent, out var eUid))
|
||||
if (!eUid.IsValid() || !entityManager.EntityExists(eUid))
|
||||
{
|
||||
shell.WriteLine(Loc.GetString("shell-invalid-entity-id"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (!_entManager.TryGetComponent(eUid, out NodeContainerComponent? nodeContainerComponent))
|
||||
if (!entityManager.TryGetComponent(eUid, out NodeContainerComponent? nodeContainerComponent))
|
||||
{
|
||||
shell.WriteLine(Loc.GetString("shell-entity-is-not-node-container"));
|
||||
return;
|
||||
@@ -73,15 +74,13 @@ namespace Content.Server.Sandbox.Commands
|
||||
{
|
||||
var group = nodeContainerComponent.Nodes[nodeGroupId.ToString().ToLower()].NodeGroup;
|
||||
|
||||
if (group == null)
|
||||
return;
|
||||
if (group == null) return;
|
||||
|
||||
foreach (var x in group.Nodes)
|
||||
{
|
||||
if (!_entManager.TryGetComponent(x.Owner, out AtmosPipeColorComponent? atmosPipeColorComponent))
|
||||
continue;
|
||||
if (!IoCManager.Resolve<IEntityManager>().TryGetComponent(x.Owner, out AtmosPipeColorComponent? atmosPipeColorComponent)) continue;
|
||||
|
||||
_entManager.System<AtmosPipeColorSystem>().SetColor(x.Owner, atmosPipeColorComponent, color);
|
||||
EntitySystem.Get<AtmosPipeColorSystem>().SetColor(x.Owner, atmosPipeColorComponent, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user