unbreaking via deprecation

This commit is contained in:
Zoë Gidiere
2023-09-30 11:50:15 -06:00
parent 99d848b394
commit e9b145b6c3
2 changed files with 19 additions and 4 deletions

View File

@@ -28,8 +28,12 @@ public class SpawnSettingsTemplate implements ObjectTemplate<SpawnSettings> {
SpawnSettings.Builder builder = new SpawnSettings.Builder();
for(SpawnTypeConfig spawn : spawns) {
SpawnGroup group = spawn.getGroup();
for (SpawnEntry entry : spawn.getEntry()) {
builder.spawn(group, entry);
if (spawn.getEntries() != null) {
for (SpawnEntry entry : spawn.getEntries()) {
builder.spawn(group, entry);
}
} else if (spawn.getEntry() != null) {
builder.spawn(group, spawn.getEntry());
}
}
for(SpawnCostConfig cost : costs) {

View File

@@ -16,13 +16,24 @@ public class SpawnTypeConfig implements ObjectTemplate<SpawnTypeConfig> {
@Value("entries")
@Default
private List<SpawnEntry> entry = null;
private List<SpawnEntry> entries = null;
@Value("entry")
@Default
@Deprecated
private SpawnEntry entry = null;
public SpawnGroup getGroup() {
return group;
}
public List<SpawnEntry> getEntry() {
public List<SpawnEntry> getEntries() {
return entries;
}
@Deprecated
public SpawnEntry getEntry() {
return entry;
}