public interface Minigame extends ComponentOwner
Modifier and Type | Method and Description |
---|---|
Arena |
createArena(String id,
Location3D spawnPoint,
Boundary boundary)
|
Arena |
createArena(String id,
String name,
Location3D spawnPoint,
Boundary boundary)
|
Optional<Arena> |
getArena(String arenaId)
|
ImmutableList<Arena> |
getArenas()
|
Optional<Challenger> |
getChallenger(UUID uuid)
Gets the
Challenger by the given UUID. |
ImmutableList<Challenger> |
getChallengers()
|
<T> T |
getConfigValue(ConfigNode<T> node)
Gets the current value of the given
ConfigNode for this
Minigame . |
EventBus |
getEventBus()
|
String |
getPlugin()
Gets the name or ID of the plugin to which this
Minigame belongs. |
ImmutableList<Round> |
getRounds()
|
void |
removeArena(Arena arena)
|
void |
removeArena(String id)
|
<T> void |
setConfigValue(ConfigNode<T> node,
T value)
Gets the current value of the given
ConfigNode for this
Minigame . |
String getPlugin()
Minigame
belongs.Minigame
belongs.<T> T getConfigValue(ConfigNode<T> node)
ConfigNode
for this
Minigame
.
If node
is an instance of a
RoundConfigNode
, value
will
be used as a default return value for
Round.getConfigValue(RoundConfigNode)
when not set for an
individual Round
.
T
- The value type associated with node
node
- The ConfigNode
to look upnode
for this Minigame
<T> void setConfigValue(ConfigNode<T> node, T value)
ConfigNode
for this
Minigame
.
If node
is an instance of a
RoundConfigNode
, value
will
be used as a default return value for
Round.getConfigValue(RoundConfigNode)
when not set for an
individual Round
.
T
- The value type associated with node
node
- The ConfigNode
to look upvalue
- The new value of node
for this Minigame
ImmutableList<Arena> getArenas()
ImmutableSet
containing all Arena
s owned by
this Minigame
.Arena createArena(String id, String name, Location3D spawnPoint, Boundary boundary) throws IllegalArgumentException
Arena
within this Minigame
with
the given identifier, name, and initial spawn point.id
- The identifier of the new Arena
(will be converted to
lowercase)name
- The "friendly" name of this Arena
(i.e. the one
displayed to users)spawnPoint
- The initial spawn point for the new Arena
boundary
- The Boundary
of the new Arena
Arena
IllegalArgumentException
- If an Arena
with the given
identifier already exists, if spawnPoint
does not contain a
world, or if the ID or name contain characters not permitted by the
implementationArena createArena(String id, Location3D spawnPoint, Boundary boundary) throws IllegalArgumentException
Arena
within this Minigame
with
the given identifier and initial spawn point.id
- The identifier of the new Arena
(will be converted to
lowercase, although the display name will retain the original case)spawnPoint
- The initial spawn point for the new Arena
boundary
- The Boundary
of the new Arena
Arena
IllegalArgumentException
- If an Arena
with the given
identifier already exists, if spawnPoint
does not contain a
world, or if the id or name contain characters not permitted by the
implementationvoid removeArena(String id) throws IllegalArgumentException
Arena
with the given ID from this Minigame
.
Note that calling this method will orphan the Arena
object
associated with the passed ID, causing all of its methods to throw
OrphanedComponentException
s.
id
- The ID of the Arena
to remove (will be converted to
lowercase)IllegalArgumentException
- If an Arena
with the given ID is
not associated with this Minigame
void removeArena(Arena arena) throws IllegalArgumentException
Arena
with the given ID from this Minigame
.
Note that calling this method will orphan the passed Arena
object, causing all of its methods to throw
OrphanedComponentException
s.
arena
- The Arena
to removeIllegalArgumentException
- If the given Arena
has already
been removed or is otherwise not associated with this
Minigame
ImmutableList<Round> getRounds()
ImmutableList
containing all active Round
s
owned by this Minigame
.ImmutableList<Challenger> getChallengers()
ImmutableList
containing all active
Challenger
s owned by this Minigame
.Optional<Challenger> getChallenger(UUID uuid)
Challenger
by the given UUID.uuid
- The UUID to look upChallenger
by the given UUID