broese / mcbuild

A custom Minecraft client with advanced auto-building capabilities
26 stars 11 forks source link

Added get_block_id() and get_number_of_states() #31

Closed harbaughfan closed 5 years ago

harbaughfan commented 5 years ago

get_block_id() returns the default block id for a given blockname. (All blocknames have a default id) get_number_of_states() returns the count of block ids that have the same defaultid as the given block id. defaultid & blockname are a 1-1 correspondence, so this is equivalent to a count of block ids that share a blockname with the given id.

Examples: get_number_of_states(db, 5) = 1 get_number_of_states(db, 8) = 2 get_number_of_states(db, 2913) = 1296 get_block_id(db,"nether_brick_stairs") = 4540 get_block_id(db,"gold_nugget") = -1 (meaning not found) get_number_of_states(db, 8599) = 0 (meaning problem)