Coloque isso para checar antes de TUDO.
if(e.getCurrentItem() != null){ if(e.getCurrentItem().getType() != Material.AIR){ if(e.getCurrentItem().hasItemMeta()){ //Cheque ;D
for(Block c : cubo) {
int r = new Random().nextInt(1);
If(r < 1){
c.setTypeId(1);
} else {
c.setTypeId(2);
}
}
Deve ser algo assim, pois fiz pelo celular.