Improve crops system
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user