This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Mucaro's profile picture

turtle.compare() does not detect wood blocks placed sideways

Started by Mucaro, 24 May 2013 - 10:27 PM
Mucaro #1
Posted 25 May 2013 - 12:27 AM
ComputerCraft Version Information:
1.52 & 1.53 Multiplayer (Single player not tested yet)

Description of Bug:
When using turtle.compare() to detect if the block in front of the turtle matches a wood block in one of its first 4 slots, turtle.compare() will fail to detect a match if the wood block in front of the turtle was placed sideways.

Steps to Reproduce Bug:
1) Put three wood blocks (I saw the problem with oak and birch, didn't test the other woods) in line, one standing up and the others on the two sideway orientations (facing north to south or east to west).
2) Place a turtle facing one of the wood blocks.
3) Put a wood block of the same type in slot 1 of the turtle.
4) Write and run a little program to select slot 1 (turtle.select(1)) and then detect if there is a match (turtle.compare()).
5) Repeat steps 2 to 4 until all three wood blocks have been tested.

Doing this will return a match only for the vertical wood block.
Engineer #2
Posted 25 May 2013 - 08:59 PM
That is because I think a wood log sideways has an other ID then the woodblock.

Im going to look it up…. Hmm.. Cant seem to find it in the MC source (I admit that I was not really digging)
But Im pretty sure it has an other damage value.
Lyqyd #3
Posted 25 May 2013 - 09:23 PM
Yeah, the metadata is different, and turtles look at metadata as well when using compare(). It'll be fixed eventually.