Initial 1.11.2 update
This commit is contained in:
@@ -8,12 +8,15 @@ import net.minecraftforge.event.entity.living.LivingAttackEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
|
||||
/** This interface allows {@link MagicDamage} and {@link IndirectMagicDamage} to both be treated as instances of a
|
||||
* single type so that the damage type field can be accessed, rather than having to deal with each of them separately,
|
||||
* which would be inefficient and cumbersome (the latter of those classes cannot extend the former because they both
|
||||
* need to extend different subclasses of {@link net.minecraft.util.DamageSource DamageSource}).
|
||||
/**
|
||||
* This interface allows {@link MagicDamage} and {@link IndirectMagicDamage} to both be treated as instances of a single
|
||||
* type so that the damage type field can be accessed, rather than having to deal with each of them separately, which
|
||||
* would be inefficient and cumbersome (the latter of those classes cannot extend the former because they both need to
|
||||
* extend different subclasses of {@link net.minecraft.util.DamageSource DamageSource}).
|
||||
*
|
||||
* @since Wizardry 1.1
|
||||
* @author Electroblob */
|
||||
* @author Electroblob
|
||||
*/
|
||||
@Mod.EventBusSubscriber
|
||||
public interface IElementalDamage {
|
||||
|
||||
@@ -33,7 +36,8 @@ public interface IElementalDamage {
|
||||
// One convenient side effect of the new damage type system is that I can get rid of all the places where
|
||||
// creepers are charged and just put them here under shock damage - this is precisely the sort of
|
||||
// repetitive code I was trying to get rid of, since errors can (and did!) occur.
|
||||
if(event.getEntityLiving() instanceof EntityCreeper && !((EntityCreeper)event.getEntityLiving()).getPowered()
|
||||
if(event.getEntityLiving() instanceof EntityCreeper
|
||||
&& !((EntityCreeper)event.getEntityLiving()).getPowered()
|
||||
&& ((IElementalDamage)event.getSource()).getType() == DamageType.SHOCK){
|
||||
// Charges creepers when they are hit by shock damage
|
||||
WizardryUtilities.chargeCreeper((EntityCreeper)event.getEntityLiving());
|
||||
|
||||
Reference in New Issue
Block a user