Class PlayerModifyBlockPermissionEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
de.marcely.bedwars.api.event.player.PlayerModifyBlockPermissionEvent
- All Implemented Interfaces:
ArenaEvent
Gets called when we want to know whether a player is permitted to modify a block.
It may gets called directly with Bukkit's BlockPlaceEvent and BlockBreakEvent.
In other cases, it may get called e.g. if a special item places multiple blocks, in which case getBukkitEvent()
returns null.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumReasons that cause the BlocKEvent to not get performed.Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result -
Field Summary
Fields inherited from class org.bukkit.event.player.PlayerEvent
player -
Constructor Summary
ConstructorsConstructorDescriptionPlayerModifyBlockPermissionEvent(Player player, Arena arena, Block block, @Nullable BlockEvent bukkitEvent) -
Method Summary
Modifier and TypeMethodDescriptiongetArena()Returns theArenathat is involved in this event.getBlock()Returns the block with which we're dealing now.@Nullable BlockEventReturns the original block event with which we're dealing now.static HandlerListbooleanReturns when there are any issues that cause the original BukkitEvent to get cancelled.booleanWhether the player tries to break a block.booleanReturns whether the given issue is present.booleanWhether the player tries to place a block.voidRemoves all existing issues.voidsetIssuePresent(PlayerModifyBlockPermissionEvent.Issue issue, boolean present) Set whether an issue is present.Methods inherited from class org.bukkit.event.player.PlayerEvent
getPlayerMethods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
PlayerModifyBlockPermissionEvent
public PlayerModifyBlockPermissionEvent(Player player, Arena arena, Block block, @Nullable @Nullable BlockEvent bukkitEvent)
-
-
Method Details
-
getArena
Description copied from interface:ArenaEventReturns theArenathat is involved in this event.- Specified by:
getArenain interfaceArenaEvent- Returns:
- The arena that is involved
-
getBukkitEvent
Returns the original block event with which we're dealing now.Cancelling it at this point has no effect, as we're manually overriding it directly after this event.
- Returns:
- The original bukkit event. May be
nullif this check was done outside of a block event
-
getBlock
Returns the block with which we're dealing now.- Returns:
- The block involved in this event
-
isPlaceEvent
public boolean isPlaceEvent()Whether the player tries to place a block.- Returns:
truewhen the player tries to place a block
-
isBreakEvent
public boolean isBreakEvent()Whether the player tries to break a block.- Returns:
truewhen the player tries to break a block
-
isIssuePresent
Returns whether the given issue is present.Issues prevent the BlockEvent from progressing, meaning that block won't be placed or breaked.
- Parameters:
issue- The issue- Returns:
truewhen it's actually an issue
-
setIssuePresent
Set whether an issue is present.Issues prevent the BlockEvent from progressing, meaning that block won't be placed or breaked.
- Parameters:
issue- The issuepresent-truewhen it's present
-
hasIssues
public boolean hasIssues()Returns when there are any issues that cause the original BukkitEvent to get cancelled.- Returns:
truew hen there's at least one issue
-
removeIssues
public void removeIssues()Removes all existing issues. -
getHandlers
- Specified by:
getHandlersin classEvent
-
getHandlerList
-