Spell hierarchisation and refactoring, plus miscellaneous renaming and minor refactoring

- Adds new generic spell superclasses which aim to group spells such that duplicate code is eliminated, and functions standardised, as much as possible.
- Removes numerous spell classes which are no longer required as a result of this change, and replaces them with instances of the relevant generic spell classes.
- Changes the remaining spell classes to fit with the new system, mostly by having them extend the generic spell classes.
- Completes the transfer of particle spawning to the ParticleBuilder system.
This commit is contained in:
Electroblob
2018-06-20 22:25:54 +01:00
parent b6400c72a7
commit 29261082f1
222 changed files with 4412 additions and 9016 deletions
@@ -5,7 +5,6 @@ import electroblob.wizardry.util.MagicDamage;
import electroblob.wizardry.util.MagicDamage.DamageType;
import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.ParticleBuilder.Type;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.init.SoundEvents;
import net.minecraft.potion.PotionEffect;
@@ -13,40 +12,23 @@ import net.minecraft.world.World;
public class EntityIceLance extends EntityMagicArrow {
/** Basic shell constructor. Should only be used by the client. */
/** Creates a new ice lance in the given world. */
public EntityIceLance(World world){
super(world);
this.setKnockbackStrength(1);
}
/**
* Creates a projectile at position xyz in world, with no motion. Do not create a projectile with this constructor
* and then call setVelocity() as that method is, bizarrely, client-side only.
*/
public EntityIceLance(World world, double x, double y, double z){
super(world, x, y, z);
this.setKnockbackStrength(1);
}
@Override public double getDamage(){ return 10.0d; }
/**
* Creates a projectile at the position of the caster, pointing at the given target. The trajectory seems to be
* altered slightly by a random amount determined by the last parameter. For reference, skeletons set this to 10 on
* easy, 6 on normal and 2 on hard difficulty.
*/
public EntityIceLance(World world, EntityLivingBase caster, Entity target, float speed, float aimingError,
float damageMultiplier){
super(world, caster, target, speed, aimingError, damageMultiplier);
this.setKnockbackStrength(1);
}
@Override public DamageType getDamageType(){ return DamageType.FROST; }
/**
* Creates a projectile pointing in the direction the caster is looking, with the given speed. USE THIS CONSTRUCTOR
* FOR NORMAL SPELLS.
*/
public EntityIceLance(World world, EntityLivingBase caster, float speed, float damageMultiplier){
super(world, caster, speed, damageMultiplier);
this.setKnockbackStrength(1);
}
@Override public boolean doGravity(){ return true; }
@Override public boolean doDeceleration(){ return true; }
@Override public boolean doOverpenetration(){ return true; }
@Override public boolean canRenderOnFire(){ return false; }
@Override
public void onEntityHit(EntityLivingBase entityHit){
@@ -58,11 +40,6 @@ public class EntityIceLance extends EntityMagicArrow {
this.playSound(SoundEvents.ENTITY_GENERIC_HURT, 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F));
}
@Override
public void tickInAir(){
}
@Override
public void onBlockHit(){
// Adds a particle effect when the ice lance hits a block.
@@ -78,43 +55,6 @@ public class EntityIceLance extends EntityMagicArrow {
}
@Override
public void tickInGround(){
this.setDead();
}
@Override
public double getDamage(){
return 10.0d;
}
@Override
public DamageType getDamageType(){
return DamageType.FROST;
}
@Override
public boolean doGravity(){
return true;
}
@Override
public boolean doDeceleration(){
return true;
}
@Override
public boolean doOverpenetration(){
return true;
}
@Override
protected void entityInit(){
}
@Override
public boolean canRenderOnFire(){
return false;
}
protected void entityInit(){}
}