Skip to content

Commit

Permalink
-1 disable
Browse files Browse the repository at this point in the history
  • Loading branch information
ewof committed Apr 28, 2024
1 parent d530028 commit 83dd265
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,16 +166,18 @@ public static void onTravel(Player player, String townName, String waypointName,
Messaging.sendMsg(player, Translatable.of("msg_waypoint_travel_warmup_cost", travelcost));
teleport(player, loc, waypoint.travelWithVehicle());

double splitCostNation = travelcost * (1.0 - TownyWaypointsSettings.getSplit());
double splitCostTown = travelcost * TownyWaypointsSettings.getSplit();
if (TownyWaypointsSettings.getSplit() != -1) {
double splitCostNation = travelcost * (1.0 - TownyWaypointsSettings.getSplit());
double splitCostTown = travelcost * TownyWaypointsSettings.getSplit();

town.getAccount().deposit(town.hasNation() ? splitCostTown : travelcost,
Translatable.of("msg_deposit_reason").toString());

if (town.hasNation())
town.getNationOrNull().getAccount().deposit(splitCostNation,
town.getAccount().deposit(town.hasNation() ? splitCostTown : travelcost,
Translatable.of("msg_deposit_reason").toString());

if (town.hasNation())
town.getNationOrNull().getAccount().deposit(splitCostNation,
Translatable.of("msg_deposit_reason").toString());
}

if (!CooldownTimerTask.hasCooldown(player.getName(), "waypoint"))
CooldownTimerTask.addCooldownTimer(player.getName(), "waypoint", TownyWaypointsSettings.getCooldown());
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public enum ConfigNodes {
"waypoints.economy.split",
"0.5",
"",
"# The percentage of the travel cost that gets added to the waypoints town bank, the rest goes to the nation (if it has no nation then 100% goes to the town)."),
"# The percentage of the travel cost that gets added to the waypoints town bank, the rest goes to the nation (if it has no nation then 100% goes to the town). Set to -1 to disable (neither the town or nation bank gets any of the travel cost)."),
WAYPOINTS_RESTRICTIONS(
"waypoints.restrictions",
"",
Expand Down

0 comments on commit 83dd265

Please sign in to comment.