Note that there are some explanatory texts on larger screens.

plurals
  1. POCompacting this code?
    primarykey
    data
    text
    <p>Is it possible to compact these two loops somehow?, ive had to double them because the second loop deals with the blocks that were ignored by the first loop</p> <pre><code> int count = 1; for(int y = 0; y &lt; cuboidClipboard.getHeight(); y++) for(int x = 0; x &lt; cuboidClipboard.getWidth(); x++) for(int z = 0; z &lt; cuboidClipboard.getLength(); z++) { BaseBlock baseBlock = cuboidClipboard.getPoint(new Vector(x, y, z)); Vector relativeVector = new Vector(x,y,z).add(orign); Block buildBlock = world.getBlockAt(relativeVector.getBlockX(), relativeVector.getBlockY(), relativeVector.getBlockZ()); if(Material.getMaterial(baseBlock.getId()).isSolid()) if(buildBlock.getTypeId() != baseBlock.getId()) { new PopBlockTask(buildBlock, world, baseBlock).runTaskLater(this, 20+(count*2)); count++; } } //we need to place non solid blocks last because they don't attach properly when theres no blocks around them for(int y = 0; y &lt; cuboidClipboard.getHeight(); y++) for(int x = 0; x &lt; cuboidClipboard.getWidth(); x++) for(int z = 0; z &lt; cuboidClipboard.getLength(); z++) { BaseBlock baseBlock = cuboidClipboard.getPoint(new Vector(x, y, z)); Vector relativeVector = new Vector(x,y,z).add(orign); Block buildBlock = world.getBlockAt(relativeVector.getBlockX(), relativeVector.getBlockY(), relativeVector.getBlockZ()); if(!Material.getMaterial(baseBlock.getId()).isSolid()) if(buildBlock.getTypeId() != baseBlock.getId()) { new PopBlockTask(buildBlock, world, baseBlock).runTaskLater(this, 20+(count*2)); count++; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload