commands such as /b should show /lb name if it overrides a core block

This commit is contained in:
UnknownShadow200 2017-02-19 20:46:10 +11:00
parent d444ca71fa
commit 8832c1dd45

View File

@ -436,16 +436,15 @@ namespace MCGalaxy {
} }
public string BlockName(byte block, byte extBlock) { public string BlockName(byte block, byte extBlock) {
if (block != Block.custom_block) if (block == Block.custom_block) {
BlockDefinition def = CustomBlockDefs[extBlock];
return def == null ? extBlock.ToString() : def.Name.Replace(" ", "");
} else if (block >= Block.CpeCount) {
return Block.Name(block); return Block.Name(block);
} else {
BlockDefinition[] defs = CustomBlockDefs; BlockDefinition def = CustomBlockDefs[block];
for (int i = 1; i < Block.Invalid; i++) { return def == null ? Block.Name(block) : def.Name.Replace(" ", "");
BlockDefinition def = defs[i]; }
if (def == null) continue;
if (def.BlockID == extBlock) return def.Name.Replace(" ", "");
}
return extBlock.ToString();
} }
} }
} }