Cog wheels

This commit is contained in:
2026-10-15 12:01:46 -03:00
parent a0596ed0ef
commit 74c315bdfc
14 changed files with 331 additions and 88 deletions
+3 -2
View File
@@ -125,8 +125,9 @@ export interface BlockInteraction {
// deno-lint-ignore no-explicit-any
export interface BlockRules<P = any> {
// the states it's placed with when a player places it, like minecraft's getStateForPlacement. states it doesn't
// return keep their defaults, and a 2 bit "facing" faces the player
state_for_placement?(placement: BlockPlacement, params: P): Record<string, number> | void;
// return keep their defaults, and a 2 bit "facing" faces the player. false when it can't go there, so it isn't
// placed, like getStateForPlacement returning null
state_for_placement?(placement: BlockPlacement, params: P): Record<string, number> | false | void;
// a block next to it (on any of the 6 sides) was placed, broken or changed its states, like minecraft's
// updateShape. neighbor is where, and what's there now
on_neighbor_change?(block: SharedBlock, params: P, neighbor: SharedBlock): void;