org.bukkit.event.block
Class BlockCanBuildEvent

java.lang.Object
  extended by org.bukkit.event.Event
      extended by org.bukkit.event.block.BlockEvent
          extended by org.bukkit.event.block.BlockCanBuildEvent

public class BlockCanBuildEvent
extends BlockEvent

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

Note:


Nested Class Summary
 
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result
 
Field Summary
protected  boolean buildable
           
protected  int material
          Deprecated. Magic value
 
Fields inherited from class org.bukkit.event.block.BlockEvent
block
 
Constructor Summary
BlockCanBuildEvent(Block block, int id, boolean canBuild)
          Deprecated. Magic value
 
Method Summary
static HandlerList getHandlerList()
           
 HandlerList getHandlers()
           
 Material getMaterial()
          Gets the Material that we are trying to place.
 int getMaterialId()
          Deprecated. Magic value
 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.
 
Methods inherited from class org.bukkit.event.block.BlockEvent
getBlock
 
Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

buildable

protected boolean buildable

material

@Deprecated
protected int material
Deprecated. Magic value
Constructor Detail

BlockCanBuildEvent

@Deprecated
public BlockCanBuildEvent(Block block,
                                     int id,
                                     boolean canBuild)
Deprecated. Magic value

Method Detail

isBuildable

public boolean 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

setBuildable

public void setBuildable(boolean cancel)
Sets whether the block can be built here or not.

Parameters:
cancel - true if you want to allow the block to be built here despite Minecraft's default behaviour

getMaterial

public Material getMaterial()
Gets the Material that we are trying to place.

Returns:
The Material that we are trying to place

getMaterialId

@Deprecated
public int getMaterialId()
Deprecated. Magic value

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

getHandlers

public HandlerList getHandlers()
Specified by:
getHandlers in class Event

getHandlerList

public static HandlerList getHandlerList()


Copyright © 2014. All rights reserved.