31 public static void setWaypoint(
Player player, String waypointName) {
32 if(
Area.inRestrictedArea(player)) {
33 player.message(
"You cannot set a waypoint here");
36 if (player.waypoints.size() >= getAllowedPoints(player)) {
37 player.message(
"You have reached the maximum amount of waypoints allowed for your rank.");
40 if (player.waypoints.containsKey(waypointName)) {
41 player.message(
"You already have a waypoint with this name.");
45 player.dialogueFactory.
sendStatement(
"You have set a waypoint named " + waypointName +
" at your current location.").
execute();
48 public static void removeWaypoint (
Player player, String waypointName) {
49 player.waypoints.remove(waypointName);
50 player.dialogueFactory.
sendStatement(
"You have removed " + waypointName +
" from your waypoints.").
execute();
52 public static void getWaypoints(
Player player) {
53 if (player.waypoints.isEmpty()) {
54 player.message(
"You have no waypoints set.");
57 player.message(
"Current waypoints:");
58 player.waypoints.forEach((k, v) -> player.message(
"@red@" +k));
60 private static int getAllowedPoints(
Player player) {
61 return switch (player.right.
getName()) {
62 case "King Donator" -> 10;
63 case "Elite Donator" -> 8;
64 case "Extreme Donator" -> 6;
65 case "Super Donator" -> 4;
final DialogueFactory sendStatement(String... lines)
final DialogueFactory execute()