diff --git a/Penumbra/Collections/Cache/MetaCache.cs b/Penumbra/Collections/Cache/MetaCache.cs index abb77f9d..514e2589 100644 --- a/Penumbra/Collections/Cache/MetaCache.cs +++ b/Penumbra/Collections/Cache/MetaCache.cs @@ -111,7 +111,7 @@ public class MetaCache : IDisposable, IEnumerable Default, CollectionType.Interface => Interface, CollectionType.Current => Current, - CollectionType.Individual when individualIndex >= 0 && individualIndex < Individuals.Count => Individuals[individualIndex].Collection, - CollectionType.Individual => null, + CollectionType.Individual when individualIndex >= 0 && individualIndex < Individuals.Count => Individuals[individualIndex] + .Collection, + CollectionType.Individual => null, _ when collectionType.IsSpecial() => SpecialCollections[(int)collectionType] ?? Default, _ => null, }; @@ -433,7 +439,7 @@ public class ActiveCollections : ISavable, IDisposable { case IdentifierType.Player when id.HomeWorld != ushort.MaxValue: { - var global = ByType(CollectionType.Individual, Penumbra.Actors.CreatePlayer(id.PlayerName, ushort.MaxValue)); + var global = ByType(CollectionType.Individual, _actors.AwaitedService.CreatePlayer(id.PlayerName, ushort.MaxValue)); return global?.Index == checkAssignment.Index ? "Assignment is redundant due to an identical Any-World assignment existing.\nYou can remove it." : string.Empty; @@ -442,12 +448,12 @@ public class ActiveCollections : ISavable, IDisposable if (id.HomeWorld != ushort.MaxValue) { var global = ByType(CollectionType.Individual, - Penumbra.Actors.CreateOwned(id.PlayerName, ushort.MaxValue, id.Kind, id.DataId)); + _actors.AwaitedService.CreateOwned(id.PlayerName, ushort.MaxValue, id.Kind, id.DataId)); if (global?.Index == checkAssignment.Index) return "Assignment is redundant due to an identical Any-World assignment existing.\nYou can remove it."; } - var unowned = ByType(CollectionType.Individual, Penumbra.Actors.CreateNpc(id.Kind, id.DataId)); + var unowned = ByType(CollectionType.Individual, _actors.AwaitedService.CreateNpc(id.Kind, id.DataId)); return unowned?.Index == checkAssignment.Index ? "Assignment is redundant due to an identical unowned NPC assignment existing.\nYou can remove it." : string.Empty; diff --git a/Penumbra/Collections/Manager/TempCollectionManager.cs b/Penumbra/Collections/Manager/TempCollectionManager.cs index 34a8db3c..0416b4b7 100644 --- a/Penumbra/Collections/Manager/TempCollectionManager.cs +++ b/Penumbra/Collections/Manager/TempCollectionManager.cs @@ -17,11 +17,13 @@ public class TempCollectionManager : IDisposable private readonly CommunicatorService _communicator; private readonly CollectionStorage _storage; + private readonly ActorService _actors; private readonly Dictionary _customCollections = new(); public TempCollectionManager(Configuration config, CommunicatorService communicator, ActorService actors, CollectionStorage storage) { _communicator = communicator; + _actors = actors; _storage = storage; Collections = new IndividualCollections(actors, config); @@ -97,7 +99,6 @@ public class TempCollectionManager : IDisposable Penumbra.Log.Verbose($"Assigned temporary collection {collection.AnonymizedName} to {Collections.Last().DisplayName}."); _communicator.CollectionChange.Invoke(CollectionType.Temporary, null, collection, Collections.Last().DisplayName); return true; - } public bool AddIdentifier(string collectionName, params ActorIdentifier[] identifiers) @@ -113,7 +114,7 @@ public class TempCollectionManager : IDisposable if (!ByteString.FromString(characterName, out var byteString, false)) return false; - var identifier = Penumbra.Actors.CreatePlayer(byteString, worldId); + var identifier = _actors.AwaitedService.CreatePlayer(byteString, worldId); if (!identifier.IsValid) return false; @@ -125,7 +126,7 @@ public class TempCollectionManager : IDisposable if (!ByteString.FromString(characterName, out var byteString, false)) return false; - var identifier = Penumbra.Actors.CreatePlayer(byteString, worldId); + var identifier = _actors.AwaitedService.CreatePlayer(byteString, worldId); return Collections.TryGetValue(identifier, out var collection) && RemoveTemporaryCollection(collection.Name); } } diff --git a/Penumbra/Penumbra.cs b/Penumbra/Penumbra.cs index 5dd865a2..3eb83f65 100644 --- a/Penumbra/Penumbra.cs +++ b/Penumbra/Penumbra.cs @@ -39,7 +39,6 @@ public class Penumbra : IDalamudPlugin public static CharacterUtility CharacterUtility { get; private set; } = null!; public static CollectionManager CollectionManager { get; private set; } = null!; - public static ActorManager Actors { get; private set; } = null!; public readonly RedrawService RedrawService; public readonly ModFileSystem ModFileSystem; @@ -68,7 +67,6 @@ public class Penumbra : IDalamudPlugin _tmp.Services.GetRequiredService(); _config = _tmp.Services.GetRequiredService(); CharacterUtility = _tmp.Services.GetRequiredService(); - Actors = _tmp.Services.GetRequiredService().AwaitedService; _tempMods = _tmp.Services.GetRequiredService(); _residentResources = _tmp.Services.GetRequiredService(); _tmp.Services.GetRequiredService();