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:
@@ -4,6 +4,7 @@ import java.util.Random;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@@ -375,4 +376,21 @@ public final class ParticleBuilder {
|
||||
entity = null;
|
||||
}
|
||||
|
||||
// Methods for spawning specific effects (similar to the FX playing methods with the ids in RenderGlobal)
|
||||
|
||||
/** Spawns spark and large smoke particles (8 of each) within a 1x1x1 volume centred on the given position. */
|
||||
public static void spawnShockParticles(World world, double x, double y, double z) {
|
||||
double px, py, pz;
|
||||
for(int i=0; i<8; i++){
|
||||
px = x + world.rand.nextDouble() - 0.5;
|
||||
py = y + world.rand.nextDouble() - 0.5;
|
||||
pz = z + world.rand.nextDouble() - 0.5;
|
||||
ParticleBuilder.create(Type.SPARK).pos(px, py, pz).spawn(world);
|
||||
px = x + world.rand.nextDouble() - 0.5;
|
||||
py = y + world.rand.nextDouble() - 0.5;
|
||||
pz = z + world.rand.nextDouble() - 0.5;
|
||||
world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, px, py, pz, 0, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user