mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-11-23 19:16:34 +01:00
Use Persistable in WaypointProvider
This commit is contained in:
parent
4271d80dda
commit
ecf5f145c6
@ -2,15 +2,14 @@ package net.citizensnpcs.trait.waypoint;
|
||||
|
||||
import net.citizensnpcs.api.command.CommandContext;
|
||||
import net.citizensnpcs.api.npc.NPC;
|
||||
import net.citizensnpcs.api.util.DataKey;
|
||||
import net.citizensnpcs.api.persistence.Persistable;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public interface WaypointProvider {
|
||||
|
||||
public interface WaypointProvider extends Persistable {
|
||||
/**
|
||||
* Creates an {@link WaypointEditor} with the given {@link Player}.
|
||||
*
|
||||
*
|
||||
* @param player
|
||||
* The player to link the editor with
|
||||
* @param args
|
||||
@ -20,19 +19,11 @@ public interface WaypointProvider {
|
||||
|
||||
/**
|
||||
* Returns whether this provider has paused execution of waypoints.
|
||||
*
|
||||
*
|
||||
* @return Whether the provider is paused.
|
||||
*/
|
||||
public boolean isPaused();
|
||||
|
||||
/**
|
||||
* Loads from the specified {@link DataKey}.
|
||||
*
|
||||
* @param key
|
||||
* The key to load from
|
||||
*/
|
||||
public void load(DataKey key);
|
||||
|
||||
/**
|
||||
* Called when the provider is removed from the NPC.
|
||||
*/
|
||||
@ -40,23 +31,15 @@ public interface WaypointProvider {
|
||||
|
||||
/**
|
||||
* Called when the {@link NPC} attached to this provider is spawned.
|
||||
*
|
||||
*
|
||||
* @param npc
|
||||
* The attached NPC
|
||||
*/
|
||||
public void onSpawn(NPC npc);
|
||||
|
||||
/**
|
||||
* Saves to the specified {@link DataKey}.
|
||||
*
|
||||
* @param key
|
||||
* The key to save to
|
||||
*/
|
||||
public void save(DataKey key);
|
||||
|
||||
/**
|
||||
* Pauses waypoint execution.
|
||||
*
|
||||
*
|
||||
* @param paused
|
||||
* Whether to pause waypoint execution.
|
||||
*/
|
||||
|
@ -76,7 +76,6 @@ public class Waypoints extends Trait {
|
||||
if (provider == null)
|
||||
return;
|
||||
PersistenceLoader.load(provider, key.getRelative(providerName));
|
||||
provider.load(key.getRelative(providerName));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -91,7 +90,6 @@ public class Waypoints extends Trait {
|
||||
if (provider == null)
|
||||
return;
|
||||
PersistenceLoader.save(provider, key.getRelative(providerName));
|
||||
provider.save(key.getRelative(providerName));
|
||||
key.setString("provider", providerName);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user