Skip to content

Commit

Permalink
-1 -1 -1
Browse files Browse the repository at this point in the history
  • Loading branch information
Warriorrrr committed Mar 16, 2024
1 parent fae5a7a commit 097e030
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Towny/src/main/java/com/palmergames/bukkit/towny/object/Town.java
Original file line number Diff line number Diff line change
Expand Up @@ -1078,7 +1078,10 @@ public final double getForSalePrice() {
}

public void setPlotPrice(double plotPrice) {
this.plotPrice = Math.min(Math.max(plotPrice, -1), TownySettings.getMaxPlotPrice());
if (plotPrice < 0)
plotPrice = -1;

this.plotPrice = Math.min(plotPrice, TownySettings.getMaxPlotPrice());
}

public double getPlotPrice() {
Expand All @@ -1096,7 +1099,10 @@ public double getPlotTypePrice(TownBlockType type) {
}

public void setCommercialPlotPrice(double commercialPlotPrice) {
this.commercialPlotPrice = Math.min(Math.max(commercialPlotPrice, -1), TownySettings.getMaxPlotPrice());
if (commercialPlotPrice < 0)
commercialPlotPrice = -1;

this.commercialPlotPrice = Math.min(commercialPlotPrice, TownySettings.getMaxPlotPrice());
}

public double getCommercialPlotPrice() {
Expand All @@ -1105,7 +1111,10 @@ public double getCommercialPlotPrice() {
}

public void setEmbassyPlotPrice(double embassyPlotPrice) {
this.embassyPlotPrice = Math.min(Math.max(embassyPlotPrice, -1), TownySettings.getMaxPlotPrice());
if (embassyPlotPrice < 0)
embassyPlotPrice = -1;

this.embassyPlotPrice = Math.min(embassyPlotPrice, TownySettings.getMaxPlotPrice());
}

public double getEmbassyPlotPrice() {
Expand Down

0 comments on commit 097e030

Please sign in to comment.