Shared Containers (#3331)
* Namespace changes for containers. Moved ContainerSlot from content to engine. * Merged client/server ContainerManagerComponents into a single shared version. * Mapfile and nullability fixes. * Upgrades map. * Update engine.
This commit is contained in:
@@ -22,6 +22,7 @@ using Content.Shared.Kitchen;
|
||||
using Content.Shared.Prototypes.Kitchen;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
@@ -83,7 +84,7 @@ namespace Content.Server.GameObjects.Components.Kitchen
|
||||
|
||||
Owner.EnsureComponent<SolutionContainerComponent>();
|
||||
|
||||
_storage = ContainerManagerComponent.Ensure<Container>("microwave_entity_container", Owner, out var existed);
|
||||
_storage = ContainerHelpers.EnsureContainer<Container>(Owner, "microwave_entity_container", out var existed);
|
||||
_audioSystem = EntitySystem.Get<AudioSystem>();
|
||||
|
||||
if (UserInterface != null)
|
||||
|
||||
@@ -16,6 +16,7 @@ using Content.Shared.Kitchen;
|
||||
using Content.Shared.Utility;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Serialization;
|
||||
@@ -78,11 +79,11 @@ namespace Content.Server.GameObjects.Components.Kitchen
|
||||
base.Initialize();
|
||||
//A slot for the beaker where the grounds/juices will go.
|
||||
_beakerContainer =
|
||||
ContainerManagerComponent.Ensure<ContainerSlot>($"{Name}-reagentContainerContainer", Owner);
|
||||
ContainerHelpers.EnsureContainer<ContainerSlot>(Owner, $"{Name}-reagentContainerContainer");
|
||||
|
||||
//A container for the things that WILL be ground/juiced. Useful for ejecting them instead of deleting them from the hands of the user.
|
||||
_chamber =
|
||||
ContainerManagerComponent.Ensure<Container>($"{Name}-entityContainerContainer", Owner);
|
||||
ContainerHelpers.EnsureContainer<Container>(Owner, $"{Name}-entityContainerContainer");
|
||||
|
||||
if (UserInterface != null)
|
||||
{
|
||||
@@ -242,7 +243,11 @@ namespace Content.Server.GameObjects.Components.Kitchen
|
||||
if (!HasBeaker || _heldBeaker == null || _busy)
|
||||
return;
|
||||
|
||||
_beakerContainer.Remove(_beakerContainer.ContainedEntity);
|
||||
var beaker = _beakerContainer.ContainedEntity;
|
||||
if(beaker is null)
|
||||
return;
|
||||
|
||||
_beakerContainer.Remove(beaker);
|
||||
|
||||
if (user == null || !user.TryGetComponent<HandsComponent>(out var hands) || !_heldBeaker.Owner.TryGetComponent<ItemComponent>(out var item))
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user