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) public SpawnerEntry(BaseSpawner parent)
{ {
_parent = 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( public SpawnerEntry(
BaseSpawner parent, BaseSpawner parent,
string name, string name,
int probability, int probability = 100,
int maxcount, int maxCount = 1,
string properties = null, string properties = null,
string parameters = null string parameters = null
) : this(parent) ) : this(parent)
{ {
SpawnedName = name; SpawnedName = name;
SpawnedProbability = probability; SpawnedProbability = probability;
SpawnedMaxCount = maxcount; SpawnedMaxCount = maxCount;
Properties = properties; Properties = properties;
Parameters = parameters; Parameters = parameters;
} }