Bukkit  1.4.7-R1.0
 All Classes Namespaces Files Functions Variables Enumerator Pages
org.bukkit.event.block.BlockCanBuildEvent Class Reference

Called when we try to place a block, to see if we can build it here or not. More...

+ Inheritance diagram for org.bukkit.event.block.BlockCanBuildEvent:
+ Collaboration diagram for org.bukkit.event.block.BlockCanBuildEvent:

Public Member Functions

 BlockCanBuildEvent (final Block block, final int id, final boolean canBuild)
 
boolean isBuildable ()
 Gets whether or not the block can be built here.
 
void setBuildable (boolean cancel)
 Sets whether the block can be built here or not.
 
Material getMaterial ()
 Gets the Material that we are trying to place.
 
int getMaterialId ()
 Gets the Material ID for the Material that we are trying to place.
 
HandlerList getHandlers ()
 
- Public Member Functions inherited from org.bukkit.event.block.BlockEvent
 BlockEvent (final Block theBlock)
 
final Block getBlock ()
 Gets the block involved in this event.
 
- Public Member Functions inherited from org.bukkit.event.Event
 Event ()
 The default constructor is defined for cleaner code.
 
 Event (boolean isAsync)
 This constructor is used to explicitly declare an event as synchronous or asynchronous.
 
String getEventName ()
 
final boolean isAsynchronous ()
 Any custom event that should not by synchronized with other events must use the specific constructor.
 

Static Public Member Functions

static HandlerList getHandlerList ()
 

Protected Attributes

boolean buildable
 
int material
 
- Protected Attributes inherited from org.bukkit.event.block.BlockEvent
Block block
 

Detailed Description

Called when we try to place a block, to see if we can build it here or not.

Note:

  • The Block returned by getBlock() is the block we are trying to place on, not the block we are trying to place.
  • If you want to figure out what is being placed, use getMaterial() or getMaterialId() instead.

Definition at line 16 of file BlockCanBuildEvent.java.

Constructor & Destructor Documentation

org.bukkit.event.block.BlockCanBuildEvent.BlockCanBuildEvent ( final Block  block,
final int  id,
final boolean  canBuild 
)

Member Function Documentation

static HandlerList org.bukkit.event.block.BlockCanBuildEvent.getHandlerList ( )
static

Definition at line 69 of file BlockCanBuildEvent.java.

HandlerList org.bukkit.event.block.BlockCanBuildEvent.getHandlers ( )
virtual

Implements org.bukkit.event.Event.

Definition at line 65 of file BlockCanBuildEvent.java.

Material org.bukkit.event.block.BlockCanBuildEvent.getMaterial ( )

Gets the Material that we are trying to place.

Returns
The Material that we are trying to place

Definition at line 51 of file BlockCanBuildEvent.java.

References org.bukkit.Material.getMaterial(), and org.bukkit.event.block.BlockCanBuildEvent.material.

int org.bukkit.event.block.BlockCanBuildEvent.getMaterialId ( )

Gets the Material ID for the Material that we are trying to place.

Returns
The Material ID for the Material that we are trying to place

Definition at line 60 of file BlockCanBuildEvent.java.

References org.bukkit.event.block.BlockCanBuildEvent.material.

boolean org.bukkit.event.block.BlockCanBuildEvent.isBuildable ( )

Gets whether or not the block can be built here.

By default, returns Minecraft's answer on whether the block can be built here or not.

Returns
boolean whether or not the block can be built

Definition at line 33 of file BlockCanBuildEvent.java.

References org.bukkit.event.block.BlockCanBuildEvent.buildable.

void org.bukkit.event.block.BlockCanBuildEvent.setBuildable ( boolean  cancel)

Sets whether the block can be built here or not.

Parameters
canceltrue if you want to allow the block to be built here despite Minecraft's default behaviour

Definition at line 42 of file BlockCanBuildEvent.java.

References org.bukkit.event.block.BlockCanBuildEvent.buildable.

Member Data Documentation


The documentation for this class was generated from the following file: