mirror of
https://github.com/neocturne/MinedMap.git
synced 2025-03-05 01:24:53 +01:00
resource: remove "minecraft:" prefix from hash keys
Shorter keys mean less data to hash.
This commit is contained in:
parent
483cdf48c8
commit
95e4e45974
3 changed files with 941 additions and 940 deletions
|
@ -35,7 +35,7 @@ with open(sys.argv[1]) as f:
|
||||||
output = {}
|
output = {}
|
||||||
|
|
||||||
for name, info in blocks.items():
|
for name, info in blocks.items():
|
||||||
id = 'minecraft:' + name
|
id = name
|
||||||
|
|
||||||
output[id] = {
|
output[id] = {
|
||||||
'color': {'r': 0, 'g': 0, 'b': 0},
|
'color': {'r': 0, 'g': 0, 'b': 0},
|
||||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -58,7 +58,8 @@ pub struct BlockTypeMap(HashMap<String, BlockType>);
|
||||||
impl BlockTypeMap {
|
impl BlockTypeMap {
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn get(&self, id: &str) -> Option<BlockType> {
|
pub fn get(&self, id: &str) -> Option<BlockType> {
|
||||||
self.0.get(id).copied()
|
let suffix = id.strip_prefix("minecraft:")?;
|
||||||
|
self.0.get(suffix).copied()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue