From 26555f17457b7ff0f636cee01e2383b5748ba7ca Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Fri, 3 Mar 2023 20:35:43 +0100 Subject: [PATCH] src/world/layer: make BlockInfo fields public There were left private by accident. --- Cargo.lock | 44 ++++++++++++++++++++++++++++++++++++++++++++ Cargo.toml | 1 + src/world/layer.rs | 6 +++--- 3 files changed, 48 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1137014..dda9b5c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -114,6 +114,12 @@ dependencies = [ "cc", ] +[[package]] +name = "color_quant" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" + [[package]] name = "crc32fast" version = "1.3.2" @@ -205,6 +211,20 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" +[[package]] +name = "image" +version = "0.24.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69b7ea949b537b0fd0af141fff8c77690f2ce96f4f41f042ccb6c69c6c965945" +dependencies = [ + "bytemuck", + "byteorder", + "color_quant", + "num-rational", + "num-traits", + "png", +] + [[package]] name = "io-lifetimes" version = "1.0.5" @@ -278,6 +298,7 @@ dependencies = [ "enumflags2", "fastnbt", "flate2", + "image", "itertools", "num-integer", "serde", @@ -303,6 +324,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-rational" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.15" @@ -330,6 +362,18 @@ version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" +[[package]] +name = "png" +version = "0.17.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d708eaf860a19b19ce538740d2b4bdeeb8337fa53f7738455e706623ad5c638" +dependencies = [ + "bitflags", + "crc32fast", + "flate2", + "miniz_oxide", +] + [[package]] name = "proc-macro-error" version = "1.0.4" diff --git a/Cargo.toml b/Cargo.toml index e719a80..9a82052 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,6 +15,7 @@ clap = { version = "4.1.4", features = ["derive"] } enumflags2 = "0.7.5" fastnbt = "2.3.2" flate2 = "1.0.25" +image = { version = "0.24.5", default-features = false, features = ["png"] } itertools = "0.10.5" num-integer = "0.1.45" serde = "1.0.152" diff --git a/src/world/layer.rs b/src/world/layer.rs index 94bd3e7..2f9382c 100644 --- a/src/world/layer.rs +++ b/src/world/layer.rs @@ -27,9 +27,9 @@ impl BlockHeight { #[derive(Debug, Clone, Copy, Serialize, Deserialize)] pub struct BlockInfo { - block_type: BlockType, - y: BlockHeight, - depth: Option, + pub block_type: BlockType, + pub y: BlockHeight, + pub depth: Option, } /// Helper methods for [BlockInfo]