Custom flag support for regions
LadyCailinBot opened this issue ยท 11 comments
WORLDGUARD-2240 - Reported by sk89q
Add support for setting custom flags (such as from other plugins).
Comment by sk89q
It's possible with some hackery, but it's not supported... and it's hackery.
Comment by TGS
Alright, but I think the point of this ticket was to get it officially supported :) also, an alternative is to implement the custom flags out there into worlguard, they're super useful and popular.
Comment by sk89q
Well, no doubt. I did make the ticket :P
The main hairy problem is that if the plugin registering the flag is suddenly no longer installed, the data is completely lost.
Comment by TGS
Ah yeah didn't see that haha! And what data are we taking about? Regions.yml?
Comment by sk89q
When the code loads region data, it grabs all the flags as "name" -> unknown data.
Then it looks through the flags it does know about. The PVP flag would claim "pvp" and convert "unknown data" to a true/false. However, if no flag "claims" one of the loaded entries, it is simply not retained.
It's an overcome-able problem, but I have simply not gotten around to it.
Comment by TGS
So what you're saying is, if the plugin is removed, the custom flag will disappear? Because I don't see that as a huge issue, it makes okay sense to remove it.
Comment by sk89q
Well, let's say the player accidentally breaks a plugin... now all of the plugin's flags are gone forever from the region files.