Improve crops system

This commit is contained in:
2026-09-26 18:32:38 -03:00
parent e22f12c0b6
commit 0fa6ec4ed3
15 changed files with 394 additions and 31 deletions
+5
View File
@@ -118,6 +118,11 @@ function compile_block_states(block_info: BlockRegistry) {
});
}
// whether a block can be at a spot with below under it, see place_on
export function can_stand_on(block: BlockRegistry | undefined, below: string): boolean {
return !block?.place_on || block.place_on.includes(below);
}
// numeric so looking chunks up doesnt allocate a string every time, fine for |x|, |z| < 32768
export function chunk_key(x: number, z: number) {
return (x + 32768) * 65536 + (z + 32768);