[REQ][Formatted] Protect only pre-existing blocks

Discussion in 'Archived: Plugin Requests' started by Vaego, Jul 8, 2012.

  1. Offline

    Vaego

    Plugin category: Region Protection

    Suggested name: Pre-Existing Block Protection

    What I want:
    I am looking for a way to protect certain sets of blocks (possibly a region), while still allowing users to build on top of those blocks. I'd like to be able to set up an area, then apply protection to it so that non-air blocks cannot be edited, but air space (and hopefully water blocks as well) and blocks placed by users after protection was applied can still be edited. I am hoping to use this for, among other things, an area like a playground/obstacle course and a warmap (the way I understand it, the unbreakable option in the warmap setup does not allow blocks to be placed or broken.)

    I have yet to find any plugin that is dedicated to this function, or any way to do it with a general region protection plugin like WorldGuard. This leads me to believe it is a hard thing to do, because I would think many other people would enjoy having this functionality as well. If it is hard, or impossible, I understand. But if it is doable, I would really appreciate it.

    Ideas for commands:
    Something along the lines of:
    /pbp protect <regionName>- save the state and start protection of the selected area, giving it the name regionName. This would need some way to select the area in the first place.
    /pbp release <regionName> - stop protecting given region.
    /pbp override - allows user to bypass the protection (not really all that important)

    Ideas for permissions:
    pbp.protector - gives ability to protect regions
    pbp.override - gives access to the override command

    When I'd like it by:
    Its not a huge rush, but sooner is always better.

    Alternative Idea:
    From the responses so far I've gathered that solving this problem could be hard on the server. So I've done some thinking and decided on another option that may also work in the event that no one comes up with a magical way to implement the original idea.

    Is there a way to protect only blocks of certain types in a region, and allow blocks of other types to be built and destroyed in that region? This seems to me like it would eliminate the problem of having to keep track of each and every block in the region, instead making the server check each placed and broken block against a list of block id's or something like that. I am, however, not experienced enough to know if this could actually be done.

    This isn't an ideal solution, but I think it would still allow me to accomplish the goals I set out with.
     
  2. Offline

    chrisman0091

    Not sure if this does exist, I doubt it does, and it is a good idea! I would do it if I could code(I am currently learning Java), but you will get lots better results if you format this with the template on the stickied thread 'READ THIS FIRST' :)
     
  3. Offline

    PhoenixFlight

    It isn't hard so much as that it would eat a ton of memory. There are two ways I can think of to do it:

    1: Save a collection of EVERY block that exists when the plugin is first activated, and query that list every time someone tries to break a block. You'd also have to write it to a file to maintain persistence.
    2: Save a collection of EVERY block that's placed by players, and query that every time a player tries to break a block. Again, you'd have to use a file to maintain persistence. This approach would be better at first, but on a huge server with tons of things being built, it would start to lag. A lot.
     
  4. Offline

    Vaego

    Thanks for the interest and the tip. Post formatted.

    I'm sorry to hear that. I was afraid I'd get an answer along those lines. I thought up an alternative though, which based on what you posted I think should be easier on the server. I updated the first post with the details.

    Thanks both of you for your help.
     
  5. Offline

    Vaego

    So I figured I'd bump this one more time to get a bit more exposure. If anyone can turn either of these ideas into code, or knows of any plugins that would allow me to accomplish this, please let me know. Or, if anyone thinks I should make a new thread for my alternative idea, I'll do that too. Thanks for all the views.
     

Share This Page