From 4a74d19f58fad20c3243f95d254e9f6d41994950 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Tue, 1 Aug 2023 01:02:17 +0200 Subject: Fixed ConcurrentModificationException at VampireSlayerFeatures --- .../at/hannibal2/skyhanni/features/rift/VampireSlayerFeatures.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/main/java/at/hannibal2/skyhanni/features/rift') diff --git a/src/main/java/at/hannibal2/skyhanni/features/rift/VampireSlayerFeatures.kt b/src/main/java/at/hannibal2/skyhanni/features/rift/VampireSlayerFeatures.kt index c4ab2bac4..f5b85b1ba 100644 --- a/src/main/java/at/hannibal2/skyhanni/features/rift/VampireSlayerFeatures.kt +++ b/src/main/java/at/hannibal2/skyhanni/features/rift/VampireSlayerFeatures.kt @@ -33,7 +33,6 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent import kotlin.time.Duration.Companion.milliseconds object VampireSlayerFeatures { - private val config get() = SkyHanniMod.feature.slayer.vampireSlayerConfig private val configOwnBoss get() = config.ownBoss private val configOtherBoss get() = config.othersBoss @@ -43,7 +42,7 @@ object VampireSlayerFeatures { private val entityList = mutableListOf() private val taggedEntityList = mutableListOf() - private val standList = mutableMapOf() + private var standList = mapOf() private val username get() = LorenzUtils.getPlayerName() private val bloodIchorTexture = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvYzAzNDA5MjNhNmRlNDgyNWExNzY4MTNkMTMzNTAzZWZmMTg2ZGIwODk2ZTMyYjY3MDQ5MjhjMmEyYmY2ODQyMiJ9fX0=" @@ -338,7 +337,7 @@ object VampireSlayerFeatures { fun onWorldChange(event: LorenzWorldChangeEvent) { entityList.clear() taggedEntityList.clear() - standList.clear() + standList = mutableMapOf() } @@ -351,7 +350,7 @@ object VampireSlayerFeatures { if (event.type == EnumParticleTypes.ENCHANTMENT_TABLE) { EntityUtils.getEntitiesNearby(event.location, 3.0).forEach { stand -> if (stand.hasSkullTexture(killerSpringTexture) || stand.hasSkullTexture(bloodIchorTexture)) { - standList[stand] = it + standList = standList.editCopy { this[stand] = it } } } } -- cgit