Initial 1.11.2 update

This commit is contained in:
Electroblob
2018-02-07 21:15:50 +00:00
parent 67f6be0671
commit 3df5597dcc
368 changed files with 17234 additions and 15082 deletions
@@ -5,45 +5,49 @@ import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.MagicDamage;
import electroblob.wizardry.util.MagicDamage.DamageType;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.MoverType;
import net.minecraft.potion.PotionEffect;
import net.minecraft.world.World;
public class EntityIceSpike extends EntityMagicConstruct {
public EntityIceSpike(World world) {
public EntityIceSpike(World world){
super(world);
this.setSize(0.5f, 1.0f);
}
public EntityIceSpike(World world, double x, double y, double z, EntityLivingBase caster, int lifetime, float damageMultiplier){
public EntityIceSpike(World world, double x, double y, double z, EntityLivingBase caster, int lifetime,
float damageMultiplier){
super(world, x, y, z, caster, lifetime, damageMultiplier);
this.setSize(0.5f, 1.0f);
}
public void onUpdate(){
if(lifetime - this.ticksExisted < 15){
this.motionY = -0.01*(this.ticksExisted-(lifetime-15));
this.motionY = -0.01 * (this.ticksExisted - (lifetime - 15));
}else if(lifetime - this.ticksExisted < 25){
this.motionY = 0;
}else if(lifetime - this.ticksExisted < 28){
this.motionY = 0.25;
}
this.moveEntity(this.motionX, this.motionY, this.motionZ);
this.move(MoverType.SELF, this.motionX, this.motionY, this.motionZ);
if(lifetime - this.ticksExisted == 30) this.playSound(WizardrySounds.SPELL_ICE, 1, 2);
if(!this.worldObj.isRemote){
for(Object entity : this.worldObj.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox())){
if(!this.world.isRemote){
for(Object entity : this.world.getEntitiesWithinAABBExcludingEntity(this, this.getEntityBoundingBox())){
if(entity instanceof EntityLivingBase && this.isValidTarget((EntityLivingBase)entity)){
// Potion effect only gets added if the damage succeeded.
if(((EntityLivingBase)entity).attackEntityFrom(MagicDamage.causeDirectMagicDamage(this.getCaster(), DamageType.FROST), 5*this.damageMultiplier))
if(((EntityLivingBase)entity).attackEntityFrom(
MagicDamage.causeDirectMagicDamage(this.getCaster(), DamageType.FROST),
5 * this.damageMultiplier))
((EntityLivingBase)entity).addPotionEffect(new PotionEffect(WizardryPotions.frost, 100, 0));
}
}
}
super.onUpdate();
}