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]]
|
||||
name = "minedmap"
|
||||
name = "minedmap-core"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
[package]
|
||||
name = "minedmap"
|
||||
name = "minedmap-core"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
|
|
|
@ -7,7 +7,7 @@ use std::{
|
|||
use indexmap::IndexSet;
|
||||
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
|
||||
pub const FILE_META_VERSION: FileMetaVersion = FileMetaVersion(0);
|
||||
|
|
|
@ -5,6 +5,8 @@ mod region_processor;
|
|||
mod tile_mipmapper;
|
||||
mod tile_renderer;
|
||||
|
||||
use minedmap_core as core;
|
||||
|
||||
use std::path::PathBuf;
|
||||
|
||||
use anyhow::{Context, Result};
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
use anyhow::{Context, Result};
|
||||
use minedmap::{io::fs, world::de};
|
||||
use serde::Serialize;
|
||||
|
||||
use super::common::*;
|
||||
use super::{
|
||||
common::*,
|
||||
core::{self, io::fs, world::de},
|
||||
};
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
|
@ -77,8 +79,7 @@ impl<'a> MetadataWriter<'a> {
|
|||
}
|
||||
|
||||
fn read_level_dat(&self) -> Result<de::LevelDat> {
|
||||
minedmap::io::data::from_file(&self.config.level_dat_path)
|
||||
.context("Failed to read level.dat")
|
||||
core::io::data::from_file(&self.config.level_dat_path).context("Failed to read level.dat")
|
||||
}
|
||||
|
||||
fn spawn(level_dat: &de::LevelDat) -> Spawn {
|
||||
|
|
|
@ -4,7 +4,10 @@ use anyhow::{Context, Result};
|
|||
use indexmap::IndexSet;
|
||||
use rayon::prelude::*;
|
||||
|
||||
use minedmap::{
|
||||
use super::{
|
||||
common::*,
|
||||
core::{
|
||||
self,
|
||||
io::{fs, storage},
|
||||
resource::{self, Biome},
|
||||
types::*,
|
||||
|
@ -12,10 +15,9 @@ use minedmap::{
|
|||
self,
|
||||
layer::{self, LayerData},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
use super::common::*;
|
||||
|
||||
/// 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> {
|
||||
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);
|
||||
|
||||
minedmap::io::region::from_file(path)?.foreach_chunk(
|
||||
core::io::region::from_file(path)?.foreach_chunk(
|
||||
|chunk_coords, data: world::de::Chunk| {
|
||||
let Some(layer::LayerData {
|
||||
blocks,
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
use anyhow::{Context, Result};
|
||||
use rayon::prelude::*;
|
||||
|
||||
use minedmap::{io::fs, types::*};
|
||||
|
||||
use super::common::*;
|
||||
use super::{
|
||||
common::*,
|
||||
core::{io::fs, types::*},
|
||||
};
|
||||
|
||||
pub struct TileMipmapper<'a> {
|
||||
config: &'a Config,
|
||||
|
|
|
@ -11,15 +11,17 @@ use lru::LruCache;
|
|||
use rayon::prelude::*;
|
||||
use tokio::sync::OnceCell;
|
||||
|
||||
use minedmap::{
|
||||
use super::{
|
||||
common::*,
|
||||
core::{
|
||||
io::{fs, storage},
|
||||
resource::{block_color, needs_biome},
|
||||
types::*,
|
||||
util::coord_offset,
|
||||
},
|
||||
region_group::RegionGroup,
|
||||
};
|
||||
|
||||
use super::{common::*, region_group::RegionGroup};
|
||||
|
||||
type RegionRef = Arc<ProcessedRegion>;
|
||||
|
||||
fn biome_at(
|
||||
|
|
|
@ -12,7 +12,7 @@ struct Args {
|
|||
fn main() -> Result<()> {
|
||||
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);
|
||||
|
||||
Ok(())
|
||||
|
|
|
@ -12,7 +12,7 @@ struct Args {
|
|||
fn main() -> Result<()> {
|
||||
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| {
|
||||
println!("Chunk {:?}: {:#x?}", coords, value);
|
||||
Ok(())
|
||||
|
|
Loading…
Add table
Reference in a new issue