Package de.marcely.bedwars.api.arena
Class QueuedCloningArena
java.lang.Object
de.marcely.bedwars.api.arena.QueuedCloningArena
Represents a queued entry within
ArenaCloningManager.-
Constructor Summary
ConstructorsConstructorDescriptionQueuedCloningArena(Arena arena) QueuedCloningArena(Arena arena, @Nullable Integer playersPerTeam, boolean ignoreLimits, @Nullable Consumer<Optional<Arena>> callback) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCallback(Consumer<Optional<Arena>> callback) Adds a callback that will be called once the cloning has been finished.@Nullable IntegerGets the players per team amount that will be applied for the cloned arena.getArena()Gets the arena that will be cloned in the future.Gets all callbacks that are being called once the cloning has been finished.booleanWhether certain limitations shall be ignored (seeArenaCloningManager.addToQueue(QueuedCloningArena)).
-
Constructor Details
-
QueuedCloningArena
- Parameters:
arena- The arena that shall be cloned- Throws:
IllegalArgumentException- when playersPerTeam is not null and > 1
-
QueuedCloningArena
public QueuedCloningArena(Arena arena, @Nullable @Nullable Integer playersPerTeam, boolean ignoreLimits, @Nullable @Nullable Consumer<Optional<Arena>> callback) - Parameters:
arena- The arena that shall be clonedplayersPerTeam- The players per team amount that shall be applied for the cloned arena. May benullignoreLimits- Whether certain limitations shall be ignored (seeArenaCloningManager.addToQueue(QueuedCloningArena))callback- An optional callback that returns the result of the cloning. In case it succeded, the callback will include the cloned arena. It is always being called on the main thread- Throws:
IllegalArgumentException- when playersPerTeam is not null and > 1
-
-
Method Details
-
getArena
Gets the arena that will be cloned in the future.- Returns:
- The clone that this queue entry hold
-
getApplyingPlayersPerTeam
Gets the players per team amount that will be applied for the cloned arena.Basically calls
Arena.setPlayersPerTeam(int)once the arena has been cloned.nullmeans that the original players per team amount stays as it was.- Returns:
- The players per team amount of the new arena, or
nullif it stays the same
-
isIgnoringLimits
public boolean isIgnoringLimits()Whether certain limitations shall be ignored (seeArenaCloningManager.addToQueue(QueuedCloningArena)).- Returns:
trueif this entry is ignroing the existing limitations
-
getCallbacks
Gets all callbacks that are being called once the cloning has been finished.- Returns:
- The list of callbacks
-
addCallback
Adds a callback that will be called once the cloning has been finished.- Parameters:
callback- The callback to add
-