elBukkit / PreciousStones

Self-service protection for Minecraft servers
http://dev.bukkit.org/server-mods/preciousstones/
10 stars 10 forks source link

Field radius can overlap with small WG regions #80

Open jamesol1 opened 3 years ago

jamesol1 commented 3 years ago

Is there a WG flag that can prevent protection blocks being placed in those defined regions?

xtomyserrax commented 3 years ago

Hey, the plugin already hooks with WG but you dont need a flag for that. What isnt working for you?

jamesol1 commented 3 years ago

Hey, the plugin already hooks with WG but you dont need a flag for that. What isnt working for you?

What WG flag (or if there's an option through PS) would i use in X area to stop protection stones from being able to be placed there? i was planning on using this for spawn areas/other admin town areas and other locations perhaps.

xtomyserrax commented 3 years ago

Got you. You cant actually place a field inside a WG region but you can place one close to it. It could be a nice addition to prevent overlaping with a WG region (of course despite the player placing the field there, he wont be able to destroy the WG region and he will be able to destroy that field to move it somewhere else)

jamesol1 commented 3 years ago

ually place a field inside a WG region but you can place one close to it. It could be a nice addition to prevent overlaping with a WG region (of course despite the player placing the field there, he wont be able to destroy the WG region

Ok so i could setup WG regions in areas to stop them being placed there basically, i can work with that i should think. That does sound like a good addition! I was also wondering, if there is a setting that allows ops to see stuff like welcome messages/other similar stuff? i havent got my perms setup you see. Unless i've just not set that up properly and it should come up.

Thanks!

xtomyserrax commented 3 years ago

Hey, as far as I know you can set a limit for each stone:

xtomyserrax commented 3 years ago

Hey, after some research about this issue, the plugin actually prevents conflict between a field and a WG region but only when part of the limit is inside the region. What do I mean with part of the limit? The corners. If you test it, you will notice that you wont be able to place the field because it overlaps with a WG region.

What is the issue here? If the WG region is small, then your field might be bigger than it and the check wont work. The only way to fix this is by checking each block the field has if it overlaps with a WG region, this could be really bad for performance. Of course it could be improve by checking between x amounts of blocks instead of all of them.

I will keep this issue open, if anyone wants to fix it and has a performance friendly idea please do so!

https://github.com/elBukkit/PreciousStones/blob/1ca9873c3fbe22919bddd9cdbb793908de1ae5e1/src/main/java/net/sacredlabyrinth/Phaed/PreciousStones/managers/WorldGuardManager.java#L91

jamesol1 commented 3 years ago

Sorry i thought i replied. I suppose aslong as my WG regions aren't smaller then the precious stone regions i've made then they wont be able to be placed OVER admin made WG regions. Its not ideal given my field are about 40x40 but atleast i can work around it.

Just to confirm its only an issue if your protection field can cover the entire WG region (because it checks if its touching part of ANY of the corners.

If i really wanted small WG regions i guess i could have my 20x20 square but then add a 1 block wide line outside but joined with that defined region (if worldguard allows this)... so the fields cant completely cover it.

xtomyserrax commented 3 years ago

Yeah basicly this is an issue with small WG regions or really big fields. I guess the author made it this way for improving performance and preventing to check each block.

Maybe we can add a fix which could be enabled or disabled in the config file (also I would like to see how this check is done between fields)