Merge pull request #754 from WinDanesz/patch-1228-2
Remove soulbinding curse effect if the potion is no longer active. fi…
This commit is contained in:
@@ -53,7 +53,7 @@ public class CurseOfSoulbinding extends SpellRay {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean onEntityHit(World world, Entity target, Vec3d hit, EntityLivingBase caster, Vec3d origin, int ticksInUse, SpellModifiers modifiers){
|
protected boolean onEntityHit(World world, Entity target, Vec3d hit, EntityLivingBase caster, Vec3d origin, int ticksInUse, SpellModifiers modifiers){
|
||||||
|
|
||||||
if(EntityUtils.isLiving(target) && caster instanceof EntityPlayer){
|
if(EntityUtils.isLiving(target) && caster instanceof EntityPlayer){
|
||||||
WizardData data = WizardData.get((EntityPlayer)caster);
|
WizardData data = WizardData.get((EntityPlayer)caster);
|
||||||
if(data != null){
|
if(data != null){
|
||||||
@@ -66,7 +66,7 @@ public class CurseOfSoulbinding extends SpellRay {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -79,7 +79,7 @@ public class CurseOfSoulbinding extends SpellRay {
|
|||||||
protected boolean onMiss(World world, EntityLivingBase caster, Vec3d origin, Vec3d direction, int ticksInUse, SpellModifiers modifiers){
|
protected boolean onMiss(World world, EntityLivingBase caster, Vec3d origin, Vec3d direction, int ticksInUse, SpellModifiers modifiers){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void spawnParticle(World world, double x, double y, double z, double vx, double vy, double vz){
|
protected void spawnParticle(World world, double x, double y, double z, double vx, double vy, double vz){
|
||||||
ParticleBuilder.create(Type.DARK_MAGIC).pos(x, y, z).clr(0.4f, 0, 0).spawn(world);
|
ParticleBuilder.create(Type.DARK_MAGIC).pos(x, y, z).clr(0.4f, 0, 0).spawn(world);
|
||||||
@@ -103,9 +103,9 @@ public class CurseOfSoulbinding extends SpellRay {
|
|||||||
|
|
||||||
Entity entity = EntityUtils.getEntityByUUID(player.world, iterator.next());
|
Entity entity = EntityUtils.getEntityByUUID(player.world, iterator.next());
|
||||||
|
|
||||||
if(entity == null) iterator.remove();
|
if (entity == null || (entity instanceof EntityLivingBase && !((EntityLivingBase) entity).isPotionActive(WizardryPotions.curse_of_soulbinding))) {
|
||||||
|
iterator.remove();
|
||||||
if(entity instanceof EntityLivingBase){
|
} else if (entity instanceof EntityLivingBase) {
|
||||||
// Retaliatory effect
|
// Retaliatory effect
|
||||||
if(DamageSafetyChecker.attackEntitySafely(entity, MagicDamage.causeDirectMagicDamage(player,
|
if(DamageSafetyChecker.attackEntitySafely(entity, MagicDamage.causeDirectMagicDamage(player,
|
||||||
MagicDamage.DamageType.MAGIC, true), event.getAmount(), event.getSource().getDamageType(),
|
MagicDamage.DamageType.MAGIC, true), event.getAmount(), event.getSource().getDamageType(),
|
||||||
|
|||||||
Reference in New Issue
Block a user