From 516830676806e9bd09fb0065683355eee809e0b9 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Thu, 29 Sep 2022 20:47:16 +0700 Subject: [PATCH] what java.lang.IllegalArgumentException: Modifier is already applied on this attribute! at net.minecraft.world.entity.ai.attributes.AttributeInstance.addModifier(AttributeInstance.java:72) ~[forge-1.19.2-43.1.1_mapped_official_1.19.2-recomp.jar%23201!/:?] {re:classloading} at net.minecraft.world.entity.ai.attributes.AttributeInstance.addPermanentModifier(AttributeInstance.java:84) ~[forge-1.19.2-43.1.1_mapped_official_1.19.2-recomp.jar%23201!/:?] {re:classloading} at ru.dbotthepony.mc.otm.android.feature.StepAssistFeature.applyModifiers(StepAssistFeature.kt:21) ~[%23206!/:?] {re:classloading} at ru.dbotthepony.mc.otm.android.feature.StepAssistFeature.sharedTick(StepAssistFeature.kt:41) ~[%23206!/:?] {re:classloading} at ru.dbotthepony.mc.otm.android.feature.StepAssistFeature.tickClient(StepAssistFeature.kt:49) ~[%23206!/:?] {re:classloading} at ru.dbotthepony.mc.otm.capability.MatteryPlayerCapability.tickClient(MatteryPlayerCapability.kt:537) ~[%23206!/:?] {re:classloading} at ru.dbotthepony.mc.otm.capability.MatteryPlayerCapability$Companion.onPlayerTick(MatteryPlayerCapability.kt:697) ~[%23206!/:?] {re:classloading} at net.minecraftforge.eventbus.EventBus.doCastFilter(EventBus.java:260) ~[eventbus-6.0.3.jar%23125!/:?] {} at net.minecraftforge.eventbus.EventBus.lambda$addListener$11(EventBus.java:252) ~[eventbus-6.0.3.jar%23125!/:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:315) ~[eventbus-6.0.3.jar%23125!/:?] {} at net.minecraftforge.eventbus.EventBus.post(EventBus.java:296) ~[eventbus-6.0.3.jar%23125!/:?] {} --- .../dbotthepony/mc/otm/android/feature/StepAssistFeature.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/android/feature/StepAssistFeature.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/android/feature/StepAssistFeature.kt index de268499c..92f3307d8 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/android/feature/StepAssistFeature.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/android/feature/StepAssistFeature.kt @@ -17,7 +17,7 @@ class StepAssistFeature(android: MatteryPlayerCapability) : AndroidSwitchableFea val reach = ply.getAttribute(ForgeMod.STEP_HEIGHT_ADDITION.get()) ?: return - reach.removePermanentModifier(MODIFIER_ID) + reach.removeModifier(MODIFIER_ID) reach.addPermanentModifier(AttributeModifier(MODIFIER_ID, type.displayName.toString(), level + 1.0, AttributeModifier.Operation.ADDITION)) } @@ -25,7 +25,7 @@ class StepAssistFeature(android: MatteryPlayerCapability) : AndroidSwitchableFea if (!ForgeMod.STEP_HEIGHT_ADDITION.isPresent) return - ply.getAttribute(ForgeMod.STEP_HEIGHT_ADDITION.get())?.removePermanentModifier(MODIFIER_ID) + ply.getAttribute(ForgeMod.STEP_HEIGHT_ADDITION.get())?.removeModifier(MODIFIER_ID) } private var isSteppingCarefully = false