Fix manual deletion of a block above dirt not changing it to grass. (Thanks Basicaneer)

This commit is contained in:
UnknownShadow200 2016-06-10 11:26:25 +10:00
parent f33a444d6d
commit 04f14f0c0c

View File

@ -142,17 +142,18 @@ namespace MCGalaxy {
bool DeleteBlock(byte b, ushort x, ushort y, ushort z, byte type, byte extType) {
if (deleteMode) { return ChangeBlock(x, y, z, Block.air, 0); }
bool changed = true;
Block.HandleDelete handler = Block.deleteHandlers[b];
if (handler != null) {
if (handler(this, b, x, y, z)) return false;
} else {
return ChangeBlock(x, y, z, Block.air, 0);
changed = ChangeBlock(x, y, z, Block.air, 0);
}
if ((level.physics == 0 || level.physics == 5) && level.GetTile(x, (ushort)(y - 1), z) == Block.dirt)
ChangeBlock(x, (ushort)(y - 1), z, Block.grass, 0);
return true;
return changed;
}
bool PlaceBlock(byte b, ushort x, ushort y, ushort z, byte type, byte extType) {