From 4f339b29b89d36aa87bfe53e2f9145337a0432ab Mon Sep 17 00:00:00 2001 From: CoolJWB Date: Sun, 15 Sep 2019 18:49:24 +0200 Subject: [PATCH] Block death potions (#148) Blocks all known death potions as it's possible to use amplifier 29, 61, 93 and 125 to get the same effect from it. --- .../totalfreedom/totalfreedommod/blocking/PotionBlocker.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/me/totalfreedom/totalfreedommod/blocking/PotionBlocker.java b/src/main/java/me/totalfreedom/totalfreedommod/blocking/PotionBlocker.java index 8fc3bd64..935274c4 100644 --- a/src/main/java/me/totalfreedom/totalfreedommod/blocking/PotionBlocker.java +++ b/src/main/java/me/totalfreedom/totalfreedommod/blocking/PotionBlocker.java @@ -80,7 +80,8 @@ public class PotionBlocker extends FreedomService { for (PotionEffect effect : effects) { - if (effect.getType().equals(PotionEffectType.HEAL) && effect.getAmplifier() == 125) + int amplifier = effect.getAmplifier(); + if (effect.getType().equals(PotionEffectType.HEAL) && (amplifier == 29 || amplifier == 61 || amplifier == 93 || amplifier == 125)) { return true; }