Edit: Moved these posts, as this deserves its own topic:
I agree with that.
But where I see problems is “which player owns which block”. There isn’t a “region api”. I think some plugins need this for checking if an action is valid/can be performed by the plugin in this location. Therefore the developers had to support the different plugins(worldguard, foxguard, redprotect etc…)
Yeah, the Economy API was implemented to “abstract” all of the actions you need into an interface, and the plugin implements it; as long as you don’t rely specifically on a plugin’s API, and instead use the general Sponge-supplied EconomyAPI, you should be all good to go
@Randombyte, I do agree! That would be cool, but technically it could be created by a user, and then each of the “guards” could supply their service to the Sponge service manager… though it would be nice to be “official”
What if a player wants to apply special behavior to a block with a plugin and the block wasn’t placed by the current “region owner”? A player tries to execute /registerBlock on a block that he didn’t place but now is in his region. How could the plugin now know that he owns the block? The plugin only knows who/what placed the block, not its “owner”.
Uhm, usually you grant users the right to modify blocks in “their” region. Most protection plugins don’t check if you’re the owner or the one who modified it last, but if you’re in a region where you have a permission (or not). So causes and ownership aren’t an actual problem when it comes to protection.
So in your case the protection plugin would check two things:
a) does the user have the permission to execute the command /registerBlock?
b) does the user have the permission to modify blocks (aka is he in “his” region)?
a) Yes, I understand
b) Are the permissions relative to the current location of the player? So the permission e.g. blocks.break is granted for the player when he stands in his region but not when he moves outside?
In the end that could simply be tested by simulating a block break by the player. If the block is gone, he has permission there.
When using Foxguard you can create regions and grant or deny permissions depending on the position of the player
We actually use this on the Sponge Community Server to protect different buildings but still allow free building in the rest of the world.
You’d need a plugin which has a region set up eg: X1 Y1 Z1 to X2 Y2 Z2. Now you’d check if the current coords the player is at are in the range of the region. If yes, you grant/deny all perms based on the region if the player does something.
Note that i haven’t done this yet, i’m mostly a user, not a plugin author
I know I am not stupid. I suggested to move posts here because I wanted to receive notifications and emails that really apply to me. Especially from my own topics. @Tzk thanks for moving it. That was really appreciated.
I think there definitely should be an API of this sort, but not necessarily a region one. I think we need more of an ‘owner’ api, in which we can assign owners (not in the cause-tracking sense) to entities or blocks.
This is doable with the data api, except that Locations currently don’t necessarily retain data.
Either the existing “api” should be extended so there can be more than one owner or there should be a seperate api that handles them. I vote for foxguard like region shapes and not per block data. @Ryahn can you name some examples?