Doors working with verdigris
This commit is contained in:
+6
-3
@@ -31,14 +31,15 @@ export async function builder(save?: WorldSave) {
|
||||
}
|
||||
t.send(1, { type: "move", x: 0.5, y: 100, z: 0.5, yaw: 0, pitch: 0 });
|
||||
const player = t.game.players()[0];
|
||||
// alice uses id, or whatever she's holding, on face of the block at x y z, from right by it
|
||||
const use = (id: string | undefined, x: number, y: number, z: number, face: Face) => {
|
||||
// alice uses id, or whatever she's holding, on face of the block at x y z, standing on top of it or at stand, out
|
||||
// of the way of a block she can bump into
|
||||
const use = (id: string | undefined, x: number, y: number, z: number, face: Face, stand: Pos = [x, y + 1, z]) => {
|
||||
if (id) {
|
||||
t.send(1, { type: "chat", text: `/give ${id}` });
|
||||
const slot = player.inventory.to_synced_data().findIndex((item) => item?.id === id);
|
||||
t.send(1, { type: "select_slot", slot });
|
||||
}
|
||||
t.game.teleport(player, x + 0.5, y + 1, z + 0.5);
|
||||
t.game.teleport(player, stand[0] + 0.5, stand[1], stand[2] + 0.5);
|
||||
t.send(1, { type: "use_block", x, y, z, face, hit: [0.5, 0.5, 0.5] });
|
||||
};
|
||||
const states = (x: number, y: number, z: number) =>
|
||||
@@ -51,6 +52,8 @@ export async function builder(save?: WorldSave) {
|
||||
get_state: (x, y, z, name) => states(x, y, z)[name],
|
||||
source: (block) =>
|
||||
EverythingRegistry.get<BlockRegistry>("blocks", block)?.components?.["bworld:verdigris_source"] as never,
|
||||
input: (block) =>
|
||||
EverythingRegistry.get<BlockRegistry>("blocks", block)?.components?.["bworld:verdigris_input"] as never,
|
||||
};
|
||||
const covers = (...at: Pos) => FACES.filter((face) => states(...at)[face] === 1);
|
||||
// the wire cells the wire at x y z joins
|
||||
|
||||
Reference in New Issue
Block a user