while (lastChunk.equals(currentChunk)) {
loc.setX(loc.getX() - 10);
currentChunk = w.getChunkAt(loc);
}
lastChunk = currentChunk;
w.refreshChunk((int) loc.getX(), (int) loc.getZ());
loc = player.getLocation();
// regenerate in front of player
while (lastChunk.equals(currentChunk)) {
loc.setZ(loc.getZ() + 10);