Stargate Rewritten

Stargate Rewritten

241 Downloads

Spawn Chunk Handling

Pheotis opened this issue ยท 2 comments

commented

During the Beta 1.X Debugging session, several dozen unexplained issues have been discovered which only occur in the spawn chunk/protection area. These issues are bizarre, annoying, obscure, and plentiful.

As such, the spawn chunk warning is now very important to user experience; detection should be flawless and the message should be prominent.

Colouring.

Currently, the spawn chunk error uses the "positive" green prefix.
This error message should instead use the "negative" red prefix.
image

Detection

Ideal

Spawn protection is centred upon the world's vanilla spawn point.
This can be changed with setworldspawn

It extends rectangularly outwards n blocks from that point.
image

n is specified by the user in server.properties as spawn-protection.
image

Current.

Our current detection is centred upon that point, however, appears to use a radius.
It is also unclear as to whether our current detection accounts for the value specified by the user.

As such, it is currently possible to create a portal that is within spawn protection, yet not within our notification area.
image

commented

Additional bug: The current check only accounts for whether the sign is within the spawn area, which means that a Stargate can be mostly inside the spawn area as long as the sign is outside, and display no warnings.

Spawn radius is given by: Bukkit.getServer().getSpawnRadius() which seemingly gets the value set in the config file.

It seems the bug is in the comparison between the sign location and the spawn location. The spawn point is subtracted from the sign location and the difference is compared (which only works in a few cases).

commented

82ee4bb and 4feb2dd should fix this with some help from 10e9f6f. Tests seem to imply that all relevant bugs have been fixed. If not, feel free to re-open this issue.