mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-04 09:10:17 +01:00
I can't count + fix variable scope
This commit is contained in:
parent
29ce4af350
commit
6375922808
@ -74,7 +74,9 @@ public class Merge extends SubCommand {
|
||||
final PlotArea plotArea = plot.getArea();
|
||||
Expression<Double> priceExr = plotArea.PRICES.containsKey("merge") ? plotArea.PRICES.get("merge") : null;
|
||||
final int size = plot.getConnectedPlots().size();
|
||||
double price = priceExr == null ? 0d : priceExr.evalute((double) size);
|
||||
System.out.println("EXPRESSIONL " + priceExr);
|
||||
final double price = priceExr == null ? 0d : priceExr.evalute((double) size);
|
||||
System.out.println("PRICE: " + price + " | " + EconHandler.manager + " | " + plotArea.USE_ECONOMY);
|
||||
if (EconHandler.manager != null && plotArea.USE_ECONOMY && price > 0d && EconHandler.manager.getMoney(player) < price) {
|
||||
sendMessage(player, C.CANNOT_AFFORD_MERGE, String.valueOf(price));
|
||||
return false;
|
||||
|
@ -32,7 +32,7 @@ public abstract class Expression<T> {
|
||||
} catch (Exception ignore) {}
|
||||
if (expression.endsWith("*{arg}")) {
|
||||
try {
|
||||
return linearDouble(Double.parseDouble(expression.substring(0, expression.length() - 8)));
|
||||
return linearDouble(Double.parseDouble(expression.substring(0, expression.length() - 6)));
|
||||
} catch (Exception ignore) {}
|
||||
}
|
||||
return new Expression<Double>() {
|
||||
|
Loading…
Reference in New Issue
Block a user