|
|
|
|
@ -82,11 +82,11 @@ public class CarriageUtils {
|
|
|
|
|
public static int calculateCost(double playerX, double playerZ, CarriageDestination dest) {
|
|
|
|
|
if (dest.road.equals("sea")) {
|
|
|
|
|
double dist = Math.sqrt(Math.pow(dest.x - playerX, 2) + Math.pow(dest.z - playerZ, 2));
|
|
|
|
|
int cost = 500 + Math.max(1, (int)(dist / 500)); // replace 10 with another hardcoded value
|
|
|
|
|
int cost = 500 + Math.max(1, (int)(dist / 50)); // 50 is the cost per block + 500 base cost
|
|
|
|
|
return cost;
|
|
|
|
|
}
|
|
|
|
|
double dist = Math.sqrt(Math.pow(dest.x - playerX, 2) + Math.pow(dest.z - playerZ, 2));
|
|
|
|
|
int cost = Math.max(1, (int)(dist / 100)); // replace 10 with another hardcoded value
|
|
|
|
|
int cost = Math.max(1, (int)(dist / 50)); // 50 is the cost per block, with base cost of 1
|
|
|
|
|
return cost;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|