Hand crank and shafts
This commit is contained in:
@@ -66,6 +66,13 @@ export interface SharedContext {
|
||||
// the world rules look at and change. on a client it's what that client sees, and what rules change there is a
|
||||
// guess until the server says what really happened. only for use in rules, not during setup
|
||||
readonly world: SharedWorld;
|
||||
// every block any mod registered, like the server's and clients' ctx.blocks. for rules that look at what's around,
|
||||
// like a shaft lining up with the axle of the block it's placed against
|
||||
readonly blocks: {
|
||||
exists(id: Id): boolean;
|
||||
// the components its json lists and their params, a copy
|
||||
components(id: Id): Record<Id, unknown>;
|
||||
};
|
||||
readonly components: {
|
||||
// the rules of a block component, the same id the server script registers the rest of it under
|
||||
// deno-lint-ignore no-explicit-any
|
||||
@@ -93,12 +100,14 @@ export interface SharedBlock extends Position {
|
||||
}
|
||||
|
||||
// a player placing a block at x y z by clicking face of the block next to it, at hit (0 to 1 on each axis of that
|
||||
// block), like minecraft's BlockPlaceContext. facing is the way the player looks, along the ground, and sneaking
|
||||
// whether they hold the sneak key, for blocks placed another way round when they do
|
||||
// block), like minecraft's BlockPlaceContext. facing is the way the player looks along the ground, and looking the face
|
||||
// of the six they look most toward, up and down too, like getNearestLookingDirection. sneaking is whether they hold the
|
||||
// sneak key, for blocks placed another way round when they do
|
||||
export interface BlockPlacement extends Position {
|
||||
readonly face: Face;
|
||||
readonly hit: readonly [number, number, number];
|
||||
readonly facing: "north" | "east" | "south" | "west";
|
||||
readonly looking: Face;
|
||||
readonly sneaking: boolean;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user