Class GamesManager

java.lang.Object
fr.multimc.api.spigot.games.GamesManager

public class GamesManager extends Object
  • 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

      public void updateInstanceState(int instanceId, @NotNull @NotNull GameState state)
      Called by instance to update their state, and if all are stopped, reset the instances manager
      Parameters:
      instanceId - ID if the instance
      state - New state for the instance
    • stopManager

      public void stopManager()
      Reset the instances manager
    • getTeamFromPlayer

      @Nullable public @Nullable MmcTeam getTeamFromPlayer(@NotNull @NotNull MmcPlayer mmcPlayer)
      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

      public void addSpectator(@NotNull @NotNull MmcPlayer spectator, int instanceId)
    • removeSpectator

      public void removeSpectator(@NotNull @NotNull MmcPlayer spectator)
    • isSpectator

      public boolean isSpectator(@NotNull @NotNull MmcPlayer player)
    • getLobbyWorld

      public MmcWorld getLobbyWorld()
    • getGameWorld

      public MmcWorld getGameWorld()
    • getState

      public ManagerState getState()
    • getInstances

      public List<GameInstance> getInstances()
    • getMessageFactory

      public MessagesFactory getMessageFactory()
    • getGameSettings

      public GameSettings getGameSettings()