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:
Matthias Schiffer 2023-03-02 00:41:39 +01:00
parent 04bc3e5d53
commit ed5fb9a6cf
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C
2 changed files with 510 additions and 545 deletions

File diff suppressed because it is too large Load diff

View file

@ -5,7 +5,6 @@ use std::collections::HashMap;
use enumflags2::{bitflags, BitFlags};
pub use legacy_block_types::LEGACY_BLOCK_TYPES;
use serde::{de, Deserialize, Deserializer, Serialize, Serializer};
#[bitflags]
@ -65,12 +64,8 @@ impl Default for BlockTypes {
.iter()
.map(|(k, v)| (String::from(*k), *v))
.collect();
let legacy_block_types = Box::new(LEGACY_BLOCK_TYPES.map(|inner| {
inner.map(|id| {
*id.strip_prefix("minecraft:")
.and_then(|suffix| block_type_map.get(suffix))
.expect("Unknown legacy block type")
})
let legacy_block_types = Box::new(legacy_block_types::LEGACY_BLOCK_TYPES.map(|inner| {
inner.map(|id| *block_type_map.get(id).expect("Unknown legacy block type"))
}));
BlockTypes {