本文整理汇总了Java中cn.nukkit.block.Block.DIRT属性的典型用法代码示例。如果您正苦于以下问题:Java Block.DIRT属性的具体用法?Java Block.DIRT怎么用?Java Block.DIRT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类cn.nukkit.block.Block
的用法示例。
在下文中一共展示了Block.DIRT属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getHighestWorkableBlock
private int getHighestWorkableBlock(int x, int z) {
int y;
for (y = 127; y > 0; --y) {
int b = this.level.getBlockIdAt(x, y, z);
if (b == Block.DIRT || b == Block.GRASS) {
break;
} else if (b != Block.AIR && b != Block.SNOW_LAYER) {
return -1;
}
}
return ++y;
}
示例2: ensureDirtsUnderneath
/**
* returns whether or not there is dirt underneath the block where the tree will be grown.
* It also generates dirt around the block in a 2x2 square if there is dirt underneath the blockpos.
*/
private boolean ensureDirtsUnderneath(Vector3 pos, ChunkManager worldIn) {
Vector3 blockpos = pos.down();
int block = worldIn.getBlockIdAt((int) blockpos.x, (int) blockpos.y, (int) blockpos.z);
if ((block == Block.GRASS || block == Block.DIRT) && pos.getY() >= 2) {
this.setDirtAt(worldIn, blockpos);
this.setDirtAt(worldIn, blockpos.east());
this.setDirtAt(worldIn, blockpos.south());
this.setDirtAt(worldIn, blockpos.south().east());
return true;
} else {
return false;
}
}
示例3: getGroundBlock
@Override
public int getGroundBlock() {
return Block.DIRT;
}
示例4: getSurfaceBlock
@Override
public int getSurfaceBlock() {
return Block.DIRT;
}