turt2live

Untitled

Feb 21st, 2013
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.61 KB | None | 0 0
  1. Block active = block;
  2. if(block.getType() == Material.CACTUS || block.getType() == Material.SUGAR_CANE_BLOCK){
  3.     moreBlocks = true;
  4.     List<Location> breakBlocks = new ArrayList<Location>();
  5.     do{
  6.         Block above = active.getRelative(BlockFace.UP);
  7.         if(above.getType() == Material.CACTUS || block.getType() == Material.SUGAR_CANE_BLOCK){
  8.             breakBlocks.add(above.getLocation());
  9.         }else{
  10.             moreBlocks = false;
  11.         }
  12.         active = above;
  13.     }while (moreBlocks);
  14.     for(int i = breakBlocks.size() - 1; i > -1; i--){
  15.         // My own logic, works fine
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment