2011-12-06 15:32:06 +00:00
|
|
|
package com.earth2me.essentials.api;
|
|
|
|
|
2013-07-13 17:40:46 +00:00
|
|
|
import net.ess3.api.IUser;
|
|
|
|
import org.bukkit.Location;
|
2011-12-06 15:32:06 +00:00
|
|
|
|
2015-04-15 04:06:16 +00:00
|
|
|
import java.util.Collection;
|
2020-06-24 08:52:25 +00:00
|
|
|
import java.util.concurrent.CompletableFuture;
|
2015-04-15 04:06:16 +00:00
|
|
|
|
2020-10-04 16:03:52 +00:00
|
|
|
/**
|
|
|
|
* Provides access to the storage of jail locations. Maintainers should add methods to <i>this interface</i>.
|
|
|
|
*
|
|
|
|
* @deprecated External plugins should use {@link net.ess3.api.IJails} instead of this interface in case future APIs are added.
|
|
|
|
*/
|
|
|
|
@Deprecated
|
2015-04-15 04:06:16 +00:00
|
|
|
public interface IJails extends IReload {
|
|
|
|
/**
|
|
|
|
* Gets the location of the jail with the given name
|
|
|
|
*
|
|
|
|
* @param jailName The name of the jail
|
|
|
|
* @return the location of the jail
|
|
|
|
* @throws Exception if the jail does not exist
|
|
|
|
*/
|
|
|
|
Location getJail(String jailName) throws Exception;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets a list of jails by names
|
|
|
|
*
|
|
|
|
* @return a list of jails, if there are none the list will be empty
|
|
|
|
* @throws Exception
|
|
|
|
*/
|
|
|
|
Collection<String> getList() throws Exception;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the number of jails
|
|
|
|
*
|
|
|
|
* @return the size of the list of jails
|
|
|
|
*/
|
|
|
|
int getCount();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove the jail with the given name
|
|
|
|
*
|
|
|
|
* @param jail the jail to remove
|
|
|
|
* @throws Exception if the jail does not exist
|
|
|
|
*/
|
|
|
|
void removeJail(String jail) throws Exception;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Attempts to send the given user to the given jail
|
|
|
|
*
|
|
|
|
* @param user the user to send to jail
|
|
|
|
* @param jail the jail to send the user to
|
|
|
|
* @throws Exception if the user is offline or jail does not exist
|
2020-10-03 17:46:05 +00:00
|
|
|
* @deprecated Use {@link IJails#sendToJail(IUser, String, CompletableFuture)}
|
2015-04-15 04:06:16 +00:00
|
|
|
*/
|
2020-06-24 08:52:25 +00:00
|
|
|
@Deprecated
|
2015-04-15 04:06:16 +00:00
|
|
|
void sendToJail(IUser user, String jail) throws Exception;
|
2013-07-13 17:40:46 +00:00
|
|
|
|
2020-06-24 08:52:25 +00:00
|
|
|
/**
|
|
|
|
* Attempts to send the given user to the given jail
|
|
|
|
*
|
2020-10-03 17:46:05 +00:00
|
|
|
* @param user the user to send to jail
|
|
|
|
* @param jail the jail to send the user to
|
|
|
|
* @param future Future which is completed with the success status of the execution
|
2020-06-24 08:52:25 +00:00
|
|
|
* @throws Exception if the user is offline or jail does not exist
|
|
|
|
*/
|
|
|
|
void sendToJail(IUser user, String jail, CompletableFuture<Boolean> future) throws Exception;
|
|
|
|
|
2015-04-15 04:06:16 +00:00
|
|
|
/**
|
|
|
|
* Set a new jail with the given name and location
|
|
|
|
*
|
|
|
|
* @param jailName the name of the jail being set
|
|
|
|
* @param loc the location of the jail being set
|
|
|
|
* @throws Exception
|
|
|
|
*/
|
|
|
|
void setJail(String jailName, Location loc) throws Exception;
|
2011-12-06 15:32:06 +00:00
|
|
|
}
|