Cleanup and minor code tweaks

This commit is contained in:
Electroblob
2018-02-24 13:49:27 +00:00
parent 74ddcd79ca
commit 76d4e3d029
3 changed files with 11 additions and 14 deletions
@@ -58,8 +58,8 @@ public class MindControl extends Spell {
if(!world.isRemote){
if(!canControl(target)){
// Adds a message saying that the player/boss entity/wizard resisted mind control
if(!world.isRemote) caster.sendMessage(new TextComponentTranslation("spell.resist",
target.getName(), this.getNameForTranslationFormatted()));
caster.sendMessage(new TextComponentTranslation("spell.resist", target.getName(),
this.getNameForTranslationFormatted()));
}else if(target instanceof EntityLiving){
@@ -57,11 +57,11 @@ public class ShadowWard extends Spell {
&& !(event.getSource() instanceof IElementalDamage && ((IElementalDamage)event.getSource()).isRetaliatory())){
event.setCanceled(true);
// Now we can preserve the original daage source (sort of) as long as we make it retaliatory.
// Now we can preserve the original damage source (sort of) as long as we make it retaliatory.
event.getEntityLiving().attackEntityFrom(
MagicDamage.causeDirectMagicDamage(event.getSource().getTrueSource(), DamageType.MAGIC, true), event.getAmount() / 2);
((EntityLivingBase)event.getSource().getTrueSource())
.attackEntityFrom(MagicDamage.causeDirectMagicDamage(event.getEntityLiving(), DamageType.MAGIC, true), event.getAmount() / 2);
MagicDamage.causeDirectMagicDamage(event.getSource().getTrueSource(), DamageType.MAGIC, true), event.getAmount() * 0.5f);
((EntityLivingBase)event.getSource().getTrueSource()).attackEntityFrom(
MagicDamage.causeDirectMagicDamage(event.getEntityLiving(), DamageType.MAGIC, true), event.getAmount() * 0.5f);
}
}
}
@@ -81,10 +81,9 @@ public class MagicDamage extends EntityDamageSource implements IElementalDamage
public enum DamageType {
/** Generic magic damage from the wizardry mod. Like vanilla magic damage, except it doesn't bypass armour. */
MAGIC,
/**
* Fire damage from the wizardry mod. Counts as fire damage in the vanilla system, so is blocked by any mobs
* that are immune to fire and entities with the fire resistance effect.
*/
/** Fire damage from the wizardry mod. Counts as fire damage in the vanilla system, so is blocked by any mobs
* that are immune to fire and entities with the fire resistance effect, and is affected by the fire protection
* enchantment. */
FIRE,
/** Frost (ice) damage from the wizardry mod. Snow golems, ice wraiths and ice giants are immune. */
FROST,
@@ -94,13 +93,11 @@ public class MagicDamage extends EntityDamageSource implements IElementalDamage
WITHER,
/** Poison damage from the wizardry mod. Spiders, cave spiders and undead mobs are immune. */
POISON,
/**
* [NYI] Force damage from the wizardry mod. Insubstantial creatures (ghast, shadow wraith, etc.) are immune.
*/
/** Force damage from the wizardry mod. */ // Insubstantial creatures (ghast, shadow wraith, etc.) are immune?
FORCE,
/** Blast damage from the wizardry mod. Affected by the blast protection enchantment. */
BLAST,
/** [NYI] Radiant damage from the wizardry mod. */
/** Radiant damage from the wizardry mod. */
RADIANT;
}