Essentials/Essentials/src/main/java/com/earth2me/essentials/api/IWarps.java

91 lines
2.4 KiB
Java
Raw Normal View History

package com.earth2me.essentials.api;
import com.earth2me.essentials.IConf;
import com.earth2me.essentials.IUser;
import com.earth2me.essentials.commands.WarpNotFoundException;
2015-04-15 06:06:16 +02:00
import org.bukkit.Location;
import java.io.File;
import java.util.Collection;
import java.util.UUID;
2020-10-04 18:03:52 +02:00
/**
* Provides access to the storage of warp locations. Maintainers should add methods to <i>this interface</i>.
*
* @deprecated External plugins should use {@link net.ess3.api.IWarps} instead of this interface, in case future APIs are added.
*/
@Deprecated
2015-04-15 06:06:16 +02:00
public interface IWarps extends IConf {
/**
* Get a warp by name
*
* @param warp - Warp name
* @return - Location the warp is set to
* @throws WarpNotFoundException When the warp is not found
2020-10-04 18:03:52 +02:00
* @throws net.ess3.api.InvalidWorldException When the world the warp is in is not found
2015-04-15 06:06:16 +02:00
*/
Location getWarp(String warp) throws WarpNotFoundException, net.ess3.api.InvalidWorldException;
2015-04-15 06:06:16 +02:00
/**
* Gets a list of warps
*
* @return - A {@link Collection} of warps
*/
Collection<String> getList();
2015-04-15 06:06:16 +02:00
/**
* Gets the number of warps
*
* @return the size of the list of warps
*/
int getCount();
2015-04-15 06:06:16 +02:00
/**
* Delete a warp from the warp DB
*
* @param name - Name of warp
* @throws Exception If the warp could not be removed
2015-04-15 06:06:16 +02:00
*/
void removeWarp(String name) throws Exception;
2015-04-15 06:06:16 +02:00
/**
* Set a warp
*
* @param name - Name of warp
* @param loc - Location of warp
* @throws Exception If the warp could not be set
2015-04-15 06:06:16 +02:00
*/
void setWarp(String name, Location loc) throws Exception;
/**
* Set a warp
*
* @param user - User of warp
* @param name - Name of warp
* @param loc - Location of warp
* @throws Exception If the warp could not be set
*/
void setWarp(IUser user, String name, Location loc) throws Exception;
2020-10-03 19:46:05 +02:00
/**
* Gets Lastowner UUID
*
2020-10-03 19:46:05 +02:00
* @param warp - Name of warp
* @throws WarpNotFoundException If the warp is not found
*/
UUID getLastOwner(String warp) throws WarpNotFoundException;
2020-10-03 19:46:05 +02:00
2015-04-15 06:06:16 +02:00
/**
* Check to see if the file is empty
*
* @return Whether or not the file is empty
2015-04-15 06:06:16 +02:00
*/
boolean isEmpty();
2015-04-15 06:06:16 +02:00
/**
2020-10-04 18:03:52 +02:00
* @deprecated This method relates to the abandoned 3.x storage refactor and is not implemented.
2015-04-15 06:06:16 +02:00
*/
2020-10-04 18:03:52 +02:00
@Deprecated
2015-04-15 06:06:16 +02:00
File getWarpFile(String name) throws net.ess3.api.InvalidNameException;
}