Package com.earth2me.essentials
Class Jails
java.lang.Object
com.earth2me.essentials.Jails
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
getCount()
Gets the number of jailsGets the location of the jail with the given namegetList()
Gets a list of jails by namesvoid
void
removeJail
(String jail) Remove the jail with the given namevoid
void
sendToJail
(IUser user, String jail) Deprecated.This method does not use asynchronous teleportation.void
sendToJail
(IUser user, String jailName, CompletableFuture<Boolean> future) Attempts to send the given user to the given jailvoid
Set a new jail with the given name and locationvoid
Begins a transactionvoid
stopTransaction
(boolean blocking) Ends the current transaction and saves the state
-
Constructor Details
-
Jails
-
-
Method Details
-
reloadConfig
public void reloadConfig()- Specified by:
reloadConfig
in interfaceIConf
-
resetListener
public void resetListener() -
startTransaction
public void startTransaction()Description copied from interface:IJails
Begins a transaction- Specified by:
startTransaction
in interfaceIJails
-
stopTransaction
public void stopTransaction(boolean blocking) Description copied from interface:IJails
Ends the current transaction and saves the state- Specified by:
stopTransaction
in interfaceIJails
-
getJail
Description copied from interface:IJails
Gets the location of the jail with the given name -
getList
Description copied from interface:IJails
Gets a list of jails by names -
removeJail
Description copied from interface:IJails
Remove the jail with the given name- Specified by:
removeJail
in interfaceIJails
- Parameters:
jail
- the jail to remove- Throws:
Exception
- if the jail does not exist
-
sendToJail
Deprecated.This method does not use asynchronous teleportation. UsesendToJail(IUser, String, CompletableFuture)
Description copied from interface:IJails
Attempts to send the given user to the given jail- Specified by:
sendToJail
in interfaceIJails
- Parameters:
user
- the user to send to jailjail
- the jail to send the user to- Throws:
Exception
- if the user is offline or jail does not exist
-
sendToJail
public void sendToJail(IUser user, String jailName, CompletableFuture<Boolean> future) throws Exception Description copied from interface:IJails
Attempts to send the given user to the given jail- Specified by:
sendToJail
in interfaceIJails
- Parameters:
user
- the user to send to jailjailName
- the jail to send the user tofuture
- Future which is completed with the success status of the execution- Throws:
Exception
- if the user is offline or jail does not exist
-
setJail
Description copied from interface:IJails
Set a new jail with the given name and location -
getCount
public int getCount()Description copied from interface:IJails
Gets the number of jails
-