Class Garage
java.lang.Object
nl.sbdeveloper.vehiclesplus.api.garages.Garage
- All Implemented Interfaces:
QueuedSavable
,Savable
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct a new Garage.Represents a Garage.Constructs a new Garage instance with the provided parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a member to this garage.void
Adds a member to this garage with a specified role name.Adds a new role to the garage.void
addVehicle
(UUID vehicle) Add a vehicle to this garage.void
The display name of the garage menu Might contain ChatColor (as ampersand string)!Get the member object of a player in this garage.getMember
(org.bukkit.entity.Player player) Get the member object of a player in this garage.The members of this garage@NotNull String
getName()
The name and unique identifier of this garage (used for the command /garage (name))org.bukkit.OfflinePlayer
getOwner()
Get the owner of this garage.Returns the GarageRole object associated with the specified role name.Returns the GarageRole object associated with the specified role name.getRole
(org.bukkit.entity.Player player) Get the role of a player in this garage.getRoles()
The roles of this garageThe list of vehicles in this garageboolean
Represents whether this garage is a personal garage or broaderboolean
removeMember
(UUID member) Removes a member from the garage.boolean
removeRole
(String roleName) Removes a role from the garage.boolean
removeRole
(String roleName, boolean force) Removes a role from the garage.boolean
removeVehicle
(UUID vehicle) Remove a vehicle from this garage.void
setDisplayName
(String displayName) Change the display name of this garage.void
Change the name of this garage.void
setOwner
(org.bukkit.entity.Player owner) Set the owner of this garage.void
setPersonal
(boolean personal) Represents whether this garage is a personal garage or broaderMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface nl.sbdeveloper.vehiclesplus.storage.db.QueuedSavable
save
-
Constructor Details
-
Garage
Construct a new Garage.- Parameters:
name
- The name and unique identifier of the garage.ownerUUID
- The UUID of the owner.
-
Garage
Represents a Garage. -
Garage
public Garage(@NotNull @NotNull String name, @NotNull @NotNull UUID ownerUUID, String displayName, boolean personal) Constructs a new Garage instance with the provided parameters.- Parameters:
name
- The name and unique identifier of the garage. (NonNull)ownerUUID
- The UUID of the owner. (NonNull)displayName
- The display name of the garage menu. (Nullable)personal
- Indicates if the garage is personal or not.
-
-
Method Details
-
forceSave
- Specified by:
forceSave
in interfaceQueuedSavable
- Throws:
DataStorageException
-
getSaveIdentifier
- Specified by:
getSaveIdentifier
in interfaceQueuedSavable
-
getSaveError
- Specified by:
getSaveError
in interfaceQueuedSavable
-
addRole
Adds a new role to the garage.- Parameters:
roleName
- The name of the role to add. (NonNull)- Returns:
- The GarageRoles object representing the added role.
-
removeRole
Removes a role from the garage.- Parameters:
roleName
- The name of the role to remove. (NonNull)- Returns:
- true if the role was successfully removed, false otherwise.
-
removeRole
Removes a role from the garage.- Parameters:
roleName
- The name of the role to remove. (NonNull)force
- Indicates whether to remove the role even if it is assigned to a member.- Returns:
- true if the role was successfully removed, false otherwise.
-
getRole
Get the role of a player in this garage.- Parameters:
player
- The player to get the role of.- Returns:
- The role of the player in this garage.
-
getRole
Returns the GarageRole object associated with the specified role name. If the role does not exist, null is returned.- Parameters:
roleName
- The name of the role to retrieve. (NonNull)- Returns:
- The GarageRole object associated with the specified role name, or null if the role does not exist.
-
getRole
Returns the GarageRole object associated with the specified role name. If the role does not exist, null is returned.- Parameters:
roleName
- The name of the role to retrieve. (NonNull)force
- Indicates whether to add the role if it does not exist.- Returns:
- The GarageRole object associated with the specified role name, or null if the role does not exist.
-
addMember
Adds a member to this garage.- Parameters:
member
- The UUID of the member to add. (NonNull)
-
addMember
Adds a member to this garage with a specified role name.- Parameters:
member
- The UUID of the member to add. (NonNull)roleName
- The name of the role to assign to the member. (NonNull)
-
removeMember
Removes a member from the garage.- Parameters:
member
- The UUID of the member to remove.- Returns:
- true if the member was successfully removed, false otherwise.
-
getMember
Get the member object of a player in this garage.- Parameters:
playerUUID
- The UUID of the player to get the member object of.- Returns:
- The member object of the player in this garage.
-
getMember
Get the member object of a player in this garage.- Parameters:
player
- The player to get the member object of.- Returns:
- The member object of the player in this garage.
-
addVehicle
Add a vehicle to this garage. -
removeVehicle
Remove a vehicle from this garage. -
getOwner
public org.bukkit.OfflinePlayer getOwner()Get the owner of this garage.- Returns:
- The owner of this garage.
-
setOwner
public void setOwner(org.bukkit.entity.Player owner) Set the owner of this garage.- Parameters:
owner
- The new owner of this garage.
-
getName
The name and unique identifier of this garage (used for the command /garage (name)) -
isPersonal
public boolean isPersonal()Represents whether this garage is a personal garage or broader -
getMembers
The members of this garage -
getRoles
The roles of this garage -
getDisplayName
The display name of the garage menu Might contain ChatColor (as ampersand string)! -
getVehicles
The list of vehicles in this garage -
setPersonal
public void setPersonal(boolean personal) Represents whether this garage is a personal garage or broader -
setName
Change the name of this garage. -
setDisplayName
Change the display name of this garage.
-