Fix physics blocks not returning BlockDefinition instance if the core block was changed to non-solid, fixes ZS noclip detection being triggered.

This commit is contained in:
UnknownShadow200 2017-07-25 22:03:17 +10:00
parent 8d1a73756d
commit d7f759c837
2 changed files with 8 additions and 5 deletions

View File

@ -68,8 +68,7 @@ namespace MCGalaxy.Commands.Moderation {
} }
} else if (args[0].CaselessEq("list")) { } else if (args[0].CaselessEq("list")) {
string modifier = args.Length > 1 ? args[1] : ""; string modifier = args.Length > 1 ? args[1] : "";
MultiPageOutput.Output(p, p.level.ZoneList, FormatZone, MultiPageOutput.Output(p, p.level.ZoneList, FormatZone, "zone list", "zones", modifier, true);
"zone list", "zones", modifier, true);
} else { } else {
Help(p); Help(p);
} }

View File

@ -442,12 +442,16 @@ namespace MCGalaxy {
if (buffered) BlockQueue.Addblock(p, index, block); if (buffered) BlockQueue.Addblock(p, index, block);
else Player.GlobalBlockchange(this, x, y, z, block); else Player.GlobalBlockchange(this, x, y, z, block);
} }
public BlockDefinition GetBlockDef(ExtBlock block) { public BlockDefinition GetBlockDef(ExtBlock block) {
if (block.BlockID == Block.custom_block) return CustomBlockDefs[block.ExtID]; if (block.BlockID == Block.custom_block) return CustomBlockDefs[block.ExtID];
if (block.BlockID >= Block.CpeCount || block.BlockID == Block.Air) return null; if (block.BlockID == Block.Air) return null;
return CustomBlockDefs[block.BlockID];
if (block.BlockID >= Block.CpeCount) {
return CustomBlockDefs[Block.Convert(block.BlockID)];
} else {
return CustomBlockDefs[block.BlockID];
}
} }
public string BlockName(ExtBlock block) { public string BlockName(ExtBlock block) {