Spawn Chunk Handling
Pheotis opened this issue ยท 2 comments
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.
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.
n is specified by the user in server.properties
as spawn-protection
.
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.
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).