public interface NucleusJailService
Modifier and Type | Field and Description |
---|---|
static String |
JAIL_CONTEXT
The permission context key that indicates which jail a player is in.
|
static String |
JAILED_CONTEXT
The permission context key that indicates a player is jailed.
|
Modifier and Type | Method and Description |
---|---|
Optional<NamedLocation> |
getJail(String name)
Gets the location of a jail, if it exists.
|
Map<String,NamedLocation> |
getJails()
Gets the name of the jails on the server.
|
Optional<Inmate> |
getPlayerJailData(org.spongepowered.api.entity.living.player.User user)
Returns information about why a subject is jailed, if they are indeed jailed.
|
boolean |
isPlayerJailed(org.spongepowered.api.entity.living.player.User user)
Returns whether a subject is jailed.
|
boolean |
jailPlayer(org.spongepowered.api.entity.living.player.User victim,
String jail,
org.spongepowered.api.command.CommandSource jailer,
String reason)
Jails a subject if they are not currently jailed.
|
boolean |
removeJail(String name)
Removes a jail location from the list.
|
boolean |
setJail(String name,
org.spongepowered.api.world.Location<org.spongepowered.api.world.World> location,
com.flowpowered.math.vector.Vector3d rotation)
Sets a jail location in the world.
|
boolean |
unjailPlayer(org.spongepowered.api.entity.living.player.User user)
Unjails a subject if they are currently jailed.
|
static final String JAILED_CONTEXT
The value of this context will always be true if set.
static final String JAIL_CONTEXT
The value of this context will be the name of the jail.
boolean setJail(String name, org.spongepowered.api.world.Location<org.spongepowered.api.world.World> location, com.flowpowered.math.vector.Vector3d rotation)
name
- The name of the jail to use.location
- The Location
in a world for the jail.rotation
- The rotation of the subject once in jail.true
if the creation of a jail point was a success.Map<String,NamedLocation> getJails()
Map
of names to NamedLocation
.Optional<NamedLocation> getJail(String name)
name
- The name of the jail to get. Case in-sensitive.Optional
that potentially contains the NamedLocation
if the jail exists.boolean removeJail(String name)
name
- The name of the jail to remove.true
if successful.boolean isPlayerJailed(org.spongepowered.api.entity.living.player.User user)
user
- The User
to check.true
if the subject is jailed.Optional<Inmate> getPlayerJailData(org.spongepowered.api.entity.living.player.User user)
boolean jailPlayer(org.spongepowered.api.entity.living.player.User victim, String jail, org.spongepowered.api.command.CommandSource jailer, String reason) throws NoSuchLocationException
victim
- The user to jail.jail
- The jail to send the user to.jailer
- The jailing entity.reason
- The reason for jailing.true
if the subject was jailed successfully.NoSuchLocationException
- if the jail does not exist.boolean unjailPlayer(org.spongepowered.api.entity.living.player.User user)
user
- The User
to unjail.true
if the subject was unjailed successfully.