Skip to content

Commit

Permalink
Add sync when clearing matchState (#471)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinthegreat1 authored Jan 11, 2024
1 parent f0ba19e commit ce5f472
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ protected boolean checkBlock(ClientWorld world, BlockPos pos) {
}

int matchingRoomsSize = possibleRooms.stream().map(Triple::getRight).mapToInt(Collection::size).sum();
if (matchingRoomsSize == 0) {
if (matchingRoomsSize == 0) synchronized (this) {
// If no rooms match, reset the fields and scan again after 50 ticks.
matchState = MatchState.FAILED;
DungeonManager.LOGGER.warn("[Skyblocker Dungeon Secrets] No dungeon room matched after checking {} block(s) including double checking {} block(s)", checkedBlocks.size(), doubleCheckBlocks);
Expand Down Expand Up @@ -524,10 +524,12 @@ public void render(WorldRenderContext context) {
renderable.render(context);
}

if (SkyblockerConfigManager.get().locations.dungeons.secretWaypoints.enableSecretWaypoints && isMatched()) {
for (SecretWaypoint secretWaypoint : secretWaypoints.values()) {
if (secretWaypoint.shouldRender()) {
secretWaypoint.render(context);
synchronized (this) {
if (SkyblockerConfigManager.get().locations.dungeons.secretWaypoints.enableSecretWaypoints && isMatched()) {
for (SecretWaypoint secretWaypoint : secretWaypoints.values()) {
if (secretWaypoint.shouldRender()) {
secretWaypoint.render(context);
}
}
}
}
Expand Down

0 comments on commit ce5f472

Please sign in to comment.