Made block detection for agents more detailed, checking for "passable" blocks (ones without collision bounds). Closes #972.

This commit is contained in:
Florian Nücke 2015-03-26 13:57:50 +01:00
parent 6ce2256b0f
commit c80adbb23c
2 changed files with 5 additions and 0 deletions

View File

@ -79,6 +79,9 @@ trait WorldAware {
MinecraftForge.EVENT_BUS.post(event)
(event.isCanceled, "replaceable")
}
else if (block.getCollisionBoundingBoxFromPool(blockPos) == null) {
(true, "passable")
}
else {
(true, "solid")
}

View File

@ -16,6 +16,8 @@ object ExtendedBlock {
def setBlockBoundsBasedOnState(position: BlockPosition) = block.setBlockBoundsBasedOnState(position.world.get, position.x, position.y, position.z)
def getSelectedBoundingBoxFromPool(position: BlockPosition) = block.getSelectedBoundingBoxFromPool(position.world.get, position.x, position.y, position.z)
def getCollisionBoundingBoxFromPool(position: BlockPosition) = block.getCollisionBoundingBoxFromPool(position.world.get, position.x, position.y, position.z)
}
}