int bx = (int) QuickMath.floor((x-cx)*16);
int bz = (int) QuickMath.floor((z-cz)*16);
bx = Math.max(0, Math.min(Chunk.X_MAX-1, bx));
bz = Math.max(0, Math.min(Chunk.Z_MAX-1, bz));
ChunkPosition cp = ChunkPosition.get(cx, cz);
Chunk hoveredChunk = chunky.getWorld().getChunk(cp);
if (!hoveredChunk.isEmpty()) {
mapLabel.setText(String.format("%s, biome: %s",
""+hoveredChunk.toString(),
hoveredChunk.biomeAt(bx, bz)));
} else {
mapLabel.setText(hoveredChunk.toString());
}
return cp;
}