Follow along with the video below to see how to install our site as a web app on your home screen.
Примечание: This feature may not be available in some browsers.
public boolean onBlockDestroyed(ItemStack iStack, World world, int x, int y, int z, EntityLivingBase entity) {
if(!world.isRemote){
for(int i = x - 1; i < x++; i++){
for(int j = y - 1; j < y++; j++){
for(int k = z - 1; k < z++; k++){
if(!(world.getBlock(i, j, k) == Blocks.bedrock)){
world.func_147480_a(i, j, k, true);
}
}
}
}
}
iStack.damageItem(1, entity);
return true;
}
@Override
public boolean onBlockDestroyed(ItemStack is, World world, Block block, int x, int y, int z, EntityLivingBase entity) {
if (!world.isRemote){
for (int i = x - 1; i <= x + 1; i++) {
for (int j = y - 1; j <= y + 1; j++) {
for (int k = z - 1; k <= z + 1; k++) {
if (world.getBlock(i, j, k).getBlockHardness(world, i, j, k) != -1F) {
world.func_147480_a(i, j, k, true);
}
}
}
}
}
is.damageItem(1, entity);
return true;
}