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