Package fr.multimc.api.spigot.games
Class GamesManager
java.lang.Object
fr.multimc.api.spigot.games.GamesManager
-
Constructor Summary
ConstructorsConstructorDescriptionGamesManager
(@NotNull org.bukkit.plugin.java.JavaPlugin plugin, GamesManagerSettings managerSettings) Default constructor for the InstancesManager -
Method Summary
Modifier and TypeMethodDescriptionvoid
addSpectator
(@NotNull MmcPlayer spectator, int instanceId) @Nullable GameInstance
getInstanceFromPlayer
(@NotNull MmcPlayer mmcPlayer) Get an instance from a MmcPlayer object@Nullable GameInstance
getInstanceFromSpectator
(@NotNull MmcPlayer mmcPlayer) getState()
@Nullable MmcTeam
getTeamFromPlayer
(@NotNull MmcPlayer mmcPlayer) Get a team from a MmcPlayer objectboolean
isSpectator
(@NotNull MmcPlayer player) void
preAllocate
(int allocateCount) Pre-allocate schematics for instancesvoid
removeSpectator
(@NotNull MmcPlayer spectator) void
Start the instances manager from sync to asyncvoid
Reset the instances managervoid
updateInstanceState
(int instanceId, @NotNull GameState state) Called by instance to update their state, and if all are stopped, reset the instances manager
-
Constructor Details
-
GamesManager
public GamesManager(@NotNull @NotNull org.bukkit.plugin.java.JavaPlugin plugin, GamesManagerSettings managerSettings) Default constructor for the InstancesManager- Parameters:
plugin
- JavaPlugin instance
-
-
Method Details
-
preAllocate
public void preAllocate(int allocateCount) Pre-allocate schematics for instances- Parameters:
allocateCount
- Number of instances to allocate
-
start
public void start(@Nullable @Nullable org.bukkit.command.CommandSender sender, @NotNull @NotNull List<MmcTeam> mmcTeams) Start the instances manager from sync to async- Parameters:
mmcTeams
- List of MmcTeam instances
-
updateInstanceState
Called by instance to update their state, and if all are stopped, reset the instances manager- Parameters:
instanceId
- ID if the instancestate
- New state for the instance
-
stopManager
public void stopManager()Reset the instances manager -
getTeamFromPlayer
Get a team from a MmcPlayer object- Parameters:
mmcPlayer
- MmcPlayer object- Returns:
- Team of the player
-
getInstanceFromPlayer
@Nullable public @Nullable GameInstance getInstanceFromPlayer(@NotNull @NotNull MmcPlayer mmcPlayer) Get an instance from a MmcPlayer object- Parameters:
mmcPlayer
- MmcPlayer object- Returns:
- Instance of the player
-
getInstanceFromSpectator
@Nullable public @Nullable GameInstance getInstanceFromSpectator(@NotNull @NotNull MmcPlayer mmcPlayer) -
addSpectator
-
removeSpectator
-
isSpectator
-
getLobbyWorld
-
getGameWorld
-
getState
-
getInstances
-
getMessageFactory
-
getGameSettings
-