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
@@ -68,8 +68,8 @@ public class PotionDecay extends Potion {
EntityLivingBase target = event.getEntityLiving();
if(target.isPotionActive(WizardryPotions.decay) && target.ticksExisted % Constants.DECAY_SPREAD_INTERVAL == 0
&& target.onGround){
if(!target.world.isRemote && target.isPotionActive(WizardryPotions.decay) && target.onGround
&& target.ticksExisted % Constants.DECAY_SPREAD_INTERVAL == 0){
List<Entity> entities = target.world.getEntitiesWithinAABBExcludingEntity(target,
target.getEntityBoundingBox());
@@ -80,7 +80,10 @@ public class PotionDecay extends Potion {
// The victim spreading the decay is the 'caster' here, so that it can actually wear off, otherwise it
// just gets infected with its own decay and the effect lasts forever.
target.world.spawnEntity(new EntityDecay(target.world, target.posX, target.posY, target.posZ, target));
EntityDecay decay = new EntityDecay(target.world);
decay.setCaster(target);
decay.setPosition(target.posX, target.posY, target.posZ);
target.world.spawnEntity(decay);
}
}