Package net.fateuhc.plugin.api.managers
Class GameManager
java.lang.Object
net.fateuhc.plugin.api.managers.GameManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the current state of the UHC game.Retrieves the type of the game.org.bukkit.inventory.ItemStackRetrieves the golden head ItemStack from the UHC GameManager.voidgetHost()Retrieves the host of the UHC game.org.bukkit.LocationRetrieves the center location of the UHC game.voidRetrieves the winner of the UHC game.voidgiveStarterInventory(org.bukkit.entity.Player player) Gives the starter inventory to the specified player.voidhandleItems(org.bukkit.entity.Player player) Handles the items for the specified player.voidhandleSpectatorItems(org.bukkit.entity.Player player) Handles the spectator items for the specified player.booleanisGame()Checks if the game is currently in progress.booleanisPVP()Returns the current status of Player versus Player (PvP) in the UHC game.booleanChecks if the game is currently running or in the starting state.voidsendOreAlert(org.bukkit.block.Block ore, org.bukkit.entity.Player player, int amount) Sends an ore alert to the specified player.voidsendPvPAlert(org.bukkit.entity.Player damager, org.bukkit.entity.Player victim) Sends a Player versus Player (PvP) alert to the game manager.
-
Constructor Details
-
GameManager
public GameManager()
-
-
Method Details
-
getUHCCenter
public org.bukkit.Location getUHCCenter()Retrieves the center location of the UHC game.- Returns:
- The center location of the UHC game.
-
giveStarterInventory
public void giveStarterInventory(org.bukkit.entity.Player player) Gives the starter inventory to the specified player.- Parameters:
player- The player to give the starter inventory to.
-
getGameType
Retrieves the type of the game.- Returns:
- The type of the game as a string.
-
getGoldenHead
public org.bukkit.inventory.ItemStack getGoldenHead()Retrieves the golden head ItemStack from the UHC GameManager.- Returns:
- The golden head ItemStack.
-
sendOreAlert
public void sendOreAlert(org.bukkit.block.Block ore, org.bukkit.entity.Player player, int amount) Sends an ore alert to the specified player.- Parameters:
ore- The block representing the ore that was mined.player- The player who mined the ore.amount- The amount of ore that was mined.
-
sendPvPAlert
public void sendPvPAlert(org.bukkit.entity.Player damager, org.bukkit.entity.Player victim) Sends a Player versus Player (PvP) alert to the game manager.- Parameters:
damager- The player who attacked another player.victim- The player who was attacked.
-
isPVP
public boolean isPVP()Returns the current status of Player versus Player (PvP) in the UHC game.- Returns:
trueif PvP is enabled,falseotherwise.
-
isRunning
public boolean isRunning()Checks if the game is currently running or in the starting state.- Returns:
trueif the game is running or in the starting state,falseotherwise.
-
isGame
public boolean isGame()Checks if the game is currently in progress.- Returns:
trueif the game is in progress,falseotherwise.
-
getGameState
Retrieves the current state of the UHC game.- Returns:
- The current state of the UHC game as a GameState object.
-
handleItems
public void handleItems(org.bukkit.entity.Player player) Handles the items for the specified player. This method delegates the handling of items to the GameManager class in the UHC instance.- Parameters:
player- The player for whom to handle the items.
-
handleSpectatorItems
public void handleSpectatorItems(org.bukkit.entity.Player player) Handles the spectator items for the specified player. This method delegates the handling of items to the GameManager class in the UHC instance.- Parameters:
player- The player for whom to handle the spectator items.
-
getHost
public void getHost()Retrieves the host of the UHC game. -
getWinner
public void getWinner()Retrieves the winner of the UHC game.
-