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
+14 -8
View File
@@ -1212,16 +1212,22 @@ export class GameServer {
}
// solid blocks can't go where a mob or player is, the one placing it included, like minecraft
const placing = EverythingRegistry.get<BlockRegistry>("blocks", held.block_id)!;
const ruled_value = this.mods.rules.placement_value(placing, player.yaw, player.pitch, {
x: tx,
y: ty,
z: tz,
face,
hit: [hit[0], hit[1], hit[2]],
sneaking: player.sneaking,
});
// its rules say it can't go there
if (ruled_value === undefined) {
this.#correct(player, tx, ty, tz);
return;
}
// put into a source of the liquid it can hold, it holds it
const placed_value = waterlog_placement(
this.mods.rules.placement_value(placing, player.yaw, player.pitch, {
x: tx,
y: ty,
z: tz,
face,
hit: [hit[0], hit[1], hit[2]],
sneaking: player.sneaking,
}),
ruled_value,
placing,
this.world.get_block_value(tx, ty, tz),
this.world.get_block_info(tx, ty, tz),