matpow2 / cuwo

Open server and utilities for Cube World
GNU General Public License v3.0
170 stars 49 forks source link

Access block type from tgen #167

Closed UserXXX closed 9 years ago

UserXXX commented 9 years ago

It seems as if a script is not able to access the type of a block. As far as I see it, a script is only able to access the blocks color tuple and check if the block is solid, what is: something else than empty. It may be useful for some scripts to access the block type (e.g. collision detection, as water is fluid and an entity should be able to move through it). Could you please add a possibility to access it to the tgen.XYProxy?

Btw. a new binary build would be nice.

matpow2 commented 9 years ago

I think my rationale was to make powerful Cython-exposed functions so we wouldn't get much of a performance hit by looking at individual blocks. Or something - it's been a while :-)

Implemented in trunk through XYProxy.get_type. Also, EMPTY_TYPE, WATER_TYPE, etc. have been exposed.