1
0

Check for intersection between placed blocks and entities. (#3850)

* Check for intersection between placed blocks and entities.

+ Implemented GetPlacementCollisionBox, to permit custom placement collision boxes for blocks.

* Factored block-entity placement checking into another function in cPlayer.

- Removed vector min/max functions

* Use GetWorld to get the world in DoesPlacingBlocksIntersectEntity.

+ Added block height checks, allow different cEntity subclasses to decide whether they will prevent block placement.
This commit is contained in:
Lane Kolbly
2017-07-28 11:59:21 -05:00
committed by Tiger Wang
parent eb4432bb62
commit 5402b214b3
17 changed files with 300 additions and 3 deletions

View File

@@ -34,6 +34,11 @@ cBlockInfo::cBlockInfoArray::cBlockInfoArray()
}
cBoundingBox::cBoundingBox(double, double, double, double, double, double)
{
}
@@ -45,6 +50,15 @@ cBlockHandler::cBlockHandler(BLOCKTYPE a_BlockType)
cBoundingBox cBlockHandler::GetPlacementCollisionBox(BLOCKTYPE a_XM, BLOCKTYPE a_XP, BLOCKTYPE a_YM, BLOCKTYPE a_YP, BLOCKTYPE a_ZM, BLOCKTYPE a_ZP)
{
return cBoundingBox(0, 0, 0, 0, 0, 0);
}
bool cBlockHandler::GetPlacementBlockTypeMeta(
cChunkInterface & a_ChunkInterface, cPlayer * a_Player,
int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace,