Residence

Residence

960k Downloads

Residence containsLoc - parent why?

aikar opened this issue ยท 1 comments

commented

https://github.com/bekvon/Residence/blob/master/src/com/bekvon/bukkit/residence/protection/ClaimedResidence.java#L466-L476

Why does the code check the parent for containsLoc? I don't see why that check is beneficial at all, and all subzones are guaranteed to be inside of the parents areas anyways, so why?

commented

Discussed it with another one of my devs. the case we can see is if you have 2 areas that say creates a T shape.

You can then create a subzone where high point is say in the top left of the T, and the low point is in the base of the T.

this results in the subzone now escaping the parent residences area...

Pretty tricky situation :/

So this check makes Residence ignore that area that escapes the parent.

So this results in some pretty weird shaped subzone areas (L shaped in the case of the T scenario), a non cuboid area, as part of the cuboid is 'ignored' for not being in the parent.

So I guess yes it is needed, but we will personally be ensuring subzone creation is blocked if it leaks outside of the parent, then we will remove that check to simplify the check.

Picture to better show it: https://i.imgur.com/3d6T6CP.png

Red = Parent res. Blue/Purple = 2 diff areas. Area addition checks if the new area high and low is contained in the parent, which it will pass.