Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
org.bukkit.event.block.BlockCanBuildEvent Class Reference
Inheritance diagram for org.bukkit.event.block.BlockCanBuildEvent:
org.bukkit.event.block.BlockEvent org.bukkit.event.Event

Public Member Functions

 BlockCanBuildEvent (final Block block, final int id, final boolean canBuild)
 
boolean isBuildable ()
 
void setBuildable (boolean cancel)
 
Material getMaterial ()
 
int getMaterialId ()
 
HandlerList getHandlers ()
 
- Public Member Functions inherited from org.bukkit.event.block.BlockEvent
 BlockEvent (final Block theBlock)
 
final Block getBlock ()
 
- Public Member Functions inherited from org.bukkit.event.Event
 Event ()
 
 Event (boolean isAsync)
 
String getEventName ()
 
abstract HandlerList getHandlers ()
 
final boolean isAsynchronous ()
 

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 18 of file BlockCanBuildEvent.java.

Constructor & Destructor Documentation

org.bukkit.event.block.BlockCanBuildEvent.BlockCanBuildEvent ( final Block  block,
final int  id,
final boolean  canBuild 
)
Deprecated:
Magic value

Definition at line 34 of file BlockCanBuildEvent.java.

34  {
35  super(block);
36  buildable = canBuild;
37  material = id;
38  }

Member Function Documentation

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 67 of file BlockCanBuildEvent.java.

References org.bukkit.Material.getMaterial().

67  {
68  return Material.getMaterial(material);
69  }
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
Deprecated:
Magic value

Definition at line 78 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 48 of file BlockCanBuildEvent.java.

48  {
49  return buildable;
50  }
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 58 of file BlockCanBuildEvent.java.

58  {
59  this.buildable = cancel;
60  }

Member Data Documentation

int org.bukkit.event.block.BlockCanBuildEvent.material
protected

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