mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-03-04 17:23:33 +01:00
Restructure crates
Get rid of the arbitrary bin/lib split and instead move as much as possible into the bin crate, which becomes the main crate again. The types and NBT handling are moved into separate crates, so they can be reused by nbtdump and regiondump.
This commit is contained in:
parent
09399f5ae9
commit
248a641035
21 changed files with 121 additions and 62 deletions
25
Cargo.lock
generated
25
Cargo.lock
generated
|
@ -558,17 +558,16 @@ version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"bincode",
|
"bincode",
|
||||||
"bytemuck",
|
|
||||||
"clap",
|
"clap",
|
||||||
"enumflags2",
|
"enumflags2",
|
||||||
"fastnbt",
|
"fastnbt",
|
||||||
"flate2",
|
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"glam",
|
"glam",
|
||||||
"image",
|
"image",
|
||||||
"indexmap",
|
"indexmap",
|
||||||
"itertools",
|
|
||||||
"lru",
|
"lru",
|
||||||
|
"minedmap-nbt",
|
||||||
|
"minedmap-types",
|
||||||
"num-integer",
|
"num-integer",
|
||||||
"num_cpus",
|
"num_cpus",
|
||||||
"rayon",
|
"rayon",
|
||||||
|
@ -579,6 +578,26 @@ dependencies = [
|
||||||
"zstd",
|
"zstd",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "minedmap-nbt"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"anyhow",
|
||||||
|
"bytemuck",
|
||||||
|
"fastnbt",
|
||||||
|
"flate2",
|
||||||
|
"minedmap-types",
|
||||||
|
"serde",
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "minedmap-types"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"itertools",
|
||||||
|
"serde",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "miniz_oxide"
|
name = "miniz_oxide"
|
||||||
version = "0.7.1"
|
version = "0.7.1"
|
||||||
|
|
13
Cargo.toml
13
Cargo.toml
|
@ -1,3 +1,6 @@
|
||||||
|
[workspace]
|
||||||
|
members = ["crates/*"]
|
||||||
|
|
||||||
[package]
|
[package]
|
||||||
name = "minedmap"
|
name = "minedmap"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
@ -5,23 +8,19 @@ edition = "2021"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
default-run = "minedmap"
|
default-run = "minedmap"
|
||||||
|
|
||||||
[lib]
|
|
||||||
name = "minedmap_core"
|
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1.0.68"
|
anyhow = "1.0.68"
|
||||||
bincode = "1.3.3"
|
bincode = "1.3.3"
|
||||||
bytemuck = "1.13.0"
|
|
||||||
clap = { version = "4.1.4", features = ["derive"] }
|
clap = { version = "4.1.4", features = ["derive"] }
|
||||||
enumflags2 = { version = "0.7.5", features = ["serde"] }
|
enumflags2 = { version = "0.7.5", features = ["serde"] }
|
||||||
fastnbt = "2.3.2"
|
fastnbt = "2.3.2"
|
||||||
flate2 = "1.0.25"
|
|
||||||
futures-util = "0.3.28"
|
futures-util = "0.3.28"
|
||||||
glam = "0.24.0"
|
glam = "0.24.0"
|
||||||
image = { version = "0.24.5", default-features = false, features = ["png"] }
|
image = { version = "0.24.5", default-features = false, features = ["png"] }
|
||||||
indexmap = { version = "2.0.0", features = ["serde"] }
|
indexmap = { version = "2.0.0", features = ["serde"] }
|
||||||
itertools = "0.11.0"
|
|
||||||
lru = "0.11.0"
|
lru = "0.11.0"
|
||||||
|
minedmap-nbt = { version = "0.1.0", path = "crates/nbt", default-features = false }
|
||||||
|
minedmap-types = { version = "0.1.0", path = "crates/types" }
|
||||||
num-integer = "0.1.45"
|
num-integer = "0.1.45"
|
||||||
num_cpus = "1.16.0"
|
num_cpus = "1.16.0"
|
||||||
rayon = "1.7.0"
|
rayon = "1.7.0"
|
||||||
|
@ -33,4 +32,4 @@ zstd = "0.12.3"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["zlib-ng"]
|
default = ["zlib-ng"]
|
||||||
zlib-ng = ["flate2/zlib-ng"]
|
zlib-ng = ["minedmap-nbt/zlib-ng"]
|
||||||
|
|
17
crates/nbt/Cargo.toml
Normal file
17
crates/nbt/Cargo.toml
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
[package]
|
||||||
|
name = "minedmap-nbt"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
anyhow = "1.0.75"
|
||||||
|
bytemuck = "1.13.1"
|
||||||
|
fastnbt = "2.4.4"
|
||||||
|
flate2 = "1.0.27"
|
||||||
|
minedmap-types = { version = "0.1.0", path = "../types" }
|
||||||
|
serde = "1.0.183"
|
||||||
|
|
||||||
|
[features]
|
||||||
|
zlib-ng = ["flate2/zlib-ng"]
|
7
crates/nbt/src/lib.rs
Normal file
7
crates/nbt/src/lib.rs
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
//! MinedMap's of Minecraft NBT data and region files
|
||||||
|
|
||||||
|
#![warn(missing_docs)]
|
||||||
|
#![warn(clippy::missing_docs_in_private_items)]
|
||||||
|
|
||||||
|
pub mod data;
|
||||||
|
pub mod region;
|
|
@ -10,7 +10,7 @@ use anyhow::{bail, Context, Result};
|
||||||
use flate2::read::ZlibDecoder;
|
use flate2::read::ZlibDecoder;
|
||||||
use serde::de::DeserializeOwned;
|
use serde::de::DeserializeOwned;
|
||||||
|
|
||||||
use crate::types::*;
|
use minedmap_types::*;
|
||||||
|
|
||||||
/// Data block size of region data files
|
/// Data block size of region data files
|
||||||
///
|
///
|
10
crates/types/Cargo.toml
Normal file
10
crates/types/Cargo.toml
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
[package]
|
||||||
|
name = "minedmap-types"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
itertools = "0.11.0"
|
||||||
|
serde = "1.0.183"
|
|
@ -1,5 +1,8 @@
|
||||||
//! Common types used by MinedMap
|
//! Common types used by MinedMap
|
||||||
|
|
||||||
|
#![warn(missing_docs)]
|
||||||
|
#![warn(clippy::missing_docs_in_private_items)]
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
fmt::Debug,
|
fmt::Debug,
|
||||||
iter::FusedIterator,
|
iter::FusedIterator,
|
||||||
|
@ -32,6 +35,7 @@ macro_rules! coord_type {
|
||||||
/// Constructs a new value
|
/// Constructs a new value
|
||||||
///
|
///
|
||||||
/// Will panic if the value is not in the valid range
|
/// Will panic if the value is not in the valid range
|
||||||
|
#[inline]
|
||||||
pub fn new<T: TryInto<u8>>(value: T) -> Self {
|
pub fn new<T: TryInto<u8>>(value: T) -> Self {
|
||||||
Self(
|
Self(
|
||||||
value
|
value
|
||||||
|
@ -43,6 +47,7 @@ macro_rules! coord_type {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns an iterator over all possible values of the type
|
/// Returns an iterator over all possible values of the type
|
||||||
|
#[inline]
|
||||||
pub fn iter() -> impl Iterator<Item = $t<AXIS>>
|
pub fn iter() -> impl Iterator<Item = $t<AXIS>>
|
||||||
+ DoubleEndedIterator
|
+ DoubleEndedIterator
|
||||||
+ ExactSizeIterator
|
+ ExactSizeIterator
|
||||||
|
@ -95,6 +100,7 @@ impl LayerBlockCoords {
|
||||||
/// Many chunk data structures store block and biome data in the same
|
/// Many chunk data structures store block and biome data in the same
|
||||||
/// order. This method computes the offset at which the data for the
|
/// order. This method computes the offset at which the data for the
|
||||||
/// block at a given coordinate is stored.
|
/// block at a given coordinate is stored.
|
||||||
|
#[inline]
|
||||||
pub fn offset(&self) -> usize {
|
pub fn offset(&self) -> usize {
|
||||||
use BLOCKS_PER_CHUNK as N;
|
use BLOCKS_PER_CHUNK as N;
|
||||||
let x = self.x.0 as usize;
|
let x = self.x.0 as usize;
|
||||||
|
@ -112,12 +118,14 @@ pub struct LayerBlockArray<T>(pub [[T; BLOCKS_PER_CHUNK]; BLOCKS_PER_CHUNK]);
|
||||||
impl<T> Index<LayerBlockCoords> for LayerBlockArray<T> {
|
impl<T> Index<LayerBlockCoords> for LayerBlockArray<T> {
|
||||||
type Output = T;
|
type Output = T;
|
||||||
|
|
||||||
|
#[inline]
|
||||||
fn index(&self, index: LayerBlockCoords) -> &Self::Output {
|
fn index(&self, index: LayerBlockCoords) -> &Self::Output {
|
||||||
&self.0[index.z.0 as usize][index.x.0 as usize]
|
&self.0[index.z.0 as usize][index.x.0 as usize]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T> IndexMut<LayerBlockCoords> for LayerBlockArray<T> {
|
impl<T> IndexMut<LayerBlockCoords> for LayerBlockArray<T> {
|
||||||
|
#[inline]
|
||||||
fn index_mut(&mut self, index: LayerBlockCoords) -> &mut Self::Output {
|
fn index_mut(&mut self, index: LayerBlockCoords) -> &mut Self::Output {
|
||||||
&mut self.0[index.z.0 as usize][index.x.0 as usize]
|
&mut self.0[index.z.0 as usize][index.x.0 as usize]
|
||||||
}
|
}
|
||||||
|
@ -138,6 +146,7 @@ impl SectionBlockCoords {
|
||||||
/// Many chunk data structures store block and biome data in the same
|
/// Many chunk data structures store block and biome data in the same
|
||||||
/// order. This method computes the offset at which the data for the
|
/// order. This method computes the offset at which the data for the
|
||||||
/// block at a given coordinate is stored.
|
/// block at a given coordinate is stored.
|
||||||
|
#[inline]
|
||||||
pub fn offset(&self) -> usize {
|
pub fn offset(&self) -> usize {
|
||||||
use BLOCKS_PER_CHUNK as N;
|
use BLOCKS_PER_CHUNK as N;
|
||||||
let y = self.y.0 as usize;
|
let y = self.y.0 as usize;
|
||||||
|
@ -194,16 +203,19 @@ pub struct ChunkArray<T>(pub [[T; CHUNKS_PER_REGION]; CHUNKS_PER_REGION]);
|
||||||
|
|
||||||
impl<T> ChunkArray<T> {
|
impl<T> ChunkArray<T> {
|
||||||
/// Iterates over all possible chunk coordinate pairs used as [ChunkArray] keys
|
/// Iterates over all possible chunk coordinate pairs used as [ChunkArray] keys
|
||||||
|
#[inline]
|
||||||
pub fn keys() -> impl Iterator<Item = ChunkCoords> + Clone + Debug {
|
pub fn keys() -> impl Iterator<Item = ChunkCoords> + Clone + Debug {
|
||||||
iproduct!(ChunkZ::iter(), ChunkX::iter()).map(|(z, x)| ChunkCoords { x, z })
|
iproduct!(ChunkZ::iter(), ChunkX::iter()).map(|(z, x)| ChunkCoords { x, z })
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Iterates over all values stored in the [ChunkArray]
|
/// Iterates over all values stored in the [ChunkArray]
|
||||||
|
#[inline]
|
||||||
pub fn values(&self) -> impl Iterator<Item = &T> + Clone + Debug {
|
pub fn values(&self) -> impl Iterator<Item = &T> + Clone + Debug {
|
||||||
Self::keys().map(|k| &self[k])
|
Self::keys().map(|k| &self[k])
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Iterates over pairs of chunk coordinate pairs and corresponding stored values
|
/// Iterates over pairs of chunk coordinate pairs and corresponding stored values
|
||||||
|
#[inline]
|
||||||
pub fn iter(&self) -> impl Iterator<Item = (ChunkCoords, &T)> + Clone + Debug {
|
pub fn iter(&self) -> impl Iterator<Item = (ChunkCoords, &T)> + Clone + Debug {
|
||||||
Self::keys().map(|k| (k, &self[k]))
|
Self::keys().map(|k| (k, &self[k]))
|
||||||
}
|
}
|
||||||
|
@ -212,12 +224,14 @@ impl<T> ChunkArray<T> {
|
||||||
impl<T> Index<ChunkCoords> for ChunkArray<T> {
|
impl<T> Index<ChunkCoords> for ChunkArray<T> {
|
||||||
type Output = T;
|
type Output = T;
|
||||||
|
|
||||||
|
#[inline]
|
||||||
fn index(&self, index: ChunkCoords) -> &Self::Output {
|
fn index(&self, index: ChunkCoords) -> &Self::Output {
|
||||||
&self.0[index.z.0 as usize][index.x.0 as usize]
|
&self.0[index.z.0 as usize][index.x.0 as usize]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T> IndexMut<ChunkCoords> for ChunkArray<T> {
|
impl<T> IndexMut<ChunkCoords> for ChunkArray<T> {
|
||||||
|
#[inline]
|
||||||
fn index_mut(&mut self, index: ChunkCoords) -> &mut Self::Output {
|
fn index_mut(&mut self, index: ChunkCoords) -> &mut Self::Output {
|
||||||
&mut self.0[index.z.0 as usize][index.x.0 as usize]
|
&mut self.0[index.z.0 as usize][index.x.0 as usize]
|
||||||
}
|
}
|
|
@ -18,7 +18,7 @@ struct Args {
|
||||||
fn main() -> Result<()> {
|
fn main() -> Result<()> {
|
||||||
let args = Args::parse();
|
let args = Args::parse();
|
||||||
|
|
||||||
let value: fastnbt::Value = minedmap_core::io::data::from_file(args.file.as_path())?;
|
let value: fastnbt::Value = minedmap_nbt::data::from_file(args.file.as_path())?;
|
||||||
println!("{:#x?}", value);
|
println!("{:#x?}", value);
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
@ -18,7 +18,7 @@ struct Args {
|
||||||
fn main() -> Result<()> {
|
fn main() -> Result<()> {
|
||||||
let args = Args::parse();
|
let args = Args::parse();
|
||||||
|
|
||||||
minedmap_core::io::region::from_file(args.file.as_path())?.foreach_chunk(
|
minedmap_nbt::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(())
|
||||||
|
|
|
@ -9,7 +9,7 @@ use std::{
|
||||||
use indexmap::IndexSet;
|
use indexmap::IndexSet;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use super::core::{io::fs::FileMetaVersion, resource::Biome, types::*, world::layer};
|
use crate::{io::fs::FileMetaVersion, resource::Biome, types::*, world::layer};
|
||||||
|
|
||||||
/// MinedMap data version number
|
/// MinedMap data version number
|
||||||
///
|
///
|
|
@ -3,10 +3,7 @@
|
||||||
use anyhow::{Context, Result};
|
use anyhow::{Context, Result};
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
use super::{
|
use crate::{core::common::*, io::fs, world::de};
|
||||||
common::*,
|
|
||||||
core::{self, io::fs, world::de},
|
|
||||||
};
|
|
||||||
|
|
||||||
/// Minimum and maximum X and Z tile coordinates for a mipmap level
|
/// Minimum and maximum X and Z tile coordinates for a mipmap level
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
|
@ -101,7 +98,7 @@ impl<'a> MetadataWriter<'a> {
|
||||||
|
|
||||||
/// Reads and deserializes the `level.dat` of the Minecraft save data
|
/// Reads and deserializes the `level.dat` of the Minecraft save data
|
||||||
fn read_level_dat(&self) -> Result<de::LevelDat> {
|
fn read_level_dat(&self) -> Result<de::LevelDat> {
|
||||||
core::io::data::from_file(&self.config.level_dat_path).context("Failed to read level.dat")
|
crate::nbt::data::from_file(&self.config.level_dat_path).context("Failed to read level.dat")
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Generates [Spawn] data from a [de::LevelDat]
|
/// Generates [Spawn] data from a [de::LevelDat]
|
|
@ -1,7 +1,4 @@
|
||||||
//! The minedmap generator renders map tile images from Minecraft save data
|
//! Core functions of the MinedMap CLI
|
||||||
|
|
||||||
#![warn(missing_docs)]
|
|
||||||
#![warn(clippy::missing_docs_in_private_items)]
|
|
||||||
|
|
||||||
mod common;
|
mod common;
|
||||||
mod metadata_writer;
|
mod metadata_writer;
|
||||||
|
@ -10,8 +7,6 @@ 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};
|
||||||
|
@ -46,7 +41,8 @@ fn setup_threads(num_threads: usize) -> Result<()> {
|
||||||
.context("Failed to configure thread pool")
|
.context("Failed to configure thread pool")
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() -> Result<()> {
|
/// MinedMap CLI main function
|
||||||
|
pub fn cli() -> Result<()> {
|
||||||
let args = Args::parse();
|
let args = Args::parse();
|
||||||
let config = Config::new(&args);
|
let config = Config::new(&args);
|
||||||
|
|
|
@ -6,17 +6,14 @@ use anyhow::{Context, Result};
|
||||||
use indexmap::IndexSet;
|
use indexmap::IndexSet;
|
||||||
use rayon::prelude::*;
|
use rayon::prelude::*;
|
||||||
|
|
||||||
use super::{
|
use super::common::*;
|
||||||
common::*,
|
use crate::{
|
||||||
core::{
|
io::{fs, storage},
|
||||||
|
resource::{self, Biome},
|
||||||
|
types::*,
|
||||||
|
world::{
|
||||||
self,
|
self,
|
||||||
io::{fs, storage},
|
layer::{self, LayerData},
|
||||||
resource::{self, Biome},
|
|
||||||
types::*,
|
|
||||||
world::{
|
|
||||||
self,
|
|
||||||
layer::{self, LayerData},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -157,7 +154,7 @@ impl<'a> RegionProcessor<'a> {
|
||||||
|
|
||||||
println!("Processing region r.{}.{}.mca", coords.x, coords.z);
|
println!("Processing region r.{}.{}.mca", coords.x, coords.z);
|
||||||
|
|
||||||
core::io::region::from_file(path)?.foreach_chunk(
|
crate::nbt::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,
|
|
@ -3,10 +3,8 @@
|
||||||
use anyhow::{Context, Result};
|
use anyhow::{Context, Result};
|
||||||
use rayon::prelude::*;
|
use rayon::prelude::*;
|
||||||
|
|
||||||
use super::{
|
use super::common::*;
|
||||||
common::*,
|
use crate::{io::fs, types::*};
|
||||||
core::{io::fs, types::*},
|
|
||||||
};
|
|
||||||
|
|
||||||
/// Generates mipmap tiles from full-resolution tile images
|
/// Generates mipmap tiles from full-resolution tile images
|
||||||
pub struct TileMipmapper<'a> {
|
pub struct TileMipmapper<'a> {
|
|
@ -13,15 +13,12 @@ use lru::LruCache;
|
||||||
use rayon::prelude::*;
|
use rayon::prelude::*;
|
||||||
use tokio::sync::OnceCell;
|
use tokio::sync::OnceCell;
|
||||||
|
|
||||||
use super::{
|
use super::{common::*, region_group::RegionGroup};
|
||||||
common::*,
|
use crate::{
|
||||||
core::{
|
io::{fs, storage},
|
||||||
io::{fs, storage},
|
resource::{block_color, needs_biome},
|
||||||
resource::{block_color, needs_biome},
|
types::*,
|
||||||
types::*,
|
util::coord_offset,
|
||||||
util::coord_offset,
|
|
||||||
},
|
|
||||||
region_group::RegionGroup,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Type for referencing loaded [ProcessedRegion] data
|
/// Type for referencing loaded [ProcessedRegion] data
|
|
@ -1,6 +1,4 @@
|
||||||
//! Input/output functions
|
//! Input/output functions
|
||||||
|
|
||||||
pub mod data;
|
|
||||||
pub mod fs;
|
pub mod fs;
|
||||||
pub mod region;
|
|
||||||
pub mod storage;
|
pub mod storage;
|
||||||
|
|
10
src/lib.rs
10
src/lib.rs
|
@ -1,10 +0,0 @@
|
||||||
//! Common library for MinedMap generator and dump utilities
|
|
||||||
|
|
||||||
#![warn(missing_docs)]
|
|
||||||
#![warn(clippy::missing_docs_in_private_items)]
|
|
||||||
|
|
||||||
pub mod io;
|
|
||||||
pub mod resource;
|
|
||||||
pub mod types;
|
|
||||||
pub mod util;
|
|
||||||
pub mod world;
|
|
19
src/main.rs
Normal file
19
src/main.rs
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
//! The minedmap generator renders map tile images from Minecraft save data
|
||||||
|
|
||||||
|
#![warn(missing_docs)]
|
||||||
|
#![warn(clippy::missing_docs_in_private_items)]
|
||||||
|
|
||||||
|
mod core;
|
||||||
|
mod io;
|
||||||
|
mod resource;
|
||||||
|
mod util;
|
||||||
|
mod world;
|
||||||
|
|
||||||
|
use minedmap_nbt as nbt;
|
||||||
|
use minedmap_types as types;
|
||||||
|
|
||||||
|
use anyhow::Result;
|
||||||
|
|
||||||
|
fn main() -> Result<()> {
|
||||||
|
core::cli()
|
||||||
|
}
|
|
@ -46,6 +46,7 @@ pub struct BlockType {
|
||||||
|
|
||||||
impl BlockType {
|
impl BlockType {
|
||||||
/// Checks whether a block type has a given [BlockFlag] set
|
/// Checks whether a block type has a given [BlockFlag] set
|
||||||
|
#[inline]
|
||||||
pub fn is(&self, flag: BlockFlag) -> bool {
|
pub fn is(&self, flag: BlockFlag) -> bool {
|
||||||
self.flags.contains(flag)
|
self.flags.contains(flag)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue