Skip to content

Commit

Permalink
Undo accidental reversion
Browse files Browse the repository at this point in the history
whoops
  • Loading branch information
drfiveminusmint committed May 26, 2024
1 parent 0e79d4b commit 47a62ae
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class SiegeConfig {
@NotNull private final String captureRegion;
@NotNull private final List<Integer> daysOfWeek;
@NotNull private final List<String> craftsToWin, commandsOnStart, commandsOnWin, commandsOnLose;
private final int scheduleStart, scheduleEnd, delayBeforeStart, duration, dailyIncome, cost;
private final int scheduleStart, scheduleEnd, delayBeforeStart, duration, dailyIncome, cost, suddenDeathDuration;
private final boolean doubleCostPerOwnedSiegeRegion;

public SiegeConfig(ConfigurationSection config) {
Expand Down Expand Up @@ -61,6 +61,16 @@ public SiegeConfig(ConfigurationSection config) {
if(!config.isBoolean("DoubleCostPerOwnedSiegeRegion"))
throw new IllegalArgumentException("Invalid DoubleCostPerOwnedSiegeRegion");
doubleCostPerOwnedSiegeRegion = config.getBoolean("DoubleCostPerOwnedSiegeRegion");

// Since this is a new addition to the siege file and optional,
// get it if present but ignore it if not
if (config.contains("SiegeSuddenDeathDuration")) {
if(!config.isInt("SiegeSuddenDeathDuration"))
throw new IllegalArgumentException("Invalid SiegeSuddenDeathDuration");
suddenDeathDuration = config.getInt("SiegeSuddenDeathDuration");
} else {
suddenDeathDuration = 0;
}
}

@NotNull
Expand Down Expand Up @@ -122,6 +132,10 @@ public int getCost() {
return cost;
}

public int getSuddenDeathDuration() {
return suddenDeathDuration;
}

public boolean isDoubleCostPerOwnedSiegeRegion() {
return doubleCostPerOwnedSiegeRegion;
}
Expand Down

0 comments on commit 47a62ae

Please sign in to comment.