public interface NucleusJailService
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
JAIL_CONTEXT
The permission context key that indicates which jail a player is in.
|
static java.lang.String |
JAILED_CONTEXT
The permission context key that indicates a player is jailed.
|
Modifier and Type | Method and Description |
---|---|
java.util.Optional<NamedLocation> |
getJail(java.lang.String name)
Gets the location of a jail, if it exists.
|
java.util.Map<java.lang.String,NamedLocation> |
getJails()
Gets the name of the jails on the server.
|
java.util.Optional<Jailing> |
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,
java.lang.String jail,
org.spongepowered.api.command.CommandSource jailer,
java.lang.String reason)
Jails a subject if they are not currently jailed.
|
boolean |
removeJail(java.lang.String name)
Removes a jail location from the list.
|
boolean |
setJail(java.lang.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 java.lang.String JAILED_CONTEXT
The value of this context will always be true if set.
static final java.lang.String JAIL_CONTEXT
The value of this context will be the name of the jail.
boolean setJail(java.lang.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.java.util.Map<java.lang.String,NamedLocation> getJails()
Map
of names to NamedLocation
.java.util.Optional<NamedLocation> getJail(java.lang.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(java.lang.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.java.util.Optional<Jailing> getPlayerJailData(org.spongepowered.api.entity.living.player.User user)
user
- The User
to checkOptional
that will contain Jailing
information if the subject is jailed.boolean jailPlayer(org.spongepowered.api.entity.living.player.User victim, java.lang.String jail, org.spongepowered.api.command.CommandSource jailer, java.lang.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.