fix: Fixes importing spawners (#1689)

This commit is contained in:
Kamron Batman 2024-02-19 10:07:51 -08:00 committed by GitHub
parent 1fdef9f389
commit de0d205fd3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -38,21 +38,32 @@ public partial class SpawnerEntry
public SpawnerEntry(BaseSpawner parent)
{
_parent = parent;
_spawned = new List<ISpawnable>();
_spawned = [];
}
[JsonConstructor]
public SpawnerEntry(
string spawnedName,
int spawnedProbability = 100,
int spawnedMaxCount = 1,
string properties = null,
string parameters = null
) : this(null, spawnedName, spawnedProbability, spawnedMaxCount, properties, parameters)
{
}
public SpawnerEntry(
BaseSpawner parent,
string name,
int probability,
int maxcount,
int probability = 100,
int maxCount = 1,
string properties = null,
string parameters = null
) : this(parent)
{
SpawnedName = name;
SpawnedProbability = probability;
SpawnedMaxCount = maxcount;
SpawnedMaxCount = maxCount;
Properties = properties;
Parameters = parameters;
}