Remake of radius claim method. It now starts in the current chunk and spirals outward, in a repeating task designed to keep from overloading the server. The old method tried to put together a list of chunks, and then tried to claim them immediately starting from one corner of the overall area.

New setting "radiusClaimFailureLimit" (default 9). If claims are unsuccessful that many times in a row during a radius claim, the task will cancel out. There is no longer a limit to the specified radius since the process should no longer cause major server stress, and due to the process canceling out after several failures as just described.

Added some new methods to FLocation to quickly convert between block/chunk/region positions, and rewrote the FLocation hashCode() method to make it faster.
This commit is contained in:
Brettflan
2012-03-13 05:54:48 -05:00
parent fbdc0503ba
commit 2856411594
5 changed files with 288 additions and 36 deletions

View File

@@ -648,12 +648,10 @@ public class FPlayer extends PlayerEntity implements EconomyParticipator
{
Faction faction = this.getFaction();
if ( ! Econ.modifyMoney(faction, -cost, "to claim this land", "for claiming this land")) return false;
}
else
{
if ( ! Econ.modifyMoney(this, -cost, "to claim this land", "for claiming this land")) return false;
}
}