本文整理汇总了Java中cn.nukkit.block.Block.isNormalBlock方法的典型用法代码示例。如果您正苦于以下问题:Java Block.isNormalBlock方法的具体用法?Java Block.isNormalBlock怎么用?Java Block.isNormalBlock使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cn.nukkit.block.Block
的用法示例。
在下文中一共展示了Block.isNormalBlock方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setDisplayBlock
import cn.nukkit.block.Block; //导入方法依赖的package包/类
/**
* Set the minecart display block!
*
* @param block The block that will changed. Set {@code null} for BlockAir
* @return {@code true} if the block is normal block
*/
@API(usage = Usage.MAINTAINED, definition = Definition.UNIVERSAL)
public boolean setDisplayBlock(Block block) {
if (block != null) {
if (block.isNormalBlock()) {
blockInside = block;
int display = blockInside.getId()
| blockInside.getDamage() << 16;
setDataProperty(new ByteEntityData(DATA_MINECART_HAS_DISPLAY, 1));
setDataProperty(new IntEntityData(DATA_MINECART_DISPLAY_BLOCK, display));
setDisplayBlockOffset(6);
}
} else {
// Set block to air (default).
blockInside = null;
setDataProperty(new ByteEntityData(DATA_MINECART_HAS_DISPLAY, 0));
setDataProperty(new IntEntityData(DATA_MINECART_DISPLAY_BLOCK, 0));
setDisplayBlockOffset(0);
}
return true;
}
示例2: setDisplayBlock
import cn.nukkit.block.Block; //导入方法依赖的package包/类
/**
* Set the minecart display block!
*
* @param block The block that will changed. Set {@code null} for BlockAir
* @return {@code true} if the block is normal block
*/
public boolean setDisplayBlock(Block block) {
if (block != null) {
if (block.isNormalBlock()) {
blockInside = block;
int display = blockInside.getId()
| blockInside.getDamage() << 16;
setDataProperty(new ByteEntityData(DATA_MINECART_HAS_DISPLAY, 1));
setDataProperty(new IntEntityData(DATA_MINECART_DISPLAY_BLOCK, display));
setDisplayBlockOffset(6);
}
} else {
// Set block to air (default).
blockInside = null;
setDataProperty(new ByteEntityData(DATA_MINECART_HAS_DISPLAY, 0));
setDataProperty(new IntEntityData(DATA_MINECART_DISPLAY_BLOCK, 0));
setDisplayBlockOffset(0);
}
return true;
}
示例3: updateComparatorOutputLevel
import cn.nukkit.block.Block; //导入方法依赖的package包/类
public void updateComparatorOutputLevel(Vector3 v) {
for (BlockFace face : Plane.HORIZONTAL) {
Vector3 pos = v.getSide(face);
if (this.isChunkLoaded((int) pos.x >> 4, (int) pos.z >> 4)) {
Block block1 = this.getBlock(pos);
if (BlockRedstoneDiode.isDiode(block1)) {
block1.onUpdate(BLOCK_UPDATE_REDSTONE);
} else if (block1.isNormalBlock()) {
pos = pos.getSide(face);
block1 = this.getBlock(pos);
if (BlockRedstoneDiode.isDiode(block1)) {
block1.onUpdate(BLOCK_UPDATE_REDSTONE);
}
}
}
}
}
示例4: getRedstonePower
import cn.nukkit.block.Block; //导入方法依赖的package包/类
public int getRedstonePower(Vector3 pos, BlockFace face) {
Block block = this.getBlock(pos);
return block.isNormalBlock() ? this.getStrongPower(pos) : block.getWeakPower(face);
}