Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Block active = block;
- if(block.getType() == Material.CACTUS || block.getType() == Material.SUGAR_CANE_BLOCK){
- moreBlocks = true;
- List<Location> breakBlocks = new ArrayList<Location>();
- do{
- Block above = active.getRelative(BlockFace.UP);
- if(above.getType() == Material.CACTUS || block.getType() == Material.SUGAR_CANE_BLOCK){
- breakBlocks.add(above.getLocation());
- }else{
- moreBlocks = false;
- }
- active = above;
- }while (moreBlocks);
- for(int i = breakBlocks.size() - 1; i > -1; i--){
- // My own logic, works fine
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment