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
Modifier and TypeClassDescriptionstatic enum
Reasons 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
ConstructorDescriptionPlayerModifyBlockPermissionEvent
(Player player, Arena arena, Block block, @Nullable BlockEvent bukkitEvent) -
Method Summary
Modifier and TypeMethodDescriptiongetArena()
Returns theArena
that is involved in this event.getBlock()
Returns the block with which we're dealing now.@Nullable BlockEvent
Returns the original block event with which we're dealing now.static HandlerList
boolean
Returns when there are any issues that cause the original BukkitEvent to get cancelled.boolean
Whether the player tries to break a block.boolean
Returns whether the given issue is present.boolean
Whether the player tries to place a block.void
Removes all existing issues.void
setIssuePresent
(PlayerModifyBlockPermissionEvent.Issue issue, boolean present) Set whether an issue is present.Methods inherited from class org.bukkit.event.player.PlayerEvent
getPlayer
Methods 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:ArenaEvent
Returns theArena
that is involved in this event.- Specified by:
getArena
in 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
null
if 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:
true
when the player tries to place a block
-
isBreakEvent
public boolean isBreakEvent()Whether the player tries to break a block.- Returns:
true
when 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:
true
when 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
-true
when it's present
-
hasIssues
public boolean hasIssues()Returns when there are any issues that cause the original BukkitEvent to get cancelled.- Returns:
true
w hen there's at least one issue
-
removeIssues
public void removeIssues()Removes all existing issues. -
getHandlers
- Specified by:
getHandlers
in classEvent
-
getHandlerList
-