Class PlayerBuyUpgradeEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
de.marcely.bedwars.api.event.player.PlayerBuyUpgradeEvent
- All Implemented Interfaces:
- ArenaEvent
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic enumDefault problems used and provided by the pluginstatic classNested classes/interfaces inherited from class org.bukkit.event.EventEvent.Result
- 
Field SummaryFields inherited from class org.bukkit.event.player.PlayerEventplayer
- 
Constructor SummaryConstructorsConstructorDescriptionPlayerBuyUpgradeEvent(Player player, Arena arena, Team team, UpgradeLevel level, List<PlayerBuyUpgradeEvent.Problem> problems, boolean broadcastingMessage, boolean broadcastingSound, boolean doingUpgrade, boolean takePayments) 
- 
Method SummaryModifier and TypeMethodDescriptionbooleanAdd a problem that will prevent the item from being bought.booleanaddProblem(PlayerBuyUpgradeEvent.Problem problem) Add a problem that will prevent the item from being bought.getArena()Returns the arena in which the player is playing.static HandlerListReturns the problems that are preventing the item from being boughtgetTeam()Returns the team in which the player bought the upgrade for.The upgrade level that was purchased by the playerbooleanWhether or not a message will be sent out to all team players when an upgrade or trap is purchasedbooleanWhether or not a sound will be played when an upgrade or trap is purchasedbooleanReturns whether or not the player will receive the products of the item.booleanReturns whether or not it will take the payments from the player.booleanisTrap()Returns if the handler attached to this upgrade level is a trap handlerintRemoves all problems and makes it buyable by that.booleanRemoves a problem.booleanRemoves a problem.voidsetBroadcastingMessage(boolean broadcastingMessage) Sets whether or not a message will be sent out to all team players when an upgrade or trap is purchasedvoidsetBroadcastingSound(boolean broadcastingSound) Set whether or not a sound should be played when an upgrade or trap is purchasedvoidsetDoingUpgrade(boolean doingUpgrade) Define whether or not if he'll get products.voidsetTakingPayments(boolean takePayments) Define whether or not the payments will be taken from the player.Methods inherited from class org.bukkit.event.player.PlayerEventgetPlayerMethods inherited from class org.bukkit.event.EventgetEventName, isAsynchronous
- 
Constructor Details- 
PlayerBuyUpgradeEventpublic PlayerBuyUpgradeEvent(Player player, Arena arena, Team team, UpgradeLevel level, List<PlayerBuyUpgradeEvent.Problem> problems, boolean broadcastingMessage, boolean broadcastingSound, boolean doingUpgrade, boolean takePayments) 
 
- 
- 
Method Details- 
getArenaReturns the arena in which the player is playing.- Specified by:
- getArenain interface- ArenaEvent
- Returns:
- The arena in which the player currently is inside
 
- 
getTeamReturns the team in which the player bought the upgrade for.- Returns:
- the team that is being upgraded
 
- 
isTrappublic boolean isTrap()Returns if the handler attached to this upgrade level is a trap handler- Returns:
- check if the upgrade level that was purchased is a trap
 
- 
getUpgradeLevelThe upgrade level that was purchased by the player- Returns:
- get the upgrade level that was purchased
 
- 
isBroadcastingMessagepublic boolean isBroadcastingMessage()Whether or not a message will be sent out to all team players when an upgrade or trap is purchased- Returns:
- if a message will be broadcast
 
- 
setBroadcastingMessagepublic void setBroadcastingMessage(boolean broadcastingMessage) Sets whether or not a message will be sent out to all team players when an upgrade or trap is purchased- Parameters:
- broadcastingMessage- if a message should be broadcast
 
- 
isBroadcastingSoundpublic boolean isBroadcastingSound()Whether or not a sound will be played when an upgrade or trap is purchased- Returns:
- if the sound is being played
 
- 
setBroadcastingSoundpublic void setBroadcastingSound(boolean broadcastingSound) Set whether or not a sound should be played when an upgrade or trap is purchased- Parameters:
- broadcastingSound- if the sound should be played
 
- 
getProblemsReturns the problems that are preventing the item from being bought- Returns:
- The problems
 
- 
addProblemAdd a problem that will prevent the item from being bought.Act's similar as Cancellable.setCancelled(boolean).- Parameters:
- problem- The problem why he can't buy it
- Returns:
- falseif it already has been added
 
- 
addProblemAdd a problem that will prevent the item from being bought.Act's similar as Cancellable.setCancelled(boolean).- Parameters:
- problem- The problem why he can't buy it
- Returns:
- falseif it already has been added
 
- 
removeProblemRemoves a problem.- Parameters:
- problem- The problem
- Returns:
- If it has been removed or not
 
- 
removeProblemRemoves a problem.- Parameters:
- problem- The problem
- Returns:
- If it has been removed or not
 
- 
removeAllProblemspublic int removeAllProblems()Removes all problems and makes it buyable by that.- Returns:
- The amount of problems that have been removed
 
- 
isDoingUpgradepublic boolean isDoingUpgrade()Returns whether or not the player will receive the products of the item.Does not concern when there are problems as he won't receive them if there are problems anyways. - Returns:
- If he'll get the products or not
 
- 
setDoingUpgradepublic void setDoingUpgrade(boolean doingUpgrade) Define whether or not if he'll get products.Keep in mind that problems can prevent products being given to him. - Parameters:
- doingUpgrade- The new value
 
- 
isTakingPaymentspublic boolean isTakingPayments()Returns whether or not it will take the payments from the player.Does not concern when there are problems as they're preventing them from being taken anyways. - Returns:
- If the payments will be taken or not
 
- 
setTakingPaymentspublic void setTakingPayments(boolean takePayments) Define whether or not the payments will be taken from the player.Keep in mind that problems can prevent this - Parameters:
- takePayments- The new value
 
- 
getHandlers- Specified by:
- getHandlersin class- Event
 
- 
getHandlerList
 
-