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

[1.5][SSP] turtle.compareTo() ignores NBT data

Started by digitalseraphim, 16 March 2013 - 12:22 PM
digitalseraphim #1
Posted 16 March 2013 - 01:22 PM
ComputerCraft Version Information: 1.5

Description of Bug: When comparing enchanted books, books enchanted with different enchants returns true

Steps to Reproduce Bug: place book with one enchantment in slot one, place book enchanted with another enchantment in slot two and run the following lua code:

turtle.select(1)
turtle.compare(2)

the last line should return false, but it returns true.
Lyqyd #2
Posted 16 March 2013 - 05:09 PM
Split into new topic.
SuicidalSTDz #3
Posted 16 March 2013 - 05:45 PM
This is not a bug, it is just the way minecaft stores books' data. Each book has the same id, the turtles compare that, not the NBT data. The id for any enchanted book is 403 so when the turtle compares the two, it will return true.
immibis #4
Posted 16 March 2013 - 10:15 PM
This is not a bug, it is just the way minecaft stores books' data. Each book has the same id, the turtles compare that, not the NBT data. The id for any enchanted book is 403 so when the turtle compares the two, it will return true.

You're saying the bug "turtle.compareTo() ignores NBT data" isn't a bug because turtle.compareTo() ignores NBT data?
Not sure what your point is here.
theoriginalbit #5
Posted 16 March 2013 - 10:19 PM
This is not a bug, it is just the way minecaft stores books' data. Each book has the same id, the turtles compare that, not the NBT data. The id for any enchanted book is 403 so when the turtle compares the two, it will return true.

You're saying the bug "turtle.compareTo() ignores NBT data" isn't a bug because turtle.compareTo() ignores NBT data?
Not sure what your point is here.
I think he was trying to make the point that it was a design choice not a bug, since it only compares ID not NBT data…

in response to OP, i think you mean damage value, not NBT as a whole… the books have different damage values. if NBT data was compared, well, that would make for some interesting comparisons (not on books, just with some mod items and such)!
Cloudy #6
Posted 16 March 2013 - 11:43 PM
It isn't a design choice. These things should be comparing NBT.