feat(core): add piston extend and retract block-pushing mechanics

This commit is contained in:
dualfroz committed 2026-08-24 23:10:55 +02:00
1 parent cff1e80fe8
commit b570bd594e
2 files changed
+127

No files matched your search

+24
View File
@@ -0,0 +1,24 @@
#pragma once
#include <vector>
#include "World.h"
#include "Block.h"
namespace vf {
constexpr int pistonMaxPush = 12;
struct PistonMoveResult {
bool moved = false;
int blocksPushed = 0;
std::vector<Vec3i> destroyed;
};
bool isPistonImmovable(Block b);
bool isPistonFragile(Block b);
bool isPistonBlock(Block b);
PistonMoveResult extendPiston(World& world, const Vec3i& pos, Face facing);
PistonMoveResult retractPiston(World& world, const Vec3i& pos, Face facing);
} // namespace vf