public interface NucleusHomeService
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_HOME_NAME
The default home name.
|
static Pattern |
HOME_NAME_PATTERN
The pattern that all home names must follow.
|
Modifier and Type | Method and Description |
---|---|
void |
createHome(Cause cause,
User user,
String name,
Location<World> location,
Vector3d rotation)
Creates a home.
|
default void |
createHome(Cause cause,
UUID user,
String name,
Location<World> location,
Vector3d rotation) |
default Optional<Home> |
getHome(User user,
String name) |
Optional<Home> |
getHome(UUID user,
String name)
Gets a specified home of the user, if it exists.
|
default int |
getHomeCount(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(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(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(Cause cause,
Home home,
Location<World> location,
Vector3d rotation)
Modifies a home's location.
|
default void |
modifyHome(Cause cause,
User user,
String name,
Location<World> location,
Vector3d rotation) |
default void |
modifyHome(Cause cause,
UUID user,
String name,
Location<World> location,
Vector3d rotation)
Modifies a home's location.
|
default void |
modifyOrCreateHome(Cause cause,
User user,
String name,
Location<World> location,
Vector3d rotation)
Modifies a home's location, if it exists, otherwise creates a home.
|
default void |
modifyOrCreateHome(Cause cause,
UUID user,
String name,
Location<World> location,
Vector3d rotation)
Modifies a home's location, if it exists, otherwise creates a home.
|
void |
removeHome(Cause cause,
Home home)
Removes a home.
|
default void |
removeHome(Cause cause,
UUID user,
String name)
Removes a home.
|
static final String DEFAULT_HOME_NAME
static final Pattern HOME_NAME_PATTERN
default int getHomeCount(UUID user)
user
- The UUID
of the playerdefault int getHomeCount(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(User user)
Home
s for the specified user, identified by their UUID.user
- The UUID
Optional<Home> getHome(UUID user, String name)
void createHome(Cause cause, User user, String name, Location<World> location, 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(Cause cause, UUID user, String name, Location<World> location, Vector3d rotation) throws NucleusException, NoSuchPlayerException
default void modifyHome(Cause cause, UUID user, String name, Location<World> location, 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(Cause cause, Home home, Location<World> location, 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(Cause cause, User user, String name, Location<World> location, Vector3d rotation) throws NucleusException
NucleusException
default void modifyOrCreateHome(Cause cause, User user, String name, Location<World> location, 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(Cause cause, UUID user, String name, Location<World> location, 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(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(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(User user)
user
- The User
.Integer.MAX_VALUE
if unlimited.