use of net.citizensnpcs.api.util.DataKey in project Citizens2 by CitizensDev.
the class GuidedWaypointProvider method save.
@Override
public void save(DataKey key) {
key.removeKey("availablewaypoints");
DataKey root = key.getRelative("availablewaypoints");
for (int i = 0; i < available.size(); ++i) {
PersistenceLoader.save(available.get(i), root.getRelative(i));
}
key.removeKey("helperwaypoints");
root = key.getRelative("helperwaypoints");
for (int i = 0; i < helpers.size(); ++i) {
PersistenceLoader.save(helpers.get(i), root.getRelative(i));
}
}
use of net.citizensnpcs.api.util.DataKey in project Citizens2 by CitizensDev.
the class LinearWaypointProvider method load.
@Override
public void load(DataKey key) {
for (DataKey root : key.getRelative("points").getIntegerSubKeys()) {
Waypoint waypoint = PersistenceLoader.load(Waypoint.class, root);
if (waypoint == null)
continue;
waypoints.add(waypoint);
}
}
Aggregations