public interface NucleusHomeService
Modifier and Type | Field and Description |
---|---|
static 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 String |
DEFAULT_HOME_NAME
The default home name.
|
static String |
HOME_COUNT_OPTION
The name of the permission option that will contain the number of homes a player
may have.
|
static 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,
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,
UUID user,
String name,
org.spongepowered.api.world.Location<org.spongepowered.api.world.World> location,
com.flowpowered.math.vector.Vector3d rotation) |
default Optional<Home> |
getHome(org.spongepowered.api.entity.living.player.User user,
String name) |
Optional<Home> |
getHome(UUID user,
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(UUID user)
Gets the number of homes the player currently has.
|
default List<Home> |
getHomes(org.spongepowered.api.entity.living.player.User user)
Gets the
Home s for the specified user, identified by their UUID. |
List<Home> |
getHomes(UUID user)
Gets the
Home s 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(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,
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,
UUID user,
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,
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,
UUID user,
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,
UUID user,
String name)
Removes a home.
|
static final String DEFAULT_HOME_NAME
static final String HOME_COUNT_OPTION
@Deprecated static final 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 Pattern HOME_NAME_PATTERN
default int getHomeCount(UUID user)
user
- The UUID
of the playerdefault int getHomeCount(org.spongepowered.api.entity.living.player.User user)
user
- The User
List<Home> getHomes(UUID user)
Home
s for the specified user, identified by their UUID.user
- The UUID
default List<Home> getHomes(org.spongepowered.api.entity.living.player.User user)
Home
s for the specified user, identified by their UUID.user
- The UUID
Optional<Home> getHome(UUID user, String name)
default Optional<Home> getHome(org.spongepowered.api.entity.living.player.User user, String name)
void createHome(org.spongepowered.api.event.cause.Cause cause, org.spongepowered.api.entity.living.player.User user, String name, org.spongepowered.api.world.Location<org.spongepowered.api.world.World> location, com.flowpowered.math.vector.Vector3d rotation) throws NucleusException
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.NucleusException
- if the home could not be created, due to home limits, or a plugin cancelled the event.default void createHome(org.spongepowered.api.event.cause.Cause cause, UUID user, String name, org.spongepowered.api.world.Location<org.spongepowered.api.world.World> location, com.flowpowered.math.vector.Vector3d rotation) throws NucleusException, NoSuchPlayerException
default void modifyHome(org.spongepowered.api.event.cause.Cause cause, UUID user, String name, org.spongepowered.api.world.Location<org.spongepowered.api.world.World> location, com.flowpowered.math.vector.Vector3d rotation) throws NucleusException
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.NucleusException
- if the home could not be found, or 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 NucleusException
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.NucleusException
- 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, String name, org.spongepowered.api.world.Location<org.spongepowered.api.world.World> location, com.flowpowered.math.vector.Vector3d rotation) throws NucleusException
NucleusException
default void modifyOrCreateHome(org.spongepowered.api.event.cause.Cause cause, org.spongepowered.api.entity.living.player.User user, String name, org.spongepowered.api.world.Location<org.spongepowered.api.world.World> location, com.flowpowered.math.vector.Vector3d rotation) throws NucleusException
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.NucleusException
- 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, UUID user, String name, org.spongepowered.api.world.Location<org.spongepowered.api.world.World> location, com.flowpowered.math.vector.Vector3d rotation) throws NucleusException, 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.NucleusException
- 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, UUID user, String name) throws NucleusException
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.NucleusException
- 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 NucleusException
cause
- The Cause
of the change. The PluginContainer
must be the root cause.home
- The Home
to remove.NucleusException
- if the home could not be found, or a plugin cancelled the event.int getMaximumHomes(UUID uuid) throws IllegalArgumentException
uuid
- The UUID
of the player.Integer.MAX_VALUE
if unlimited.IllegalArgumentException
- if the user cannot be foundint getMaximumHomes(org.spongepowered.api.entity.living.player.User user)
user
- The User
.Integer.MAX_VALUE
if unlimited.