Java Code Examples for

The following examples show how to use . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
public void neighborUpdate(BlockState state, World world, BlockPos pos, Block block, BlockPos pos_2, boolean boolean_1) {
    super.neighborUpdate(state, world, pos, block, pos_2, boolean_1);
    if (!canPlaceAt(state, world, pos)) {
        world.breakBlock(pos, false);
Example 2
void onPartDestroyed(World world, BlockState partState, BlockPos partPos, BlockState baseState, BlockPos basePos, boolean dropBase) {
    dropInventory(world, basePos);
    world.breakBlock(basePos, dropBase);

    for (BlockPos otherPart : getOtherParts(baseState, basePos)) {
        if (!world.getBlockState(otherPart).isAir()) {
            world.setBlockState(otherPart, Blocks.AIR.getDefaultState(), 3);