Block regeneration/respawn plugin

Discussion in 'Archived: Plugin Requests' started by darkon12, Aug 22, 2014.

  1. Offline

    darkon12

    What I want: I'd love to have plugin that respawns brokens blocks after set time. Placed blocks should also disappear after set time. This would work world-wide, but is cancelled in secured regions (WorldGuard,PreciousStones).
    Suggested name: WorldRegen
    Example:
    - broken grass respawns after 3 secs,
    - stone respawns after 5 secs,
    - any block placed disapear after 10 secs,
    - you can build/destroy normally in secured regions by antygriefing plugins.

    Ideas for commands:
    /reg block <BlockId> <time delay untill block respawn>
    /reg air <time after blocks placed disapear>
    /reg world <wolrdName> enable/disable - worlds that plugin is enabled/disabled
    Ideas for permissions:
    sigle permission to allow using those commands

    When I'd like it by: Actually as soon as possible, but i'll wait for it.
    I actually know that this plugin in going to eat tons of server resources, but I wont use it on big serwer (30-40 slots probably).

    Is it even possible to make? I tried all plugins working like this, none of them have support for regions or timers for specified blocks, nor working with placed blocks.

    English is not my mother language, so please, forgive me my mistakes ^^
     
  2. Offline

    darkon12

    Bumb, so my dreams come true.
     
  3. Offline

    JordyPwner

    darkon12 i like the idea but why not only regen blocks if its destroyed? like you used tnt and it will regen? with some sounds ofcourse
     
  4. Offline

    darkon12


    Dont really get what you mean. Every single block should regenerate after specified time, no matter if its destroyed "by hand" or by explosion or whatever can destroy it. Placed blocks should disappear also after other specified time.

    EDIT. By every single block i mean every single NOT PROTECTED block of course.
     
  5. Offline

    JordyPwner

    darkon12 i would like to make this but i cant since im learning java :p
     
  6. Offline

    darkon12

    Then, i hope somebody else can do this ^^
     
  7. Offline

    aredherring

    Certainly right about that, this would require keeping a versioned history of every block that has been in the world so far. This means it would exponentially more consuming as you explored the world as Minecraft - by default - generates block in a 21 x 21 chunk radius of every player (16 x 16 x 255 per chunk). I think it might be possible if you were store every block change when a block is destroyed somehow in a low latency store.

    My initial thought is that you would group block destructions by chunk and have each chunk run an update every 5 minutes that would restore all blocks from that chunk. It would be a lot easier logistically than having the respawn timer be 5 minutes from an object graph's destruction simply because the object graph might be destroyed at different times. Furthermore, if you use TNT on Sand blocks and you only restore the Sand graph, that Sand is going to fall to the floor (if there is nothing beneath it) unless the thing beneath it was destroyed as well. It just makes a lot more sense to group block destruction by chunk, generate an object graph of the changes from that chunk, and restore that chunk based on a chunk-local 5 minute timer.

    I'm assuming that your requirements mean the every block in the affected region should be replaced after the respawn period. Would the respawn period be relative to the destroy time or to the server time? If relative to the destruction time that makes things a bit more interesting because then you need to group the block destruction together into a tree and save that, so that you can construct the blocks in the correct order on the way back.

    In addition, would you want the server to respawn blocks that had been destroyed after restarting the server? Or would blocks that have been destroyed be permanently lost after the server is restarted?

    Possible, yes, easy? No. Simply because you would need to create an object graph of the blocks that were destroyed and the order they were destroyed in so you can place them back where they were.
     
  8. Offline

    darkon12

    aredherring Thanks for your answer.

    Well, your idea ain't bad, but extending respawn time to 5 minutes is actually... It just makes my idea not work. It has to be not longer then 10-20 secs (20 secs is actually already too long for me).

    Also, couldnt it be done by some kind of event/condition? At block destroy it (plugin) tests what kind of block is dropped. If it is ie. cobble stone, it waits 5 secs and restore stone in place of destroyed block?

    I'm not programmer, but I thought about writing it in Skript somehow and that was the way it would work (if even possible).
    Sand is thing I need to think about, probably disabling it's gravity is good way out?
     
  9. Offline

    aredherring

    Sorry, I misread your question and saw 5 minutes instead of 5 seconds. This makes things a bit easier and a bit harder. It's easier in that there's obviously less damage than can be done in 5 seconds than in 5 minutes, so less memory required. But it also means you are doing potentially complex computations every 5 seconds - especially if the object graph is large.

    Yes, this is possible. However, many permissions plugins do this already?

    I'm not sure if there is the possibility to disable gravity. I'll have to find out for you. But I would say that that is a rather bad solution as disabling gravity would effect everything.
     
  10. Offline

    darkon12

    aredherring

    You thinks its possible to archive using some permission plugin? Give me an example and guide a bit and I'll configure it myself ^^
     
  11. Offline

    aredherring

    I'm fairly sure there are a few plugins (and I don't know the names of them) that can prevent you from destroying a block, if that's what you are trying to achieve with the respawn, through permissions. Why exactly do you want the block to be respawned? should no items drop from the respawned block? I need a thorough use case here :p
     
  12. Offline

    darkon12

    The whole idea is to create new kind of survival server.

    World will be pre-generated (worldBroder) and you will be able to destroy, get normally rescources, but you wont be able to build anything that lasts longer then few secs. It would be possible to place few blocks to easly get somewhere, but they will disapear after short time. Building would be possible only when you get secured region (probably PreciousStones). In this area, blocks won't disappear nor regenerate.

    I'll have to test and set proper block respawn time, so it would be possible to dig underground, but when u stop mining, you will probably suffocate, since blocks gonna regenerate.

    Ofc, blocks drop normally, just ores gonna be "smelted".

    And after some time I suspect, that it could be possible to place and destroy some blocks as soon as possible, so they no more will be those "placed" but will be those "destroyed" and will regenerate. Can bugging like this be stopped?

    I'm working to archive it by myself using Skript, but I'd still love to have this as plugin.

    Bumb

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 9, 2016

Share This Page