Allow claiming town plots in the same chunk

Off by one error
This commit is contained in:
Norbi Peti 2019-09-21 22:43:26 +02:00
parent ba0042311b
commit 648518d5b6
No known key found for this signature in database
GPG key ID: DBA4C4549A927E56

View file

@ -66,8 +66,8 @@ public class TownyFactionsComponent extends Component<ButtonPresents> implements
public void onTownyClaim(TownPreClaimEvent event) {
PS coord = PS.valueOf(getLocation(event.getTownBlock().getWorldCoord()));
int distance = distance().get();
for (int i = -distance; i <= distance; i++) {
for (int j = -distance; j <= distance; j++) {
for (int i = -distance + 1; i <= distance - 1; i++) {
for (int j = -distance + 1; j <= distance - 1; j++) {
if (i * i + j * j <= distance * distance) {
PS chunk = PS.valueOf(coord.getChunkX(true) + i, coord.getChunkZ(true) + j)
.withWorld(coord.getWorld());