diff --git a/pom.xml b/pom.xml index 47c05b423..85fae01fa 100644 --- a/pom.xml +++ b/pom.xml @@ -2,14 +2,14 @@ 4.0.0 com.gmail.goosius SiegeWar - 2.11.1 + 2.12.0 siegewar 1.8 1.13 UTF-8 - 0.100.2.0 + 0.100.3.0 @@ -45,7 +45,7 @@ com.palmergames.bukkit.towny towny - 0.100.2.0 + 0.100.3.0 provided diff --git a/src/main/java/com/gmail/goosius/siegewar/SiegeWar.java b/src/main/java/com/gmail/goosius/siegewar/SiegeWar.java index 065017df6..d54b049e4 100644 --- a/src/main/java/com/gmail/goosius/siegewar/SiegeWar.java +++ b/src/main/java/com/gmail/goosius/siegewar/SiegeWar.java @@ -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; diff --git a/src/main/java/com/gmail/goosius/siegewar/TownOccupationController.java b/src/main/java/com/gmail/goosius/siegewar/TownOccupationController.java index e5225ae20..70400326f 100644 --- a/src/main/java/com/gmail/goosius/siegewar/TownOccupationController.java +++ b/src/main/java/com/gmail/goosius/siegewar/TownOccupationController.java @@ -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; @@ -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; } @@ -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; } } diff --git a/src/main/java/com/gmail/goosius/siegewar/playeractions/PlunderTown.java b/src/main/java/com/gmail/goosius/siegewar/playeractions/PlunderTown.java index cee963269..71e39757d 100644 --- a/src/main/java/com/gmail/goosius/siegewar/playeractions/PlunderTown.java +++ b/src/main/java/com/gmail/goosius/siegewar/playeractions/PlunderTown.java @@ -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; @@ -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); } diff --git a/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarMoneyUtil.java b/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarMoneyUtil.java index af93d90b8..004c901c3 100644 --- a/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarMoneyUtil.java +++ b/src/main/java/com/gmail/goosius/siegewar/utils/SiegeWarMoneyUtil.java @@ -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; @@ -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; } @@ -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); } }