Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- final Location l1 = player.getLocation().clone().add(10, 0, 10);
- final Location l2 = player.getLocation().clone().add(-10, 0, -10);
- final double percentage = 70;
- for ( int x = Math.min( l1.getBlockX(), l2.getBlockX() );
- x < Math.max( l1.getBlockX(), l2.getBlockX() ); x++ )
- {
- for ( int z = Math.min(l1.getBlockZ(), l2.getBlockZ());
- z < Math.max( l1.getBlockZ(), l2.getBlockZ() ); z++ )
- {
- Material material;
- if ( percentage > (Math.random() * 100) )
- {
- material = Material.GLASS;
- }
- else
- {
- material = Material.AIR;
- }
- l1.getWorld().getBlockAt( x, l1.getBlockY(), z ).setType( material );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment