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!/:?] {}
This commit is contained in:
DBotThePony 2022-09-29 20:47:16 +07:00
parent 1ee2760a44
commit 5168306768
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -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