Skip to content

Commit

Permalink
fixes and bump version number
Browse files Browse the repository at this point in the history
  • Loading branch information
ewof committed Apr 26, 2024
1 parent 2b1892f commit 36b5b9a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

group = "net.mvndicraft.townywaypoints"
version = "1.2-SNAPSHOT"
version = "1.3-SNAPSHOT"

repositories {
mavenCentral()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import org.bukkit.entity.Player;
import org.bukkit.event.player.PlayerTeleportEvent.TeleportCause;
import com.palmergames.bukkit.towny.TownyAPI;
import com.palmergames.bukkit.towny.exceptions.NotRegisteredException;
import com.palmergames.bukkit.towny.object.Resident;
import com.palmergames.bukkit.towny.object.Town;
import com.palmergames.bukkit.towny.object.TownBlock;
Expand Down Expand Up @@ -167,13 +166,14 @@ 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 splitCost = travelcost * TownyWaypointsSettings.getSplit();
double splitCostNation = travelcost * (1.0 - TownyWaypointsSettings.getSplit());
double splitCostTown = travelcost * TownyWaypointsSettings.getSplit();

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

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

if (!CooldownTimerTask.hasCooldown(player.getName(), "waypoint"))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
package net.mvndicraft.townywaypoints.settings;

public class TownyWaypointsSettings {
public static double getSplit() {
return Settings.getDouble(ConfigNodes.WAYPOINTS_ECONOMY_SPLIT);
}

public static int getMaxDistance() {
return Settings.getInt(ConfigNodes.WAYPOINTS_RESTRICTIONS_MAX_DISTANCE);
}
Expand All @@ -12,8 +16,4 @@ public static int getCooldown() {
public static boolean getPeerToPeer() {
return Settings.getBoolean(ConfigNodes.WAYPOINTS_RESTRICTIONS_PEER_TO_PEER);
}

public static double getSplit() {
return Settings.getDouble(ConfigNodes.WAYPOINTS_ECONOMY_SPLIT);
}
}
2 changes: 1 addition & 1 deletion src/main/resources/paper-plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: TownyWaypoints
version: '1.2'
version: '1.3'
main: net.mvndicraft.townywaypoints.TownyWaypoints
description: Configurable Waypoints as Towny plots
api-version: '1.20'
Expand Down

0 comments on commit 36b5b9a

Please sign in to comment.