ctx.blocks.solid(id) api
This commit is contained in:
@@ -75,6 +75,14 @@ there will be holes in the world behind them.
|
||||
A block's definition goes to every player, since clients need it to draw the block, time breaking and collide with it.
|
||||
It can't hold functions.
|
||||
|
||||
### Solid Blocks
|
||||
|
||||
A block is solid when it's drawn in the `solid` layer and entities bump into a whole block in every state: stone,
|
||||
planks, logs and furnaces are, glass, leaves, slabs, chests and fences aren't. Every variant counts, even one that no
|
||||
state shows, and blocks made of `parts` never are. Scripts on every side ask with `ctx.blocks.solid(id)`, which is
|
||||
`false` for air and throws for a block that doesn't exist. It's worked out once per block, so it's cheap enough to ask
|
||||
for every block a walk goes through, unlike `ctx.world.is_face_sturdy`, which looks at the block at a position.
|
||||
|
||||
## Mining
|
||||
|
||||
Breaking takes `mining.toughness` seconds by hand. A tool whose type matches `mining.tool` breaks it `tool.speed` times
|
||||
|
||||
Reference in New Issue
Block a user