mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-14 01:39:36 -04:00
Made block detection for agents more detailed, checking for "passable" blocks (ones without collision bounds). Closes #972.
This commit is contained in:
parent
6ce2256b0f
commit
c80adbb23c
@ -79,6 +79,9 @@ trait WorldAware {
|
|||||||
MinecraftForge.EVENT_BUS.post(event)
|
MinecraftForge.EVENT_BUS.post(event)
|
||||||
(event.isCanceled, "replaceable")
|
(event.isCanceled, "replaceable")
|
||||||
}
|
}
|
||||||
|
else if (block.getCollisionBoundingBoxFromPool(blockPos) == null) {
|
||||||
|
(true, "passable")
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
(true, "solid")
|
(true, "solid")
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,8 @@ object ExtendedBlock {
|
|||||||
def setBlockBoundsBasedOnState(position: BlockPosition) = block.setBlockBoundsBasedOnState(position.world.get, position.x, position.y, position.z)
|
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 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)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user