From fe6166fa7d99967e6e1c0e94a0ea7cfb04e44d0c Mon Sep 17 00:00:00 2001 From: "Jared Blackburn (JaredBGreat)" Date: Mon, 2 Sep 2019 15:34:46 -0400 Subject: [PATCH] thoqqua is now immune to suffication, more vulnerable to water --- .../java/com/gw/dm/entity/EntityThoqqua.java | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/main/java/com/gw/dm/entity/EntityThoqqua.java b/src/main/java/com/gw/dm/entity/EntityThoqqua.java index eb97de0..875ab4c 100644 --- a/src/main/java/com/gw/dm/entity/EntityThoqqua.java +++ b/src/main/java/com/gw/dm/entity/EntityThoqqua.java @@ -132,6 +132,10 @@ public void onLivingUpdate() { super.onLivingUpdate(); changeLavaToMagma(false); + + if(inWater) { + damageEntity(DamageSource.DROWN, 1); + } setShitOnFire++; attackTime--; @@ -314,4 +318,28 @@ public void setDead() { } + @Override + public boolean attackEntityFrom(DamageSource source, float amount) { + if(immune(source)) { + return false; + } + return super.attackEntityFrom(source, amount); + } + + + @Override + protected void damageEntity(DamageSource source, float damageAmount) { + if(immune(source)) { + return; + } + super.damageEntity(source, damageAmount); + } + + + private boolean immune(DamageSource source) { + return source.isFireDamage() || (source == DamageSource.LAVA) || + (source == DamageSource.IN_WALL); + } + + }