mirror of
https://gitlab.com/phoenix-dvpmt/mmocore.git
synced 2024-12-27 05:28:25 +01:00
Changed the way default waypoints work.
All default waypoints will be unlocked regardless of playerdata, no matter what.
This commit is contained in:
parent
1ec270566d
commit
9c48b96f18
@ -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) {
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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<Waypoint> getDefault() {
|
||||
return getAll().stream().filter(waypoint -> waypoint.isDefault()).collect(Collectors.toSet());
|
||||
}
|
||||
|
||||
public boolean has(String id) {
|
||||
return waypoints.containsKey(id);
|
||||
}
|
||||
|
@ -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"))
|
||||
|
Loading…
Reference in New Issue
Block a user