Fix: if a custom block is defined, /b should output its numerical block id.

This commit is contained in:
UnknownShadow200 2016-09-11 19:23:44 +10:00
parent 8f9e8c772a
commit d6ff32a2d9

View File

@ -450,15 +450,16 @@ 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[] defs = CustomBlockDefs; return Block.Name(block);
for (int i = 1; i < 255; i++) {
BlockDefinition def = defs[i]; BlockDefinition[] defs = CustomBlockDefs;
if (def == null) continue; for (int i = 1; i < 255; i++) {
if (def.BlockID == extBlock) return def.Name.Replace(" ", ""); BlockDefinition def = defs[i];
} if (def == null) continue;
if (def.BlockID == extBlock) return def.Name.Replace(" ", "");
} }
return Block.Name(block); return extBlock.ToString();
} }
} }
} }