Class BlockPartyGame

java.lang.Object
com.storytimeproductions.stweaks.games.BlockPartyGame
All Implemented Interfaces:
Minigame

public class BlockPartyGame extends Object implements Minigame
Represents a Block Party game where players must stand on the correct colored blocks. Implements the Minigame interface for game lifecycle management.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new Block Party game with the specified configuration.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Called after the game has been initialized.
    Gets the game configuration.
    List<org.bukkit.entity.Player>
    Gets the list of players currently in the game.
    void
    join(org.bukkit.entity.Player player)
    Adds the specified player to the game.
    void
    leave(org.bukkit.entity.Player player)
    Removes the specified player from the game.
    void
    Cleans up resources when the game is destroyed.
    void
    Initializes the BlockParty game.
    void
    removeItems(org.bukkit.entity.Player player)
    Removes all game-related items from the player's inventory.
    void
    Renders the minigame state.
    boolean
    Determines if the game should quit.
    void
    Updates the minigame state.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface Minigame

    allowsConcurrentJoins, onCommand, onDamage, onDeath, onInteract, onMove, onSneak, shouldTeleportOnExit
    Modifier and Type
    Method
    Description
    default boolean
    Returns true if players can join this game while it is already running.
    default void
    onCommand(org.bukkit.event.player.PlayerCommandPreprocessEvent event)
    Called when a player in this game runs a command.
    default void
    onDamage(org.bukkit.event.entity.EntityDamageByEntityEvent event)
    Called when a player in this game damages another player in this game.
    default void
    onDeath(org.bukkit.event.entity.PlayerDeathEvent event)
    Called when a player in this game dies.
    default void
    onInteract(org.bukkit.event.player.PlayerInteractEvent event)
    Called when a player in this game interacts with a block or air.
    default void
    onMove(org.bukkit.event.player.PlayerMoveEvent event)
    Called when a player in this game moves.
    default void
    onSneak(org.bukkit.event.player.PlayerToggleSneakEvent event)
    Called when a player in this game toggles sneak.
    default boolean
    Returns true if players should be teleported to the exit area when the game ends.
  • Constructor Details

    • BlockPartyGame

      public BlockPartyGame(GameConfig config)
      Constructs a new Block Party game with the specified configuration.
      Parameters:
      config - the game configuration
  • Method Details

    • onInit

      public void onInit()
      Initializes the BlockParty game.
      Specified by:
      onInit in interface Minigame
    • afterInit

      public void afterInit()
      Called after the game has been initialized.
      Specified by:
      afterInit in interface Minigame
    • update

      public void update()
      Description copied from interface: Minigame
      Updates the minigame state.
      Specified by:
      update in interface Minigame
    • render

      public void render()
      Description copied from interface: Minigame
      Renders the minigame state.
      Specified by:
      render in interface Minigame
    • getPlayers

      public List<org.bukkit.entity.Player> getPlayers()
      Gets the list of players currently in the game.
      Specified by:
      getPlayers in interface Minigame
      Returns:
      a list of players in the game
    • getConfig

      public GameConfig getConfig()
      Gets the game configuration.
      Specified by:
      getConfig in interface Minigame
      Returns:
      the game configuration
    • shouldQuit

      public boolean shouldQuit()
      Determines if the game should quit.
      Specified by:
      shouldQuit in interface Minigame
      Returns:
      true if the game should quit, false otherwise
    • join

      public void join(org.bukkit.entity.Player player)
      Adds the specified player to the game.
      Specified by:
      join in interface Minigame
      Parameters:
      player - the player to add
    • leave

      public void leave(org.bukkit.entity.Player player)
      Removes the specified player from the game.
      Specified by:
      leave in interface Minigame
      Parameters:
      player - the player to remove
    • onDestroy

      public void onDestroy()
      Cleans up resources when the game is destroyed.
      Specified by:
      onDestroy in interface Minigame
    • removeItems

      public void removeItems(org.bukkit.entity.Player player)
      Description copied from interface: Minigame
      Removes all game-related items from the player's inventory.
      Specified by:
      removeItems in interface Minigame
      Parameters:
      player - the player whose items will be removed