diff --git a/Libraries/SPTarkov.Server.Core/Generators/BotEquipmentModGenerator.cs b/Libraries/SPTarkov.Server.Core/Generators/BotEquipmentModGenerator.cs index 84deeb9c..ae78a417 100644 --- a/Libraries/SPTarkov.Server.Core/Generators/BotEquipmentModGenerator.cs +++ b/Libraries/SPTarkov.Server.Core/Generators/BotEquipmentModGenerator.cs @@ -1488,7 +1488,7 @@ public class BotEquipmentModGenerator( /// e.g. mod_magazine / patron_in_weapon_000 /// /// string array - public FrozenSet GetAmmoContainers() + public static FrozenSet GetAmmoContainers() { return _cartridgeHolderSlots; } diff --git a/Libraries/SPTarkov.Server.Core/Helpers/ItemHelper.cs b/Libraries/SPTarkov.Server.Core/Helpers/ItemHelper.cs index 13cbd94d..bf84819c 100644 --- a/Libraries/SPTarkov.Server.Core/Helpers/ItemHelper.cs +++ b/Libraries/SPTarkov.Server.Core/Helpers/ItemHelper.cs @@ -452,7 +452,7 @@ public class ItemHelper( // Get all soft insert slot ids // @returns A List of soft insert ids (e.g. soft_armor_back, helmet_top) - public FrozenSet GetSoftInsertSlotIds() + public static FrozenSet GetSoftInsertSlotIds() { return _softInsertIds; } @@ -1981,7 +1981,7 @@ public class ItemHelper( // Get a list of slot names that hold removable plates // Returns Array of slot ids (e.g. front_plate) - public FrozenSet GetRemovablePlateSlotIds() + public static FrozenSet GetRemovablePlateSlotIds() { return _removablePlateSlotIds; } diff --git a/Libraries/SPTarkov.Server.Core/Utils/JsonUtil.cs b/Libraries/SPTarkov.Server.Core/Utils/JsonUtil.cs index 409d9ea8..61d0504f 100644 --- a/Libraries/SPTarkov.Server.Core/Utils/JsonUtil.cs +++ b/Libraries/SPTarkov.Server.Core/Utils/JsonUtil.cs @@ -55,7 +55,7 @@ public class JsonUtil } }; - private static JsonSerializerOptions jsonSerializerOptionsIndented = new(jsonSerializerOptionsNoIndent) + protected static JsonSerializerOptions jsonSerializerOptionsIndented = new(jsonSerializerOptionsNoIndent) { WriteIndented = true }; @@ -147,18 +147,19 @@ public class JsonUtil /// Convert an object into JSON /// /// Object to serialise - /// Type of object being serialsied + /// Type of object being serialized /// Should JSON be indented - /// + /// Serialized text public string? Serialize(object? obj, Type type, bool indented = false) { return obj == null ? null : JsonSerializer.Serialize(obj, type, indented ? jsonSerializerOptionsIndented : jsonSerializerOptionsNoIndent); } - private void AddConverter(JsonSerializerOptions options, JsonConverter newConverter) + protected static void AddConverter(JsonSerializerOptions options, JsonConverter newConverter) { - if (!options.Converters.Any(c => c.GetType() == newConverter.GetType())) + if (options.Converters.All(c => c.GetType() != newConverter.GetType())) { + // Doesn't exist, add options.Converters.Add(newConverter); } }