aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt3
-rw-r--r--src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt2
2 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt b/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt
index 5440c2af8..55b893938 100644
--- a/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt
+++ b/src/main/java/at/hannibal2/skyhanni/features/event/diana/GriffinBurrowHelper.kt
@@ -8,6 +8,7 @@ import at.hannibal2.skyhanni.utils.LocationUtils
import at.hannibal2.skyhanni.utils.LocationUtils.distanceToPlayer
import at.hannibal2.skyhanni.utils.LorenzColor
import at.hannibal2.skyhanni.utils.LorenzUtils
+import at.hannibal2.skyhanni.utils.LorenzUtils.makeSyncMap
import at.hannibal2.skyhanni.utils.LorenzVec
import at.hannibal2.skyhanni.utils.RenderUtils.draw3DLine
import at.hannibal2.skyhanni.utils.RenderUtils.drawColor
@@ -22,7 +23,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent
class GriffinBurrowHelper {
private var guessLocation: LorenzVec? = null
- private var particleBurrows = mutableMapOf<LorenzVec, BurrowType>()
+ private val particleBurrows = makeSyncMap(mutableMapOf<LorenzVec, BurrowType>())
private var animationLocation: LorenzVec? = null
private var lastDug: LorenzVec? = null
private var teleportedLocation: LorenzVec? = null
diff --git a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt
index 84807dcca..fbb0272f6 100644
--- a/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt
+++ b/src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt
@@ -262,4 +262,6 @@ object LorenzUtils {
fun <T> Property<out T>.onToggle(observer: Runnable) {
whenChanged { _, _ -> observer.run() }
}
+
+ fun <K, V> makeSyncMap(originalMap: MutableMap<K, V>) = Collections.synchronizedMap(originalMap)
} \ No newline at end of file