WorldGuard

WorldGuard

8M Downloads

Custom flag support for regions

LadyCailinBot opened this issue ยท 11 comments

commented

WORLDGUARD-2240 - Reported by sk89q

Add support for setting custom flags (such as from other plugins).

commented

Comment by TGS

Can't wait for this! :)

commented

Comment by Darkangel

u can do this with the worldguard api

commented

Comment by TGS

AFAIK it does not support custom flags yet?

commented

Comment by sk89q

It's possible with some hackery, but it's not supported... and it's hackery.

commented

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.

commented

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.

commented

Comment by TGS

Ah yeah didn't see that haha! And what data are we taking about? Regions.yml?

commented

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.

commented

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.

commented

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.

commented

Comment by TGS

Yeah that'll be unfortunate, but like you say, it should be overcomable, ex spigot had the same problems with the spigot.yml