Class RouletteGame
java.lang.Object
com.storytimeproductions.stweaks.games.RouletteGame
- All Implemented Interfaces:
Minigame
Roulette game with three tables, each represented by a wall block. Players left-click to confirm,
starting a 5s countdown hologram above the wall. Other players can right-click to join the table,
which interrupts the countdown. Only main hand interactions are allowed. The table is not picked
randomly; the table is determined by the block.
-
Constructor Summary
ConstructorsConstructorDescriptionRouletteGame(GameConfig config) Constructs a new RouletteGame with the specified configuration. -
Method Summary
Modifier and TypeMethodDescriptionvoidCalled after the minigame has been initialized.booleanReturns true if players can join this game while it is already running.Gets the minigame configuration.List<org.bukkit.entity.Player> Gets the list of players currently in the minigame.voidjoin(org.bukkit.entity.Player player) Initializes the hologram lines for each slot at each table.voidleave(org.bukkit.entity.Player player) Removes the specified player from the game and updates holograms.voidInitializes the hologram lines for each slot at each table.voidonInit()Initializes the minigame.voidonInteract(org.bukkit.event.player.PlayerInteractEvent event) Handles player interaction with a table block.voidremoveItems(org.bukkit.entity.Player player) Removes all game-related items from the player's inventory.voidrender()Renders the game state.booleanDetermines if the minigame should quit.booleanReturns true if players should be teleported to the exit area when the game ends.voidupdate()Initializes the hologram lines for each slot at each table.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Minigame
onCommand, onDamage, onDeath, onMove, onSneakModifier and TypeMethodDescriptiondefault voidonCommand(org.bukkit.event.player.PlayerCommandPreprocessEvent event) Called when a player in this game runs a command.default voidonDamage(org.bukkit.event.entity.EntityDamageByEntityEvent event) Called when a player in this game damages another player in this game.default voidonDeath(org.bukkit.event.entity.PlayerDeathEvent event) Called when a player in this game dies.default voidonMove(org.bukkit.event.player.PlayerMoveEvent event) Called when a player in this game moves.default voidonSneak(org.bukkit.event.player.PlayerToggleSneakEvent event) Called when a player in this game toggles sneak.
-
Constructor Details
-
RouletteGame
Constructs a new RouletteGame with the specified configuration.- Parameters:
config- the game configuration containing properties and settings
-
-
Method Details
-
onInit
-
afterInit
-
update
-
render
-
onDestroy
-
join
-
leave
-
getPlayers
Description copied from interface:MinigameGets the list of players currently in the minigame.- Specified by:
getPlayersin interfaceMinigame- Returns:
- a list of players in the minigame
-
getConfig
Description copied from interface:MinigameGets the minigame configuration. -
shouldQuit
public boolean shouldQuit()Description copied from interface:MinigameDetermines if the minigame should quit.- Specified by:
shouldQuitin interfaceMinigame- Returns:
- true if the minigame should quit, false otherwise
-
removeItems
public void removeItems(org.bukkit.entity.Player player) Description copied from interface:MinigameRemoves all game-related items from the player's inventory.- Specified by:
removeItemsin interfaceMinigame- Parameters:
player- the player whose items will be removed
-
allowsConcurrentJoins
public boolean allowsConcurrentJoins()Description copied from interface:MinigameReturns true if players can join this game while it is already running. Defaults to false (players must wait for the previous round to finish).- Specified by:
allowsConcurrentJoinsin interfaceMinigame
-
shouldTeleportOnExit
public boolean shouldTeleportOnExit()Description copied from interface:MinigameReturns true if players should be teleported to the exit area when the game ends. Defaults to true; override to false for games that manage their own exit flow.- Specified by:
shouldTeleportOnExitin interfaceMinigame
-
onInteract
public void onInteract(org.bukkit.event.player.PlayerInteractEvent event) Handles player interaction with a table block. Only main hand interactions are allowed.- Specified by:
onInteractin interfaceMinigame
-