public interface NucleusHomeService
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ALTERNATIVE_HOME_COUNT_OPTION
Deprecated.
Use
HOME_COUNT_OPTION as the permission option to set
home counts, as that will override this one. |
static java.lang.String |
DEFAULT_HOME_NAME
The default home name.
|
static java.lang.String |
HOME_COUNT_OPTION
The name of the permission option that will contain the number of homes a player
may have.
|
static java.util.regex.Pattern |
HOME_NAME_PATTERN
The pattern that all home names must follow.
|
| Modifier and Type | Method and Description |
|---|---|
void |
createHome(org.spongepowered.api.event.cause.Cause cause,
org.spongepowered.api.entity.living.player.User user,
java.lang.String name,
org.spongepowered.api.world.Location<org.spongepowered.api.world.World> location,
com.flowpowered.math.vector.Vector3d rotation)
Creates a home.
|
default void |
createHome(org.spongepowered.api.event.cause.Cause cause,
java.util.UUID user,
java.lang.String name,
org.spongepowered.api.world.Location<org.spongepowered.api.world.World> location,
com.flowpowered.math.vector.Vector3d rotation)
Creates a home.
|
default java.util.Optional<Home> |
getHome(org.spongepowered.api.entity.living.player.User user,
java.lang.String name) |
java.util.Optional<Home> |
getHome(java.util.UUID user,
java.lang.String name)
Gets a specified home of the user, if it exists.
|
default int |
getHomeCount(org.spongepowered.api.entity.living.player.User user)
Gets the number of homes the player currently has.
|
default int |
getHomeCount(java.util.UUID user)
Gets the number of homes the player currently has.
|
default java.util.List<Home> |
getHomes(org.spongepowered.api.entity.living.player.User user)
Gets the
Homes for the specified user, identified by their UUID. |
java.util.List<Home> |
getHomes(java.util.UUID user)
Gets the
Homes for the specified user, identified by their UUID. |
int |
getMaximumHomes(org.spongepowered.api.entity.living.player.User user)
Returns the maximum number of homes the player can have.
|
int |
getMaximumHomes(java.util.UUID uuid)
Returns the maximum number of homes the player can have.
|
void |
modifyHome(org.spongepowered.api.event.cause.Cause cause,
Home home,
org.spongepowered.api.world.Location<org.spongepowered.api.world.World> location,
com.flowpowered.math.vector.Vector3d rotation)
Modifies a home's location.
|
default void |
modifyHome(org.spongepowered.api.event.cause.Cause cause,
org.spongepowered.api.entity.living.player.User user,
java.lang.String name,
org.spongepowered.api.world.Location<org.spongepowered.api.world.World> location,
com.flowpowered.math.vector.Vector3d rotation) |
default void |
modifyHome(org.spongepowered.api.event.cause.Cause cause,
java.util.UUID user,
java.lang.String name,
org.spongepowered.api.world.Location<org.spongepowered.api.world.World> location,
com.flowpowered.math.vector.Vector3d rotation)
Modifies a home's location.
|
default void |
modifyOrCreateHome(org.spongepowered.api.event.cause.Cause cause,
org.spongepowered.api.entity.living.player.User user,
java.lang.String name,
org.spongepowered.api.world.Location<org.spongepowered.api.world.World> location,
com.flowpowered.math.vector.Vector3d rotation)
Modifies a home's location, if it exists, otherwise creates a home.
|
default void |
modifyOrCreateHome(org.spongepowered.api.event.cause.Cause cause,
java.util.UUID user,
java.lang.String name,
org.spongepowered.api.world.Location<org.spongepowered.api.world.World> location,
com.flowpowered.math.vector.Vector3d rotation)
Modifies a home's location, if it exists, otherwise creates a home.
|
void |
removeHome(org.spongepowered.api.event.cause.Cause cause,
Home home)
Removes a home.
|
default void |
removeHome(org.spongepowered.api.event.cause.Cause cause,
java.util.UUID user,
java.lang.String name)
Removes a home.
|
static final java.lang.String DEFAULT_HOME_NAME
static final java.lang.String HOME_COUNT_OPTION
@Deprecated static final java.lang.String ALTERNATIVE_HOME_COUNT_OPTION
HOME_COUNT_OPTION as the permission option to set
home counts, as that will override this one.HOME_COUNT_OPTION.
Should only be used for reading, as an option named HOME_COUNT_OPTION
will supersede this.static final java.util.regex.Pattern HOME_NAME_PATTERN
default int getHomeCount(java.util.UUID user)
user - The UUID of the playerdefault int getHomeCount(org.spongepowered.api.entity.living.player.User user)
user - The Userjava.util.List<Home> getHomes(java.util.UUID user)
Homes for the specified user, identified by their UUID.user - The UUIDdefault java.util.List<Home> getHomes(org.spongepowered.api.entity.living.player.User user)
Homes for the specified user, identified by their UUID.user - The UUIDjava.util.Optional<Home> getHome(java.util.UUID user, java.lang.String name)
user - The UUID of the user to get the home for.name - The name of the home.Home, if it exists.default java.util.Optional<Home> getHome(org.spongepowered.api.entity.living.player.User user, java.lang.String name)
void createHome(org.spongepowered.api.event.cause.Cause cause,
org.spongepowered.api.entity.living.player.User user,
java.lang.String name,
org.spongepowered.api.world.Location<org.spongepowered.api.world.World> location,
com.flowpowered.math.vector.Vector3d rotation)
throws HomeException
Home names must follow the regex defined by HOME_NAME_PATTERN.
cause - The Cause of the change. The PluginContainer must be the root cause.user - The UUID of the user to create the home for.name - The name of the home to create.location - The location of the home.rotation - The rotation of the player when they return to this home.HomeException - if the home could not be created as the name is incorrect,
could not be created due to home limits, or if a plugin
cancelled the creation event.default void createHome(org.spongepowered.api.event.cause.Cause cause,
java.util.UUID user,
java.lang.String name,
org.spongepowered.api.world.Location<org.spongepowered.api.world.World> location,
com.flowpowered.math.vector.Vector3d rotation)
throws HomeException,
NoSuchPlayerException
Home names must follow the regex defined by HOME_NAME_PATTERN.
cause - The Cause of the change. The PluginContainer must be the root cause.user - The UUID of the user to create the home for.name - The name of the home to create.location - The location of the home.rotation - The rotation of the player when they return to this home.HomeException - if the home could not be created as the name is incorrect,
could not be created due to home limits, or if a plugin
cancelled the creation event.NoSuchPlayerException - if the UUID does not map onto a player.default void modifyHome(org.spongepowered.api.event.cause.Cause cause,
java.util.UUID user,
java.lang.String name,
org.spongepowered.api.world.Location<org.spongepowered.api.world.World> location,
com.flowpowered.math.vector.Vector3d rotation)
throws HomeException
cause - The Cause of the change. The PluginContainer must be the root cause.user - The UUID of the user to modify the home for.name - The name of the home to modify.location - The location of the home.rotation - The rotation of the player when they return to this home.HomeException - if the home could not be found or if a plugin cancelled
the event.void modifyHome(org.spongepowered.api.event.cause.Cause cause,
Home home,
org.spongepowered.api.world.Location<org.spongepowered.api.world.World> location,
com.flowpowered.math.vector.Vector3d rotation)
throws HomeException
cause - The Cause of the change. The PluginContainer must be the root cause.home - The Home to modify.location - The location of the home.rotation - The rotation of the player when they return to this home.HomeException - if the home could not be found, or a plugin cancelled the event.default void modifyHome(org.spongepowered.api.event.cause.Cause cause,
org.spongepowered.api.entity.living.player.User user,
java.lang.String name,
org.spongepowered.api.world.Location<org.spongepowered.api.world.World> location,
com.flowpowered.math.vector.Vector3d rotation)
throws HomeException
HomeExceptiondefault void modifyOrCreateHome(org.spongepowered.api.event.cause.Cause cause,
org.spongepowered.api.entity.living.player.User user,
java.lang.String name,
org.spongepowered.api.world.Location<org.spongepowered.api.world.World> location,
com.flowpowered.math.vector.Vector3d rotation)
throws HomeException
cause - The Cause of the change. The PluginContainer must be the root cause.user - The UUID of the user to modify the home for.name - The name of the home to modify or create.location - The location of the home.rotation - The rotation of the player when they return to this home.HomeException - if the home could not be created, due to home limits, or a plugin cancelled the event.default void modifyOrCreateHome(org.spongepowered.api.event.cause.Cause cause,
java.util.UUID user,
java.lang.String name,
org.spongepowered.api.world.Location<org.spongepowered.api.world.World> location,
com.flowpowered.math.vector.Vector3d rotation)
throws HomeException,
NoSuchPlayerException
cause - The Cause of the change. The PluginContainer must be the root cause.user - The UUID of the user to modify the home for.name - The name of the home to modify or create.location - The location of the home.rotation - The rotation of the player when they return to this home.HomeException - if the home could not be created, due to home limits, or a plugin cancelled the event.NoSuchPlayerException - if the supplied UUID does not map to a known userdefault void removeHome(org.spongepowered.api.event.cause.Cause cause,
java.util.UUID user,
java.lang.String name)
throws HomeException
cause - The Cause of the change. The PluginContainer must be the root cause.user - The UUID of the user to remove the home of.name - The name of the home to remove.HomeException - if the home could not be found, or a plugin cancelled the event.void removeHome(org.spongepowered.api.event.cause.Cause cause,
Home home)
throws HomeException
cause - The Cause of the change. The PluginContainer must be the root cause.home - The Home to remove.HomeException - if the home could not be found, or a plugin cancelled the event.int getMaximumHomes(java.util.UUID uuid)
throws java.lang.IllegalArgumentException
uuid - The UUID of the player.Integer.MAX_VALUE if unlimited.java.lang.IllegalArgumentException - if the user cannot be foundint getMaximumHomes(org.spongepowered.api.entity.living.player.User user)
user - The User.Integer.MAX_VALUE if unlimited.