Actually make ward do something... oops :0

This commit is contained in:
Electroblob77
2020-07-27 23:49:20 +01:00
parent e5e01dca88
commit 09cc0a5c34
@@ -298,6 +298,13 @@ public final class WizardryEventHandler {
@SubscribeEvent(priority = EventPriority.LOW) // Again, we don't want these effects if the event is cancelled
public static void onLivingHurtEvent(LivingHurtEvent event){
// Ward
PotionEffect effect = event.getEntityLiving().getActivePotionEffect(WizardryPotions.ward);
if(effect != null && event.getSource().isMagicDamage()){
event.setAmount(event.getAmount() * Math.max(0, 1 - 0.4f * effect.getAmplifier())); // Resistance is 20%
}
// Flaming and freezing swords
if(event.getSource().getTrueSource() instanceof EntityLivingBase){