Skip to content

Commit

Permalink
Fix room matching
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinthegreat1 committed Nov 11, 2023
1 parent bb3ea72 commit 6dffba4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -335,16 +335,11 @@ private boolean checkBlock(ClientWorld world, BlockPos pos) {
if (id == 0) {
return false;
}
for (MutableTriple<Direction, Vector2ic, List<String>> directionRooms : possibleRooms) {
possibleRooms.removeIf(directionRooms -> {
int block = posIdToInt(DungeonMapUtils.actualToRelative(directionRooms.getLeft(), directionRooms.getMiddle(), pos), id);
List<String> possibleDirectionRooms = new ArrayList<>();
for (String room : directionRooms.getRight()) {
if (Arrays.binarySearch(roomsData.get(room), block) >= 0) {
possibleDirectionRooms.add(room);
}
}
directionRooms.setRight(possibleDirectionRooms);
}
directionRooms.getRight().removeIf(room -> Arrays.binarySearch(roomsData.get(room), block) < 0);
return directionRooms.getRight().isEmpty();
});

int matchingRoomsSize = possibleRooms.stream().map(Triple::getRight).mapToInt(Collection::size).sum();
if (matchingRoomsSize == 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2173,7 +2173,7 @@
},
{
"secretName":"3 - Lever 2",
"category":"Lever",
"category":"lever",
"x":31,
"y":53,
"z":24
Expand Down Expand Up @@ -2375,7 +2375,7 @@
},
{
"secretName":"2 - Item",
"category":"Item",
"category":"item",
"x":27,
"y":56,
"z":19
Expand Down

0 comments on commit 6dffba4

Please sign in to comment.