Astral Sorcery

Astral Sorcery

63M Downloads

Discidia Ritual does not damage all hostile mobs

sam-kirby opened this issue ยท 0 comments

commented

Neither the Ghast nor Shulker (or any modded extensions) are harmed by the Discidia ritual.

This is because they do not extend EntityMob, instead implementing IMob directly. The ghast extends EntityFlying, whilst the shulker extends EntityGolem.

I enclose below a possible fix. With this change, the ritual will damage everything that implements IMob either directly or through inheritance.

In addition to the mobs mentioned above, this will enable damaging the dragon (extends EntityLiving, implements IMob). This my not be desirable, and a specific check may need implementing.

diff --git a/src/main/java/hellfirepvp/astralsorcery/common/constellation/effect/aoe/CEffectDiscidia.java b/src/main/java/hellfirepvp/astralsorcery/common/constellation/effect/aoe/CEffectDiscidia.java
index e3e84cc2..bdd127d3 100644
--- a/src/main/java/hellfirepvp/astralsorcery/common/constellation/effect/aoe/CEffectDiscidia.java
+++ b/src/main/java/hellfirepvp/astralsorcery/common/constellation/effect/aoe/CEffectDiscidia.java
@@ -14,7 +14,6 @@ import hellfirepvp.astralsorcery.common.CommonProxy;
 import hellfirepvp.astralsorcery.common.constellation.IMinorConstellation;
 import hellfirepvp.astralsorcery.common.constellation.effect.CEffectEntityCollect;
 import hellfirepvp.astralsorcery.common.constellation.effect.ConstellationEffectProperties;
-import hellfirepvp.astralsorcery.common.entities.EntityTechnicalAmbient;
 import hellfirepvp.astralsorcery.common.lib.Constellations;
 import hellfirepvp.astralsorcery.common.network.PacketChannel;
 import hellfirepvp.astralsorcery.common.network.packet.server.PktParticleEvent;
@@ -24,8 +23,8 @@ import hellfirepvp.astralsorcery.common.util.DamageUtil;
 import hellfirepvp.astralsorcery.common.util.ILocatable;
 import hellfirepvp.astralsorcery.common.util.data.Vector3;
 import net.minecraft.client.Minecraft;
-import net.minecraft.entity.EntityLivingBase;
-import net.minecraft.entity.monster.EntityMob;
+import net.minecraft.entity.EntityLiving;
+import net.minecraft.entity.monster.IMob;
 import net.minecraft.entity.player.EntityPlayer;
 import net.minecraft.init.MobEffects;
 import net.minecraft.potion.PotionEffect;
@@ -47,13 +46,13 @@ import java.util.List;
  * Created by HellFirePvP
  * Date: 07.11.2016 / 22:30
  */
-public class CEffectDiscidia extends CEffectEntityCollect<EntityMob> {
+public class CEffectDiscidia extends CEffectEntityCollect<EntityLiving> {
 
     public static double potencyMultiplier = 1;
     public static float damage = 6.5F;
 
     public CEffectDiscidia(@Nullable ILocatable origin) {
-        super(origin, Constellations.discidia, "discidia", 16D, EntityMob.class, (entity) -> !entity.isDead && !(entity instanceof EntityTechnicalAmbient));
+        super(origin, Constellations.discidia, "discidia", 16D, EntityLiving.class, (entity) -> !entity.isDead && entity instanceof IMob);
     }
 
     @Override
@@ -79,7 +78,7 @@ public class CEffectDiscidia extends CEffectEntityCollect<EntityMob> {
         }
         boolean did = false;
         float actDamageDealt = percStrength * damage;
-        List<EntityMob> entities = collectEntities(world, pos, modified);
+        List<EntityLiving> entities = collectEntities(world, pos, modified);
         if(!entities.isEmpty()) {
             EntityPlayer owner = getOwningPlayerInWorld(world, pos);
             DamageSource dmgSource = owner == null ? CommonProxy.dmgSourceStellar : DamageSourceUtil.withEntityDirect(CommonProxy.dmgSourceStellar, owner);
@@ -87,7 +86,7 @@ public class CEffectDiscidia extends CEffectEntityCollect<EntityMob> {
                 DamageUtil.attackEntityFrom(owner, CommonProxy.dmgSourceStellar, 1.2F * percStrength);
                 did = true;
             }
-            for (EntityMob entity : entities) {
+            for (EntityLiving entity : entities) {
                 if(modified.isCorrupted()) {
                     entity.heal(actDamageDealt);
                     entity.addPotionEffect(new PotionEffect(MobEffects.RESISTANCE, 30, 2));