mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-08 14:50:51 -04:00
tweak Robot block detection code, close #3239
This commit is contained in:
parent
9b6ab25769
commit
b9696ab310
@ -327,9 +327,14 @@ class Player(val agent: internal.Agent) extends FakePlayer(agent.world.asInstanc
|
||||
val block = world.getBlock(x, y, z)
|
||||
val metadata = world.getBlockMetadata(x, y, z)
|
||||
val mayClickBlock = block != null
|
||||
/**
|
||||
* block.canCollideCheck seems to be false for air, liquids, fire, and "hidden" blocks of various kinds.
|
||||
* block.getCollisionBoundingBox is null for selectable blocks too, like signs - so it's not an option.
|
||||
*/
|
||||
val canClickBlock = mayClickBlock &&
|
||||
!block.isAir(world, x, y, z) &&
|
||||
FluidRegistry.lookupFluidForBlock(block) == null
|
||||
block.canCollideCheck(metadata, false);
|
||||
|
||||
if (!canClickBlock) {
|
||||
return 0
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user