From d81f8d72fa13f418317502b0d24bdaeebd620d86 Mon Sep 17 00:00:00 2001 From: Logan Peterson Date: Sat, 8 May 2021 00:20:07 -0600 Subject: [PATCH] Made exosuit stress sensor trigger from potentially lethal damage that would otherwise never trigger the sensor Please factcheck this, I'm not entirely sure if the amount of damage is accurate taking armor and such into account (cherry picked from commit d7aa2abeff6123f275c8fa5b02aebd3d1ab85309) --- .../vazkii/psi/common/core/handler/PlayerDataHandler.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/vazkii/psi/common/core/handler/PlayerDataHandler.java b/src/main/java/vazkii/psi/common/core/handler/PlayerDataHandler.java index 7647dae9..0c8f0df5 100644 --- a/src/main/java/vazkii/psi/common/core/handler/PlayerDataHandler.java +++ b/src/main/java/vazkii/psi/common/core/handler/PlayerDataHandler.java @@ -179,6 +179,10 @@ public static void onEntityDamage(LivingHurtEvent event) { if (event.getSource().isFireDamage()) { PsiArmorEvent.post(new PsiArmorEvent(player, PsiArmorEvent.ON_FIRE)); } + if (player.getHealth() - event.getAmount() <= 0.0) { + PsiArmorEvent.post(new PsiArmorEvent(player, PsiArmorEvent.LOW_HP)); + PlayerDataHandler.get(player).lowHp = true; + } } }