added pillars game

This commit is contained in:
2026-01-23 20:26:04 +01:00
parent 325fba2a53
commit 360266339d
5 changed files with 142 additions and 4 deletions

View File

@@ -33,9 +33,15 @@ public class Position {
public static List<Block> blocksBelowPlayer(Instance instance, Player p) {
Point playerPos = p.getPosition();
List<Block> blocks = new ArrayList<>();
GeneratorUtils.foreachXZ(playerPos.sub(0.5, 1, 0.5), playerPos.add(0.5, -1, 0.5), point -> {
blocks.add(instance.getBlock(point));
});
GeneratorUtils.foreachXZ(
playerPos.sub(0.5, 1, 0.5),
playerPos.add(0.5, -1, 0.5),
point -> blocks.add(instance.getBlock(point))
);
return blocks.stream().distinct().toList();
}
public static boolean hasPositionChanged(Pos oldPos, Pos newPos) {
return !oldPos.withView(0, 0).equals(newPos.withView(0, 0));
}
}