mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-03-05 01:24:53 +01:00
resource: remove LEGACY_BLOCK_TYPES reexport
As the array is only used internally now, we can also remove the "minecraft:" prefix from the entries. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
This commit is contained in:
parent
04bc3e5d53
commit
ed5fb9a6cf
2 changed files with 510 additions and 545 deletions
File diff suppressed because it is too large
Load diff
|
@ -5,7 +5,6 @@ use std::collections::HashMap;
|
||||||
|
|
||||||
use enumflags2::{bitflags, BitFlags};
|
use enumflags2::{bitflags, BitFlags};
|
||||||
|
|
||||||
pub use legacy_block_types::LEGACY_BLOCK_TYPES;
|
|
||||||
use serde::{de, Deserialize, Deserializer, Serialize, Serializer};
|
use serde::{de, Deserialize, Deserializer, Serialize, Serializer};
|
||||||
|
|
||||||
#[bitflags]
|
#[bitflags]
|
||||||
|
@ -65,12 +64,8 @@ impl Default for BlockTypes {
|
||||||
.iter()
|
.iter()
|
||||||
.map(|(k, v)| (String::from(*k), *v))
|
.map(|(k, v)| (String::from(*k), *v))
|
||||||
.collect();
|
.collect();
|
||||||
let legacy_block_types = Box::new(LEGACY_BLOCK_TYPES.map(|inner| {
|
let legacy_block_types = Box::new(legacy_block_types::LEGACY_BLOCK_TYPES.map(|inner| {
|
||||||
inner.map(|id| {
|
inner.map(|id| *block_type_map.get(id).expect("Unknown legacy block type"))
|
||||||
*id.strip_prefix("minecraft:")
|
|
||||||
.and_then(|suffix| block_type_map.get(suffix))
|
|
||||||
.expect("Unknown legacy block type")
|
|
||||||
})
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
BlockTypes {
|
BlockTypes {
|
||||||
|
|
Loading…
Add table
Reference in a new issue