Skip to content

Commit

Permalink
Bump min. Towny version to 0.100.3.0. (#914)
Browse files Browse the repository at this point in the history
  • Loading branch information
LlmDl authored Jun 22, 2024
1 parent 21645d1 commit 3b29c6d
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.gmail.goosius</groupId>
<artifactId>SiegeWar</artifactId>
<version>2.11.1</version>
<version>2.12.0</version>
<name>siegewar</name> <!-- Leave lower-cased -->

<properties>
<java.version>1.8</java.version>
<project.bukkitAPIVersion>1.13</project.bukkitAPIVersion>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<towny.version>0.100.2.0</towny.version>
<towny.version>0.100.3.0</towny.version>
</properties>

<repositories>
Expand Down Expand Up @@ -45,7 +45,7 @@
<dependency>
<groupId>com.palmergames.bukkit.towny</groupId>
<artifactId>towny</artifactId>
<version>0.100.2.0</version>
<version>0.100.3.0</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/gmail/goosius/siegewar/SiegeWar.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
public class SiegeWar extends JavaPlugin {

private static SiegeWar plugin;
private final String requiredTownyVersion = "0.100.1.0";
private final String requiredTownyVersion = "0.100.3.0";
private static final SiegeHUDManager siegeHUDManager = new SiegeHUDManager();
private final Object scheduler;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.palmergames.bukkit.towny.TownyMessaging;
import com.palmergames.bukkit.towny.TownySettings;
import com.palmergames.bukkit.towny.TownyUniverse;
import com.palmergames.bukkit.towny.event.DeleteTownEvent.Cause;
import com.palmergames.bukkit.towny.exceptions.AlreadyRegisteredException;
import com.palmergames.bukkit.towny.object.Nation;
import com.palmergames.bukkit.towny.object.Town;
Expand Down Expand Up @@ -144,7 +145,7 @@ private static double collectNationOccupationTax(Nation nation, double taxPerPlo
// The Town cannot afford to pay the nation occupation tax.
Messaging.sendGlobalMessage(Translatable.of("msg_occupation_tax_cannot_be_paid", town.getName()));
removeTownOccupation(town);
TownyUniverse.getInstance().getDataSource().removeTown(town);
TownyUniverse.getInstance().getDataSource().removeTown(town, Cause.BANKRUPTCY);
return 0;
}

Expand All @@ -162,7 +163,7 @@ private static double collectNationOccupationTax(Nation nation, double taxPerPlo
} else {
Messaging.sendGlobalMessage(Translatable.of("msg_occupation_tax_cannot_be_paid", town.getName()));
removeTownOccupation(town);
TownyUniverse.getInstance().getDataSource().removeTown(town);
TownyUniverse.getInstance().getDataSource().removeTown(town, Cause.BANKRUPTCY);
return 0;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.palmergames.bukkit.towny.TownyMessaging;
import com.palmergames.bukkit.towny.TownySettings;
import com.palmergames.bukkit.towny.TownyUniverse;
import com.palmergames.bukkit.towny.event.DeleteTownEvent.Cause;
import com.palmergames.bukkit.towny.exceptions.TownyException;
import com.palmergames.bukkit.towny.object.EconomyAccount;
import com.palmergames.bukkit.towny.object.Nation;
Expand Down Expand Up @@ -155,7 +156,7 @@ private static void plunderTown(Siege siege, Nation nation) {

//Save data
if(townDestroyed) {
TownyUniverse.getInstance().getDataSource().removeTown(town);
TownyUniverse.getInstance().getDataSource().removeTown(town, Cause.BANKRUPTCY);
} else {
SiegeController.saveSiege(siege);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.palmergames.bukkit.towny.TownyMessaging;
import com.palmergames.bukkit.towny.TownySettings;
import com.palmergames.bukkit.towny.TownyUniverse;
import com.palmergames.bukkit.towny.event.DeleteTownEvent.Cause;
import com.palmergames.bukkit.towny.exceptions.TownyException;
import com.palmergames.bukkit.towny.object.Government;
import com.palmergames.bukkit.towny.object.Nation;
Expand Down Expand Up @@ -330,7 +331,7 @@ private static void payPlunderDebt(Town town, double amount) {
if (town.getAccount().getHoldingBalance() - amount < debtCap * -1) {
// The Town cannot afford to pay their plunder debt.
Messaging.sendGlobalMessage(Translatable.of("msg_plunder_debt_cannot_be_payed", town.getName()));
TownyUniverse.getInstance().getDataSource().removeTown(town);
TownyUniverse.getInstance().getDataSource().removeTown(town, Cause.BANKRUPTCY);
return;
}

Expand All @@ -340,7 +341,7 @@ private static void payPlunderDebt(Town town, double amount) {

} else {
Messaging.sendGlobalMessage(Translatable.of("msg_plunder_debt_cannot_be_payed", town.getName()));
TownyUniverse.getInstance().getDataSource().removeTown(town);
TownyUniverse.getInstance().getDataSource().removeTown(town, Cause.BANKRUPTCY);
}
}

Expand Down

0 comments on commit 3b29c6d

Please sign in to comment.