mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-03-04 17:23:33 +01:00
Rename library crate to minedmap-core
Rustdoc can't deal with a bin and lib crate with the same name.
This commit is contained in:
parent
0542f2ea11
commit
0842cb4ec2
10 changed files with 36 additions and 28 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -552,7 +552,7 @@ dependencies = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "minedmap"
|
name = "minedmap-core"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[package]
|
[package]
|
||||||
name = "minedmap"
|
name = "minedmap-core"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|
|
@ -7,7 +7,7 @@ use std::{
|
||||||
use indexmap::IndexSet;
|
use indexmap::IndexSet;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use minedmap::{io::fs::FileMetaVersion, resource::Biome, types::*, world::layer};
|
use super::core::{io::fs::FileMetaVersion, resource::Biome, types::*, world::layer};
|
||||||
|
|
||||||
// Increase to force regeneration of all output files
|
// Increase to force regeneration of all output files
|
||||||
pub const FILE_META_VERSION: FileMetaVersion = FileMetaVersion(0);
|
pub const FILE_META_VERSION: FileMetaVersion = FileMetaVersion(0);
|
||||||
|
|
|
@ -5,6 +5,8 @@ mod region_processor;
|
||||||
mod tile_mipmapper;
|
mod tile_mipmapper;
|
||||||
mod tile_renderer;
|
mod tile_renderer;
|
||||||
|
|
||||||
|
use minedmap_core as core;
|
||||||
|
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
|
|
||||||
use anyhow::{Context, Result};
|
use anyhow::{Context, Result};
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
use anyhow::{Context, Result};
|
use anyhow::{Context, Result};
|
||||||
use minedmap::{io::fs, world::de};
|
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
use super::common::*;
|
use super::{
|
||||||
|
common::*,
|
||||||
|
core::{self, io::fs, world::de},
|
||||||
|
};
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
#[serde(rename_all = "camelCase")]
|
#[serde(rename_all = "camelCase")]
|
||||||
|
@ -77,8 +79,7 @@ impl<'a> MetadataWriter<'a> {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn read_level_dat(&self) -> Result<de::LevelDat> {
|
fn read_level_dat(&self) -> Result<de::LevelDat> {
|
||||||
minedmap::io::data::from_file(&self.config.level_dat_path)
|
core::io::data::from_file(&self.config.level_dat_path).context("Failed to read level.dat")
|
||||||
.context("Failed to read level.dat")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn spawn(level_dat: &de::LevelDat) -> Spawn {
|
fn spawn(level_dat: &de::LevelDat) -> Spawn {
|
||||||
|
|
|
@ -4,18 +4,20 @@ use anyhow::{Context, Result};
|
||||||
use indexmap::IndexSet;
|
use indexmap::IndexSet;
|
||||||
use rayon::prelude::*;
|
use rayon::prelude::*;
|
||||||
|
|
||||||
use minedmap::{
|
use super::{
|
||||||
io::{fs, storage},
|
common::*,
|
||||||
resource::{self, Biome},
|
core::{
|
||||||
types::*,
|
|
||||||
world::{
|
|
||||||
self,
|
self,
|
||||||
layer::{self, LayerData},
|
io::{fs, storage},
|
||||||
|
resource::{self, Biome},
|
||||||
|
types::*,
|
||||||
|
world::{
|
||||||
|
self,
|
||||||
|
layer::{self, LayerData},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::common::*;
|
|
||||||
|
|
||||||
/// Parses a filename in the format r.X.Z.mca into the contained X and Z values
|
/// Parses a filename in the format r.X.Z.mca into the contained X and Z values
|
||||||
fn parse_region_filename(file_name: &OsStr) -> Option<TileCoords> {
|
fn parse_region_filename(file_name: &OsStr) -> Option<TileCoords> {
|
||||||
let parts: Vec<_> = file_name.to_str()?.split('.').collect();
|
let parts: Vec<_> = file_name.to_str()?.split('.').collect();
|
||||||
|
@ -136,7 +138,7 @@ impl<'a> RegionProcessor<'a> {
|
||||||
|
|
||||||
println!("Processing region r.{}.{}.mca", coords.x, coords.z);
|
println!("Processing region r.{}.{}.mca", coords.x, coords.z);
|
||||||
|
|
||||||
minedmap::io::region::from_file(path)?.foreach_chunk(
|
core::io::region::from_file(path)?.foreach_chunk(
|
||||||
|chunk_coords, data: world::de::Chunk| {
|
|chunk_coords, data: world::de::Chunk| {
|
||||||
let Some(layer::LayerData {
|
let Some(layer::LayerData {
|
||||||
blocks,
|
blocks,
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
use anyhow::{Context, Result};
|
use anyhow::{Context, Result};
|
||||||
use rayon::prelude::*;
|
use rayon::prelude::*;
|
||||||
|
|
||||||
use minedmap::{io::fs, types::*};
|
use super::{
|
||||||
|
common::*,
|
||||||
use super::common::*;
|
core::{io::fs, types::*},
|
||||||
|
};
|
||||||
|
|
||||||
pub struct TileMipmapper<'a> {
|
pub struct TileMipmapper<'a> {
|
||||||
config: &'a Config,
|
config: &'a Config,
|
||||||
|
|
|
@ -11,15 +11,17 @@ use lru::LruCache;
|
||||||
use rayon::prelude::*;
|
use rayon::prelude::*;
|
||||||
use tokio::sync::OnceCell;
|
use tokio::sync::OnceCell;
|
||||||
|
|
||||||
use minedmap::{
|
use super::{
|
||||||
io::{fs, storage},
|
common::*,
|
||||||
resource::{block_color, needs_biome},
|
core::{
|
||||||
types::*,
|
io::{fs, storage},
|
||||||
util::coord_offset,
|
resource::{block_color, needs_biome},
|
||||||
|
types::*,
|
||||||
|
util::coord_offset,
|
||||||
|
},
|
||||||
|
region_group::RegionGroup,
|
||||||
};
|
};
|
||||||
|
|
||||||
use super::{common::*, region_group::RegionGroup};
|
|
||||||
|
|
||||||
type RegionRef = Arc<ProcessedRegion>;
|
type RegionRef = Arc<ProcessedRegion>;
|
||||||
|
|
||||||
fn biome_at(
|
fn biome_at(
|
||||||
|
|
|
@ -12,7 +12,7 @@ struct Args {
|
||||||
fn main() -> Result<()> {
|
fn main() -> Result<()> {
|
||||||
let args = Args::parse();
|
let args = Args::parse();
|
||||||
|
|
||||||
let value: fastnbt::Value = minedmap::io::data::from_file(args.file.as_path())?;
|
let value: fastnbt::Value = minedmap_core::io::data::from_file(args.file.as_path())?;
|
||||||
println!("{:#x?}", value);
|
println!("{:#x?}", value);
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
@ -12,7 +12,7 @@ struct Args {
|
||||||
fn main() -> Result<()> {
|
fn main() -> Result<()> {
|
||||||
let args = Args::parse();
|
let args = Args::parse();
|
||||||
|
|
||||||
minedmap::io::region::from_file(args.file.as_path())?.foreach_chunk(
|
minedmap_core::io::region::from_file(args.file.as_path())?.foreach_chunk(
|
||||||
|coords, value: fastnbt::Value| {
|
|coords, value: fastnbt::Value| {
|
||||||
println!("Chunk {:?}: {:#x?}", coords, value);
|
println!("Chunk {:?}: {:#x?}", coords, value);
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
Loading…
Add table
Reference in a new issue