WorldEdit Schematic Code Question

Discussion in 'Programming Help' started by TekkitCommando, Jan 4, 2016.

  1. TekkitCommando

    TekkitCommando New Member

    Ok so I am working on a plugin and one of the features is auto build and the current system is quite buggy rn the plugin is using a custom system for auto building but I was thinking it would be a lot better to use WorldEdit Schematic loading for the auto build. The problem is there is an option for timed building but WorldEdit schematics load in instantly. So I had 2 ideas but I am not sure if they are possible or the best way to go about doing one of these things.

    First Idea:
    My first idea involved getting the number of blocks in the schematic and taking the number of blocks in the schematic and multiplying it by the seconds specified in the config. Then just adding a simple wait time before the build spawns in instantly there. I was wondering if it was possible to get the number of blocks in a schematic and if so, how??

    Second Idea:
    My second idea involved just coding the plugin to building the schematic by a block per however many seconds specified in the config. I am not sure if this is possible but if it is, how would I do this?

    My first idea seems more likely to be possible and am totally willing to do that and I appreciate any feedback that comes in. I thought that if one or both of these were possible @sk89q 's forum would be the place to find out.
  2. wizjany

    wizjany Administrator Developer

    this is not a trivial task, you can't just "wait" between blocks, because that would pause the entire server and no one could do anything.
    there are already third party plugins that handle this sort of thing through the task scheduler, and you're probably best off looking into those. although it's planned for worldedit, it's not likely to come anytime soon.
  3. TekkitCommando

    TekkitCommando New Member

    Ok i wasn't sure how schematics worked, thank you i now know i cant wait between blocks, so my first idea would be better obviously and I will try to find one of these plugins using the task scheduler. Thank you for your reply.