diff options
author | Kevin <92656833+kevinthegreat1@users.noreply.github.com> | 2024-01-11 11:54:11 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-10 22:54:11 -0500 |
commit | ce5f4723e0a8ea636011d7a34a2c0cc00057e686 (patch) | |
tree | b1b50e1ced56d46600086d5843939c965bef31d4 | |
parent | f0ba19e58c73b16e68da10c1599db72cbd0d8764 (diff) | |
download | Skyblocker-ce5f4723e0a8ea636011d7a34a2c0cc00057e686.tar.gz Skyblocker-ce5f4723e0a8ea636011d7a34a2c0cc00057e686.tar.bz2 Skyblocker-ce5f4723e0a8ea636011d7a34a2c0cc00057e686.zip |
Add sync when clearing matchState (#471)
-rw-r--r-- | src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java index 3e25a8f1..a1bafc20 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/Room.java @@ -408,7 +408,7 @@ public class Room implements Tickable, Renderable { } 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); @@ -524,10 +524,12 @@ public class Room implements Tickable, Renderable { 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); + } } } } |