Skip to content

Commit

Permalink
-1 -1 -1
Browse files Browse the repository at this point in the history
  • Loading branch information
Warriorrrr committed May 5, 2024
1 parent b7ef44e commit d05ab1c
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 @@ -1096,7 +1096,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 @@ -1114,7 +1117,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 @@ -1123,7 +1129,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 d05ab1c

Please sign in to comment.