Class BombermanGame

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

public class BombermanGame extends Object implements Minigame
Represents a Bomberman game, implementing the Minigame interface and handling player interactions, game state updates, and rendering.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructs a new Bomberman 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
    onDeath(org.bukkit.event.entity.PlayerDeathEvent event)
    Handles player death events to eliminate players.
    void
    Cleans up resources when the game is destroyed.
    void
    Initializes the Bomberman game.
    void
    onInteract(org.bukkit.event.player.PlayerInteractEvent event)
    Handles player interactions with TNT items.
    void
    removeItems(org.bukkit.entity.Player player)
    Removes items from the player's inventory when they leave the game.
    void
    Renders the game state.
    boolean
    Determines if the game should quit.
    void
    Updates the game 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, 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
    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

    • BombermanGame

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

    • onInit

      public void onInit()
      Initializes the Bomberman 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()
      Updates the game state.
      Specified by:
      update in interface Minigame
    • render

      public void render()
      Renders the game state.
      Specified by:
      render in interface Minigame
    • onDestroy

      public void onDestroy()
      Cleans up resources when the game is destroyed.
      Specified by:
      onDestroy in interface Minigame
    • 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
    • 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
    • removeItems

      public void removeItems(org.bukkit.entity.Player player)
      Removes items from the player's inventory when they leave the game.
      Specified by:
      removeItems in interface Minigame
      Parameters:
      player - the player whose items should be removed
    • onInteract

      public void onInteract(org.bukkit.event.player.PlayerInteractEvent event)
      Handles player interactions with TNT items.
      Specified by:
      onInteract in interface Minigame
      Parameters:
      event - the PlayerInteractEvent
    • onDeath

      public void onDeath(org.bukkit.event.entity.PlayerDeathEvent event)
      Handles player death events to eliminate players.
      Specified by:
      onDeath in interface Minigame
      Parameters:
      event - the PlayerDeathEvent