public class BlockCanBuildEvent extends BlockEvent
注意:
getMaterial() 来代替.
Event.Result| 限定符和类型 | 字段和说明 |
|---|---|
protected BlockData |
blockData |
protected boolean |
buildable |
block| 构造器和说明 |
|---|
BlockCanBuildEvent(Block block,
BlockData type,
boolean canBuild)
已过时。
|
BlockCanBuildEvent(Block block,
Player player,
BlockData type,
boolean canBuild)
已过时。
不安全的参数
|
| 限定符和类型 | 方法和说明 |
|---|---|
BlockData |
getBlockData()
获取我们想要放置的方块的BlockData数据.
|
static HandlerList |
getHandlerList() |
HandlerList |
getHandlers() |
Material |
getMaterial()
获取我们试图放置的方块的 Material.
|
Player |
getPlayer()
Gets the player who placed the block involved in this event.
|
boolean |
isBuildable()
获取是否可以在此建造此方块.
|
void |
setBuildable(boolean cancel)
设置此方块是否可以在此建造。
|
getBlockgetEventName, isAsynchronousprotected boolean buildable
protected BlockData blockData
@Deprecated public BlockCanBuildEvent(Block block, BlockData type, boolean canBuild)
public boolean isBuildable()
默认情况下, 是否可以在此建造返回的是 Minecraft的值.
原文: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.
public void setBuildable(boolean cancel)
原文:Sets whether the block can be built here or not.
cancel - 允许建造请输入true,反之为false。public Material getMaterial()
public BlockData getBlockData()
原文:Gets the BlockData that we are trying to place.
public Player getPlayer()
public HandlerList getHandlers()
getHandlers 在类中 Eventpublic static HandlerList getHandlerList()