Mine reset type thing (How does mine reset work?)

Discussion in 'Plugin Development' started by Ultracrepadarian, Oct 18, 2015.

Thread Status:
Not open for further replies.
  1. Hello! So I am currently developing a plugin but I need someone to explain to me how (prison server) mines work? I need to understand how I would reset a schematic? Would I make an array of all mines? And Would I load the schematic relative to a certain block?

    P.S I AM in fact working with the WorldEdit API
     
  2. Offline

    Scimiguy

  3. @Scimiguy
    The mines allow you to mine as much as you want, and after a specified amount of time, they reset.
     
  4. Offline

    Scimiguy

    @Ultracrepadarian
    Does the whole mine reset at once, or is it gradually over time?
     
  5. Offline

    mcdorli

    At once, they're like big chunks of ores, only ores.
    @Ultracrepadarian You could store the informations about the mines in the config file

    Mine1:
    Ores:
    Coal: 0
    diamond:25
    Iron: 50
    Gold: 25
    Location:
    ...

    The numbers behind the ore names are the chance they spawn.
     
  6. @mcdorli
    Yes, that would work. :) Thanks for the input :D The only thing is I'm not doing an actual mine, I just need to understand how mines work in order to reset a build :)
     
  7. Offline

    Scimiguy

    @Ultracrepadarian

    The thing is, there's a number of different ways to do it...

    You could just reset the area to a schematic.

    The way I'd do it personally is keep a HashMap of Locations and Types, and when the first block is mined, set a runTaskLater for like 10 minutes or so.

    When the 10 minutes is up, loop through the locations and set them to the types.
    This would be far, far more efficient than looping over a whole schematic, since you'd only touch the specific locations mined.
     
  8. Offline

    mcdorli

    Then just save the blocks into a list, save the list ib the config, and done
     
  9. @mcdorli
    But I would like to save it and load it as a schematic, maybe relative to a corner of the schematic area?
     
  10. Offline

    mcdorli

    I assume you use the worldedit selection, and you want to save the area inside the selection. In this case, just go trough all the blocks in a specific way, save the block materials in a list, and if you want to load it, then just go trough it again in tge same way.
     
  11. Alright then, Ill give it a shot.

    EDIT: Hey @mcdorli would you mind giving me an example of looping through the blocks? Im afraid I dont know where to start xP
     
    Last edited: Oct 19, 2015
  12. Offline

    Scimiguy

    @Ultracrepadarian
    Sigh.. I'm so tired of being in this mod queue thing.. people having whole conversations before my post even gets approved

    Take a look at my suggestion in my last post when you get a sec Ultra, Might be a better option
     
    Ultracrepadarian likes this.
Thread Status:
Not open for further replies.

Share This Page