leonardosc

Untitled

Dec 15th, 2015
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.64 KB | None | 0 0
  1. final Location l1 = player.getLocation().clone().add(10, 0, 10);
  2. final Location l2 = player.getLocation().clone().add(-10, 0, -10);
  3.            
  4. final double percentage = 70;
  5.            
  6. for ( int x = Math.min( l1.getBlockX(), l2.getBlockX() );
  7.         x < Math.max( l1.getBlockX(), l2.getBlockX() ); x++ )
  8. {
  9.     for ( int z = Math.min(l1.getBlockZ(), l2.getBlockZ());
  10.             z < Math.max( l1.getBlockZ(), l2.getBlockZ() ); z++ )
  11.     {
  12.         Material material;
  13.                    
  14.         if ( percentage > (Math.random() * 100) )
  15.         {
  16.             material = Material.GLASS;
  17.         }
  18.         else
  19.         {
  20.             material = Material.AIR;
  21.         }
  22.        
  23.         l1.getWorld().getBlockAt( x, l1.getBlockY(), z ).setType( material );
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment