Solved How to get blocks in a schematic

Discussion in 'Plugin Development' started by Creeoer, Dec 3, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    Creeoer

    How would I get a collection of blocks from a worldedit schematic? I need this because I want to loop through them and get their locations to check if they are in a protected region or not.
     
  2. Offline

    mythbusterma

    Creeoer

    How would a schematic be in a protected region? It's not even part of the world.
     
  3. Offline

    ResultStatic

    Creeoer schematics dont save locations their block location is relative to the pasting point.
     
  4. Offline

    Creeoer

    mythbusterma
    A possible scenairo is that if someone were to place down a schematic and wanted to be a troll and have half of it in spawn. A simple player.getLocation can't determine where the other half of the buildling is going. So I wanted to get the blocks of the schematic and get the locations of those blocks, to see if any of them may be sticking inside one of those regions. A schematic, as far as I'm concerned, is saving a piece of land and being able to paste it back into the world.
     
  5. Offline

    mythbusterma

    Creeoer

    Perhaps you'd be better off getting the size of the schematic, and why are you giving anyone other than operators the power to place schematics? That sounds like a nightmare.

    One of the tags in the schematic is the size of the schematic in each dimension, so you'd be better off examining that value.
     
  6. Offline

    Creeoer

    mythbusterma
    I could get the height , length and width. If I were to add and subtract all these values from the player loc in every way possible and check if any of those locations contain a region would that work? So let's say the thing is 10 blocks long, take the player's x value and subtract it by that and add it like that, likewise with other two values in every way possible to get all of the possible scenarios.
     
  7. Offline

    mythbusterma

  8. Offline

    Creeoer

  9. Offline

    mythbusterma

    Creeoer

    You'd have to do both, if you don't know the pasting orientation.
     
    Creeoer likes this.
Thread Status:
Not open for further replies.

Share This Page