Fixed issue with waypoint costs

This commit is contained in:
Indyuce 2022-03-05 10:05:08 +01:00
parent 6896d06657
commit 611cdb390b
2 changed files with 5 additions and 3 deletions

View File

@ -467,7 +467,8 @@ public class PlayerData extends OfflinePlayerData implements Closable, Experienc
*/
setLastActivity(PlayerActivity.USE_WAYPOINT);
giveStellium(-waypoint.getCost(costType), PlayerResourceUpdateEvent.UpdateReason.USE_WAYPOINT);
final double cost = waypoint.getCost(costType);
giveStellium(-cost, PlayerResourceUpdateEvent.UpdateReason.USE_WAYPOINT);
new BukkitRunnable() {
final int x = getPlayer().getLocation().getBlockX();
@ -482,7 +483,7 @@ public class PlayerData extends OfflinePlayerData implements Closable, Experienc
|| getPlayer().getLocation().getBlockZ() != z) {
MMOCore.plugin.soundManager.getSound(SoundEvent.WARP_CANCELLED).playTo(getPlayer());
MMOCore.plugin.configManager.getSimpleMessage("warping-canceled").send(getPlayer());
giveStellium(waypoint.getCost(CostType.NORMAL_USE), PlayerResourceUpdateEvent.UpdateReason.SKILL_REGENERATION);
giveStellium(cost, PlayerResourceUpdateEvent.UpdateReason.USE_WAYPOINT);
cancel();
return;
}

View File

@ -17,7 +17,8 @@ public enum WaypointOption {
ENABLE_MENU(true),
/**
* By defaut, players must stand into
* By default waypoints are not dynamic. Players need to be standing on
* ANOTHER waypoint to be able to teleport to other waypoints.
*/
DYNAMIC(false),