Protect existing blocks, but allow building. (Repost)

User avatar
Posts: 1061
Joined: Fri Aug 26, 2016 15:36
Location: Illinois, USA
GitHub: sorcerykid
In-game: Nemo

Protect existing blocks, but allow building. (Repost)

by sorcerykid » Mon May 13, 2019 16:09

This is a repost of a topic started by wziard that was lost after the forum reset.

wziard wrote:Is there any mod which supports this? I've looked through the forums, but couldn't find anything.

My guess would be that it should be possible (though expensive, server wise), by storing the protected status in the metadata of each block.

I'd very much like something like this, and I might try to create a mod like this myself, but that would be a waste of time of it already existed.

For example, on my server I built (together with some other kids) a village for our youngest members to 'live' in. The youngest ones still think the building to be tedious, but they love furnishing existing houses. One problem I encountered is that I now get inundated by requests to make repairs to the houses because one of the small kids ('accidentally') destroyed parts. I can't just protect the whole area, because that would make it impossible for them to build furniture/flowers etc. So I'd really like to protect the existing structures, but not disallow building new stuff.

I hacked the areas mod to allow building in a protected area, but that has the disadvantage that anything built is protected immediately, so you can't remove it anymore. my kids didn't like that either because they like to rearrange the furniture all the time :-)

Yes, I'll go ahead and send you a link to the source and assets later tonight. I can strip out the portions that are untested. But it should still work for your needs. Here's a quick rundown of the two types of protectors:

    Shared Protector
    Restricts building and mining within an 11m cubic area except by the owner or designated members. Digging and mining by members can be further restricted according to the bitmap mask of the area (see below). Shared Protectors can be useful for creating apartments and shared tree farms.

    Public Protector
    Restricts building and mining within an 11m cubic area according to the bitmap mask of the area (see below). Public Protectors can be useful for creating public tree farms and sandbox playgrounds.
The bitmap mask of shared protectors can be manually engaged or disengaged by right-clicking the protector and clicking "Lock Area" or "Unlock Area" respectively. Locking the area stores a "snapshot" of all non-air and non-liquid nodes as a bitmap into the metadata of the protector (compressed for space efficiency) . For public protectors, the bitmap mask is automatically engaged at all times.


I also resolved the long-range dig exploit, whereby hackers could dig nodes adjacent to unloaded mapblocks to evade protection. The server operator, of course, can bypass this restriction.

Tip: If there are overlapping protected areas owned by the same player, then the most restrictive bitmap mask is used to determine whether any given node is protected from mining or building.

Tip: When engaging a bitmap mask, only air and liquid nodes are unmasked and all other nodes are masked. To protect an open area (like a hallway), it should be filled temporarily beforehand.

wziard wrote:Did you get around to putting this somewhere? It looks like exactly what I planned on making myself.

Yes, my sincerest apologies. Some other priorities came up last week, so it completely slipped my mind to send you the URL. Here is the repository:

There are only two dependencies, both very lightweight:This version adds support for copying and pasting of bitmap masks as well. So if you are creating very large tree farms, public mines, etc. then you can construct a template of the region that you want to protect in a staging area, and then apply a snapshot of that region to any number of other protectors.

Also the shared protector has options to prevent unwanted griefing of public areas with undiggable nodes (locked chests or steel doors).


I might go ahead and make video demonstrating the various features. Hope it's helpful!

Return to General Discussion

Who is online

Users browsing this forum: rubenwardy and 2 guests