added pillars game
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user