From 277ee063666d78fc5196497d7162f214bbc4beda Mon Sep 17 00:00:00 2001 From: Taoism DeepLake Date: Thu, 12 May 2022 14:12:59 +0800 Subject: [PATCH] Fix Zhongli shield onhit duration error --- .../java/com/deeplake/genshin12/potion/PotionEventHandler.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/deeplake/genshin12/potion/PotionEventHandler.java b/src/main/java/com/deeplake/genshin12/potion/PotionEventHandler.java index e52be6e..26da021 100644 --- a/src/main/java/com/deeplake/genshin12/potion/PotionEventHandler.java +++ b/src/main/java/com/deeplake/genshin12/potion/PotionEventHandler.java @@ -21,6 +21,7 @@ import java.util.Collection; +import static com.deeplake.genshin12.util.CommonDef.TICK_PER_SECOND; import static net.minecraftforge.fml.common.eventhandler.Event.Result.*; @Mod.EventBusSubscriber(modid = Reference.MOD_ID) @@ -75,7 +76,7 @@ public static void jadeShieldFortify(LivingHurtEvent evt) { //Fortified characters have 5% increased Shield Strength. //Can stack up to 5 times, and lasts until the Jade Shield disappears //Fortify times = 0,1,2,3,4,5 - int dura = hurtOne.getActivePotionEffect(ModPotions.JADE_SHIELD).getDuration(); + float dura = (float) hurtOne.getActivePotionEffect(ModPotions.JADE_SHIELD).getDuration() / TICK_PER_SECOND; EntityUtil.ApplyBuff(hurtOne, ModPotions.JADE_SHIELD, buffLevel, dura);//actually +1 level } }