Class Jails

java.lang.Object
com.earth2me.essentials.Jails
All Implemented Interfaces:
IJails, IConf, IJails

public class Jails extends Object implements IJails
  • Constructor Details

  • Method Details

    • reloadConfig

      public void reloadConfig()
      Specified by:
      reloadConfig in interface IConf
    • resetListener

      public void resetListener()
    • startTransaction

      public void startTransaction()
      Description copied from interface: IJails
      Begins a transaction
      Specified by:
      startTransaction in interface IJails
    • stopTransaction

      public void stopTransaction(boolean blocking)
      Description copied from interface: IJails
      Ends the current transaction and saves the state
      Specified by:
      stopTransaction in interface IJails
    • getJail

      public Location getJail(String jailName) throws Exception
      Description copied from interface: IJails
      Gets the location of the jail with the given name
      Specified by:
      getJail in interface IJails
      Parameters:
      jailName - The name of the jail
      Returns:
      the location of the jail
      Throws:
      Exception - if the jail does not exist
    • getList

      public Collection<String> getList() throws Exception
      Description copied from interface: IJails
      Gets a list of jails by names
      Specified by:
      getList in interface IJails
      Returns:
      a list of jails, if there are none the list will be empty
      Throws:
      Exception
    • removeJail

      public void removeJail(String jail) throws Exception
      Description copied from interface: IJails
      Remove the jail with the given name
      Specified by:
      removeJail in interface IJails
      Parameters:
      jail - the jail to remove
      Throws:
      Exception - if the jail does not exist
    • sendToJail

      @Deprecated public void sendToJail(IUser user, String jail) throws Exception
      Deprecated.
      This method does not use asynchronous teleportation. Use sendToJail(IUser, String, CompletableFuture)
      Description copied from interface: IJails
      Attempts to send the given user to the given jail
      Specified by:
      sendToJail in interface IJails
      Parameters:
      user - the user to send to jail
      jail - 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 interface IJails
      Parameters:
      user - the user to send to jail
      jailName - the jail to send the user to
      future - Future which is completed with the success status of the execution
      Throws:
      Exception - if the user is offline or jail does not exist
    • setJail

      public void setJail(String jailName, Location loc) throws Exception
      Description copied from interface: IJails
      Set a new jail with the given name and location
      Specified by:
      setJail in interface IJails
      Parameters:
      jailName - the name of the jail being set
      loc - the location of the jail being set
      Throws:
      Exception
    • getCount

      public int getCount()
      Description copied from interface: IJails
      Gets the number of jails
      Specified by:
      getCount in interface IJails
      Returns:
      the size of the list of jails