diff --git a/src/main/java/net/Indyuce/mmocore/api/player/PlayerData.java b/src/main/java/net/Indyuce/mmocore/api/player/PlayerData.java index fb339145..28e57d9a 100644 --- a/src/main/java/net/Indyuce/mmocore/api/player/PlayerData.java +++ b/src/main/java/net/Indyuce/mmocore/api/player/PlayerData.java @@ -308,7 +308,7 @@ public class PlayerData extends OfflinePlayerData { } public boolean hasWaypoint(Waypoint waypoint) { - return waypoints.contains(waypoint.getId()); + return waypoint.isDefault() || waypoints.contains(waypoint.getId()); } public void unlockWaypoint(Waypoint waypoint) { diff --git a/src/main/java/net/Indyuce/mmocore/command/rpg/admin/ResetCommandTreeNode.java b/src/main/java/net/Indyuce/mmocore/command/rpg/admin/ResetCommandTreeNode.java index 2d7242dc..05a55872 100644 --- a/src/main/java/net/Indyuce/mmocore/command/rpg/admin/ResetCommandTreeNode.java +++ b/src/main/java/net/Indyuce/mmocore/command/rpg/admin/ResetCommandTreeNode.java @@ -91,8 +91,6 @@ public class ResetCommandTreeNode extends CommandTreeNode { PlayerData data = PlayerData.get(player); data.getWaypoints().clear(); - MMOCore.plugin.waypointManager.getAll().stream().filter(waypoint -> waypoint.isDefault()) - .forEach(waypoint -> data.unlockWaypoint(waypoint)); return CommandResult.SUCCESS; } } diff --git a/src/main/java/net/Indyuce/mmocore/manager/WaypointManager.java b/src/main/java/net/Indyuce/mmocore/manager/WaypointManager.java index 008387d0..29ee1bc8 100644 --- a/src/main/java/net/Indyuce/mmocore/manager/WaypointManager.java +++ b/src/main/java/net/Indyuce/mmocore/manager/WaypointManager.java @@ -3,9 +3,7 @@ package net.Indyuce.mmocore.manager; import java.util.Collection; import java.util.LinkedHashMap; import java.util.Map; -import java.util.Set; import java.util.logging.Level; -import java.util.stream.Collectors; import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.entity.Player; @@ -29,10 +27,6 @@ public class WaypointManager { return waypoints.values(); } - public Set getDefault() { - return getAll().stream().filter(waypoint -> waypoint.isDefault()).collect(Collectors.toSet()); - } - public boolean has(String id) { return waypoints.containsKey(id); } diff --git a/src/main/java/net/Indyuce/mmocore/manager/data/yaml/YAMLPlayerDataManager.java b/src/main/java/net/Indyuce/mmocore/manager/data/yaml/YAMLPlayerDataManager.java index e99b4070..1abc3906 100644 --- a/src/main/java/net/Indyuce/mmocore/manager/data/yaml/YAMLPlayerDataManager.java +++ b/src/main/java/net/Indyuce/mmocore/manager/data/yaml/YAMLPlayerDataManager.java @@ -46,7 +46,6 @@ public class YAMLPlayerDataManager extends PlayerDataManager { data.getQuestData().updateBossBar(); if (config.contains("waypoints")) data.getWaypoints().addAll(config.getStringList("waypoints")); - MMOCore.plugin.waypointManager.getDefault().forEach(waypoint -> data.getWaypoints().add(waypoint.getId())); if (config.contains("friends")) config.getStringList("friends").forEach(str -> data.getFriends().add(UUID.fromString(str))); if (config.contains("skill"))