[REQ] Ore/Block Respawn [FORMATTED]

Discussion in 'Archived: Plugin Requests' started by ಠ_ಠ, Feb 14, 2012.

  1. Offline


    Plugin category: Misc​

    Suggested name: BlockSpawn​

    A bit about me: A normal user, looking for a plugin that will complete my requests for my server. It seems simple enough, and shouldn't take much time.​

    What I want: I want a plugin that allows me to set certain respawn times for certain blocks within a defined region. (Eg: iron ore respawns every 500 seconds. Stone respawns every 30 seconds) And can be changed in a config file or by command. Possibly used with WorldEdit regions? ​

    Ideas for commands: /bscreate (W.Eregion) (name of block) (time to respawn)​
    /bsremove (W.Eregion) (name of block)​
    W.E = World Edit​

    Ideas for permissions: Whatever you feel like making. Should have some permissions at least. Maybe:​
    ??? idk.​

    Willing to pay up to: Unfortunately I have no money :\ I'm only 16 and I have no job.​

    When I'd like it by: Whenever you feel fit to do so. :]​

    Similar plugin requests: Plugins like this do exist, but they never get updated and I have asked the writers with no response.​

    Devs who might be interested in this: Idk :\​

    EDIT: Updating this would be fine too :] https://github.com/Vynlar/BlockRespawn
  2. Offline


    Doing this by each individual block could cause a LOT of server load... However, to make the region reset any given block type on a set interval (eg. every iron ore in the region resets every 500 seconds, and every gold ore in the region resets every 1000 seconds), would be quite easy. I don't have the time to make this right now, but if any dev's want a point in the right direction for a very fast/efficient way to do this, hit me up and I'll explain.

    Edit: I also suggest you do a check if players are in the area before the "reset"... otherwise you'll end up trapping/possibly suffocating players :p.
  3. Offline


    Thanks, I didnt think about trapping them... My region i have is a simple layout of a quarry kind of thing. Ore's will respawn at different rates, and since it's only one block deep, players would have been pushed out of the block. Thanks for the input though :D
  4. surely this could be done with logblock? maybe just by making a plugin that runs a command every so often? i dunno but i may look into it if i have time.
  5. Offline


    If either of you could make something like this, I would be SO HAPPY... I would actually cry with joy as it is the last and final plugin I need. And I've been looking for over 3 months D:
  6. Maybe... Got gcse revision atm. Will see what i can do.
    ಠ_ಠ likes this.
  7. Offline


    Study first, your grades are much more important :p I dont mind waiting :]
  8. Well if logblock has an API someone could use that to get the location of the selected ores, and then respawn them at the configurable time.

    If it doesn't, then one could create their own compact log with binary file.
  9. Performance wouldn't be too bad - you just need to track BLOCK_BREAK events and save the last 5 minutes worth of blocks broken. After 5 minutes (600 seconds) have passed you respawn the block (if not overridden by another block) and remove it from your list of blocks (obviously saving the list to file is important too, in case of server restarts/crashes.
  10. Offline


    I was hoping more like 3 hours :p because I was going to set Diamond to respawn in my quarry every 3 hours :p hahaha
  11. Well, your example showed 500 seconds and 30 seconds :p 3 hours block break logging shouldn't be too bad either, unless I'm missing something. There are already plugins that log these events in a flatfile (ie. not a mysql database) and someone would just need to use a similar concept and add the respawning feature to it.
  12. Offline


    I just didnt want to calculate it all again :p hahaha and I hope someone is willing to do it. I'd love them forever.
  13. Offline


    My reference to performance was based on an individual reset time per block, which is what (at least to me) it seemed the OP was asking for. This is unnecessary overhead, easily doable, yes... but do this much over head for a few plugins, and it'll add up quickly.

    The concept is incredibly easy:

    2. HashMap<Vector, Integer> saveBlockId = new HashMap<Vector, Integer>();
    3. HashMap<Vector, Byte> saveBlockData = new HashMap<Vector, Byte>();
    4. Vector v = new Vector(e.getBlock().getLocation().getBlockX(), e.getBlock().getLocation().getBlockY(), e.getBlock().getLocation().getBlockZ());
    5. if(!saveBlockId.containsKey(v)) {
    6. saveBlockId.put(v, e.getBlock().getTypeId());
    7. saveBlockData.put(v, e.getBlock().getData());
    8. }

    Then to restore:
    2. for(Vector v : saveBlockId.keySet()) {
    3. world.getBlockAt(v.toLocation(world)).setTypeId(saveBlockId.get(v));
    4. world.getBlockAt(v.toLocation(world)).setData(saveBlockData.get(v));
    5. }
    6. saveBlockId.clear();
    7. saveBlockData.clear();

    For larger regions, you can take this one step further and put the restore function into an asynch repeat, changing a set number of blocks per tick until complete.
  14. One way to reduce the overhead might be to only allow multiples of a set time so that you still run just one repeating function.
  15. Offline


    How about we change it from per block, to block type? would that make it any easier? :] that would work for me too.
  16. What romobomo is implying (I think) is that if you want it to be exactly 500 seconds from when the block was broken then you have to track a lot of different times (imagine someone breaking blocks every 5 seconds - it's more of a performance issue if you want them all to respawn exactly 500 seconds are they were broken). Better to have a single repeating task that checks if a minimum of 500 seconds has passed for a block and respawns it then (which means worst case scenario is 999 seconds until respawn).
  17. Offline


    Hit the nail on the head, thats exactly what I was referring to. Run a single asynch thread, and do your checks within (compare destoy time to run time, or system time if need be). I mean... could you immagine... a thread for EACH block destroyed? *shudders*
  18. Offline


    Well, there was a plugin that was called blockrespawn or something... but it never updates. This plugin was not region defined, but block defined. You'd select ONE block, give it a name, and set a time. so like "/Br diamond1 50000" and it would have that diamond block (diamond1) respond every 50000 seconds. That could be made too, if anyone so wishes.

    EDIT: I'm basically looking for something like THIS that is up to date. :]
  19. Offline


    If anyone wants to update it, here's the source: https://github.com/Vynlar/BlockRespawn (idk if that helps though)

    Anyone.....? Please?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 24, 2016
  20. Offline


    Bump for interest.
  21. Offline


    I took a quick look at that source, and as I expected, it creates a new thread for each block... this may be ok for (very) small scale, bit for anything else, I would strongly advise against it.
  22. Offline


    I'm only using it for around 20 blocks. Is that small enough? or should I find something else? D:
  23. Offline


    I think I actually made the plugin you're looking for, let me know if you still want this
  24. Offline


    I'm looking for a minerespawn plugin, argh.
  25. There's also this. I'm not sure about the policy of reviving dead plugins. I doubt it will work with 1.1-R5
  26. Offline


    Thanks man, works fine for R4.
  27. Re-Written Im 99% sure you can revive it XD But just add his name in there some where on the thread. md_5
    He has been inactive for longer then 2 months. . . :/ Md what do you say?
  28. Send him a pm and check the license.
  29. Offline


    ಠ_ಠ likes this.
  30. Offline


Share This Page