WorldGuard

WorldGuard

8M Downloads

Polygon selected regions don't work when in certain coordinate values.

LadyCailinBot opened this issue ยท 9 comments

commented

WORLDGUARD-3216 - Reported by Zeloz

When I do "/region info" it shows all but a few regions that I'm standing in. For the regions that do not show up I can still do "/region select [name]" and do "//set [number]" and it fills the entire region with the block that was set, so I know it is there but it does not provide worldguard protection. All regions work except regions 6-1, 6-3, 6-5, 6-7, 6-9, 6-11 and 6-13. The region.yml is attached

An example set of coordinates would be:
max-y: 77
priority: 2
points:
- {z: -40, x: -478}
- {z: -40, x: -465}
- {z: -37, x: -465}
- {z: -37, x: -466}
- {z: -34, x: -466}
- {z: -34, x: -478}
type: poly2d
owners: {}
min-y: 68

If you create polygon regions with the same points or similar as the non-working regions, it will not show up. I believe it has to do with horizontal locations of the entire region.

commented

Comment by Nolora

I have exactly the same issue both with WorldGuard 2.0 Beta 2 and the last WorldGuard DevBuild. In addition, when doing a right click with a leather, these regions do not appear.

commented

Comment by Whatafairfoot

I have the same problem dude ...

commented

Comment by Zeloz

Are you guys running cauldron?

commented

Comment by Nolora

Nop, Spigot.

commented

Comment by sk89q

Actually, I cannot reproduce this problem.

The regions file:

regions:
    test:
        max-y: 77
        priority: 2
        points:
        - {z: -40, x: -478}
        - {z: -40, x: -465}
        - {z: -37, x: -465}
        - {z: -37, x: -466}
        - {z: -34, x: -466}
        - {z: -34, x: -478}
        type: poly2d
        owners: {}
        min-y: 68

commented

Comment by Nolora

Well... have you tried to right click with the leather on a block ? Beacause I have "No defined regions here !" with this file. (And it's works fine on WG 5.9, it's only a WG 6.0 issue)

commented

Comment by Nolora

What's strange is that according to Github, the ProtectedPolygonRegion.contains(Vector) didn't change between 5.9 and 6.0... Maybe a query cache issue ?

commented

Comment by sk89q

I accidentally briefly experienced this the other day, but then it went away. It's strange.

The query cache caches only on specific points, and for maybe at most a second.

commented

Comment by sk89q

There's also another cache I forgot about that keeps a cache per chunk, which speeds up lookups.

Turns out that the code to do polygon-cuboid geometric intersection was broken, so the cache was caching the wrong data. However, the point-in-polygon code worked fine so that's why the region wand (leather) showed the region regardless.