Java Code Examples for net.minecraft.world.World#breakBlock()
The following examples show how to use
net.minecraft.world.World#breakBlock() .
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
Source Project: Galacticraft-Rewoven File: CavernousVineBlock.java License: MIT License | 5 votes |
@Override 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
Source Project: Galacticraft-Rewoven File: BasicSolarPanelBlock.java License: MIT License | 5 votes |
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); } } }