public class BlockCanBuildEvent extends BlockEvent
注意:
getMaterial()
或者 getMaterialId()
来代替.
Event.Result
限定符和类型 | 字段和说明 |
---|---|
protected boolean |
buildable |
protected int |
material
已过时。
不安全的参数
|
block
构造器和说明 |
---|
BlockCanBuildEvent(Block block,
int id,
boolean canBuild)
已过时。
不安全的参数
|
限定符和类型 | 方法和说明 |
---|---|
static HandlerList |
getHandlerList() |
HandlerList |
getHandlers() |
Material |
getMaterial()
获取我们试图放置的方块的 Material.
|
int |
getMaterialId()
已过时。
不安全的参数
|
boolean |
isBuildable()
获取是否可以在此建造此方块
默认情况下, 是否可以在此建造返回的是 Minecraft的值。
|
void |
setBuildable(boolean cancel)
设置此方块是否可以在此建造。
|
getBlock
getEventName, isAsynchronous
protected boolean buildable
@Deprecated protected int material
@Deprecated public BlockCanBuildEvent(Block block, int id, boolean canBuild)
block
- 这个事件涉及的方块id
- 这个要放置的方块的IDcanBuild
- 是否可以建造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()
@Deprecated public int getMaterialId()
原文:Gets the Material ID for the Material that we are trying to place.
public HandlerList getHandlers()
getHandlers
在类中 Event
public static HandlerList getHandlerList()