EngineHub / EngineHub/WorldGuard

Polygon Oddities

Open
#1,537 5 comments 3 reactions 0 assignees View on GitHub
type:api type:bug
Dominant language
Java
Stars
938
Forks
671
PR merge metrics
No merged PRs in 30d

Description

Due to the weird way that the polygon region calculations work, a lot of issues have arisen.
Both the volume algorithm and the contains checks need to match and be rigorously tested, especially in edge case which may be mentioned in the following:

#1244
#1281
#1172

This is the cause for other issues such as:
#997

Any other issues with polygons should be closed and linked here, in the interest of cleanliness. They all arise from the same root cause.

~~Another thing to be checked:
https://github.com/EngineHub/WorldGuard/blob/master/worldguard-core/src/main/java/com/sk89q/worldguard/protection/managers/index/ChunkHashTable.java
could be potentially causing chunk states to show as loaded but not including the polygon, or vice versa (polygon existing in unloaded chunk state)~~
I'm fairly sure this is just caused by the higher edge not being included, i.e. the outermost edge is truncated to 0 instead of checking the 0.5 position for inside/outside like WE does.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.