Advertisement
Exception_Prototype

Untitled

Jun 12th, 2018
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.70 KB | None | 0 0
  1. private static final Set<Integer> blocks = Sets.newHashSet(); //pre-prepared list of the blocks in their 'combined' version.
  2.  
  3. public void method(Player p, Region region) {
  4.  
  5.     World world = FaweAPI.getWorld(p.getWorld().getName());
  6.  
  7.     EditSession editSession = new EditSessionBuilder(world)
  8.             .fastmode(true)
  9.             .allowedRegionsEverywhere()
  10.             .limitUnlimited()
  11.             .build();
  12.  
  13.     for (Vector pt : new FastIterator(region, editSession)) { //found in the documentation.
  14.         BaseBlock block = editSession.getBlock(pt);
  15.         if (blocks.contains(block.getCombined())) {
  16.             block.setCombined(0);
  17.         }
  18.     }
  19.  
  20.     editSession.flushQueue();
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement