The great particle refactoring part 1: Introducing ParticleBuilder!

Adds ParticleBuilder to replace the particle spawning methods in the proxies, and changes all particle spawning to use the builder except for in the spell classes, which are to be reorganised first.
This commit is contained in:
Electroblob
2018-06-05 21:13:41 +01:00
parent 466b3bbc27
commit d91a3e056a
119 changed files with 722 additions and 972 deletions
@@ -1,5 +1,6 @@
package electroblob.wizardry; package electroblob.wizardry;
import electroblob.wizardry.client.particle.ParticleWizardry;
import electroblob.wizardry.item.ItemSpectralBow; import electroblob.wizardry.item.ItemSpectralBow;
import electroblob.wizardry.packet.PacketCastContinuousSpell; import electroblob.wizardry.packet.PacketCastContinuousSpell;
import electroblob.wizardry.packet.PacketCastSpell; import electroblob.wizardry.packet.PacketCastSpell;
@@ -11,7 +12,7 @@ import electroblob.wizardry.packet.PacketTransportation;
import electroblob.wizardry.registry.Spells; import electroblob.wizardry.registry.Spells;
import electroblob.wizardry.registry.WizardryItems; import electroblob.wizardry.registry.WizardryItems;
import electroblob.wizardry.spell.Spell; import electroblob.wizardry.spell.Spell;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@@ -56,76 +57,21 @@ public class CommonProxy {
// SECTION Particles // SECTION Particles
// =============================================================================================================== // ===============================================================================================================
/** /** Called from init() in the main mod class to initialise the particle factories. */
* Spawns a custom particle of the specified type. public void initParticleFactories(){} // Does nothing since particles are client-side only
*
* @param type EnumParticleType of the particle
* @param world Reference to the World object
* @param x Particle x position
* @param y Particle y position
* @param z Particle z position
* @param velX Particle x velocity
* @param velY Particle y velocity
* @param velZ Particle z velocity
* @param maxAge Lifetime of the particle in ticks
* @param r Red component of particle colour; will be clamped to between 0 and 1
* @param g Red component of particle colour; will be clamped to between 0 and 1
* @param b Red component of particle colour; will be clamped to between 0 and 1
* @param doGravity Whether the particle is affected by gravity (only affects SPARKLE at the moment)
* @param radius The radius of the particle's motion, for cirular motion particles
*/
public void spawnParticle(WizardryParticleType type, World world, double x, double y, double z, double velX,
double velY, double velZ, int maxAge, float r, float g, float b, boolean doGravity, double radius){
// Does nothing since particles are client-side only
}
/** /** Creates a new particle of the specified type from the appropriate particle factory. <i>Does not actually spawn the
* Spawns a custom particle of the specified type. doGravity defaults to false and radius defaults to 0. Note that * particle; use {@link electroblob.wizardry.util.ParticleBuilder ParticleBuilder} to spawn particles.</i> */
* some of these settings may not affect the particle; some particles are always affected by gravity, for instance. public ParticleWizardry createParticle(Type type, World world, double x, double y, double z){
* return null;
* @param type EnumParticleType of the particle
* @param world Reference to the World object
* @param x Particle x position
* @param y Particle y position
* @param z Particle z position
* @param velX Particle x velocity
* @param velY Particle y velocity
* @param velZ Particle z velocity
* @param maxAge Lifetime of the particle in ticks
* @param r Red component of particle colour; will be clamped to between 0 and 1 (unless this is a MAGIC_FIRE
* particle, in which case this is the scale)
* @param g Red component of particle colour; will be clamped to between 0 and 1
* @param b Red component of particle colour; will be clamped to between 0 and 1
*/
public void spawnParticle(WizardryParticleType type, World world, double x, double y, double z, double velX,
double velY, double velZ, int maxAge, float r, float g, float b){
this.spawnParticle(type, world, x, y, z, velX, velY, velZ, maxAge, r, g, b, false, 0);
}
/**
* Spawns a custom particle of the specified type. Colour defaults to white, doGravity defaults to false and radius
* defaults to 0. Note that some of these settings may not affect the particle; some particles are always affected
* by gravity, for instance.
*
* @param type EnumParticleType of the particle
* @param world Reference to the World object
* @param x Particle x position
* @param y Particle y position
* @param z Particle z position
* @param velX Particle x velocity
* @param velY Particle y velocity
* @param velZ Particle z velocity
* @param maxAge Lifetime of the particle in ticks
*/
public void spawnParticle(WizardryParticleType type, World world, double x, double y, double z, double velX,
double velY, double velZ, int maxAge){
this.spawnParticle(type, world, x, y, z, velX, velY, velZ, maxAge, 1, 1, 1, false, 0);
} }
public void spawnTornadoParticle(World world, double x, double y, double z, double velX, double velZ, double radius, public void spawnTornadoParticle(World world, double x, double y, double z, double velX, double velZ, double radius,
int maxAge, IBlockState block, BlockPos pos){ int maxAge, IBlockState block, BlockPos pos){
} }
public void spawnEntityParticle(World world, Entity entity, int maxAge, float r, float g, float b){}
// SECTION Items // SECTION Items
// =============================================================================================================== // ===============================================================================================================
@@ -156,6 +156,7 @@ public class Wizardry {
WizardryPacketHandler.initPackets(); WizardryPacketHandler.initPackets();
proxy.initGuiBits(); proxy.initGuiBits();
proxy.initParticleFactories();
} }
@EventHandler @EventHandler
@@ -20,9 +20,10 @@ import electroblob.wizardry.spell.Spell;
import electroblob.wizardry.util.IElementalDamage; import electroblob.wizardry.util.IElementalDamage;
import electroblob.wizardry.util.MagicDamage; import electroblob.wizardry.util.MagicDamage;
import electroblob.wizardry.util.MagicDamage.DamageType; import electroblob.wizardry.util.MagicDamage.DamageType;
import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WandHelper; import electroblob.wizardry.util.WandHelper;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
@@ -213,10 +214,9 @@ public final class WizardryEventHandler {
world.spawnEntity(arc); world.spawnEntity(arc);
}else{ }else{
for(int i = 0; i < 8; i++){ for(int i = 0; i < 8; i++){
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world, ParticleBuilder.create(Type.SPARK).pos(attacker.posX + world.rand.nextFloat() - 0.5,
attacker.posX + world.rand.nextFloat() - 0.5, attacker.getEntityBoundingBox().minY attacker.getEntityBoundingBox().minY + attacker.height / 2 + world.rand.nextFloat() * 2 - 1,
+ attacker.height / 2 + world.rand.nextFloat() * 2 - 1, attacker.posZ + world.rand.nextFloat() - 0.5).spawn(world);
attacker.posZ + world.rand.nextFloat() - 0.5, 0, 0, 0, 3);
world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, attacker.posX + world.rand.nextFloat() - 0.5, world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, attacker.posX + world.rand.nextFloat() - 0.5,
attacker.getEntityBoundingBox().minY + attacker.height / 2 + world.rand.nextFloat() * 2 attacker.getEntityBoundingBox().minY + attacker.height / 2 + world.rand.nextFloat() * 2
- 1, - 1,
@@ -2,9 +2,9 @@ package electroblob.wizardry.block;
import java.util.Random; import java.util.Random;
import electroblob.wizardry.Wizardry;
import electroblob.wizardry.registry.WizardryBlocks; import electroblob.wizardry.registry.WizardryBlocks;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.ParticleBuilder.Type;
import net.minecraft.block.BlockBush; import net.minecraft.block.BlockBush;
import net.minecraft.block.SoundType; import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
@@ -41,10 +41,10 @@ public class BlockCrystalFlower extends BlockBush {
@Override @Override
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random random){ public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random random){
if(world.isRemote && random.nextBoolean()){ if(world.isRemote && random.nextBoolean()){
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, pos.getX() + random.nextDouble(), ParticleBuilder.create(Type.SPARKLE)
pos.getY() + random.nextDouble() / 2 + 0.5, pos.getZ() + random.nextDouble(), 0d, 0.01, 0d, .pos(pos.getX() + random.nextDouble(), pos.getY() + random.nextDouble() / 2 + 0.5, pos.getZ() + random.nextDouble()).vel(0, 0.01, 0)
20 + random.nextInt(10), 0.5f + (random.nextFloat() / 2), 0.5f + (random.nextFloat() / 2), .lifetime(20 + random.nextInt(10)).colour(0.5f + (random.nextFloat() / 2), 0.5f + (random.nextFloat() / 2),
0.5f + (random.nextFloat() / 2)); 0.5f + (random.nextFloat() / 2)).spawn(world);
} }
} }
@@ -61,18 +61,22 @@ public class BlockSpectral extends BlockContainer {
@Override @Override
public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random random){ public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random random){
// Middle of block // Middle of block
Wizardry.proxy.spawnParticle(WizardryParticleType.DUST, world, pos.getX() + random.nextDouble(), ParticleBuilder.create(Type.DUST)
pos.getY() + random.nextDouble(), pos.getZ() + random.nextDouble(), 0, 0, 0, .pos(pos.getX() + random.nextDouble(), pos.getY() + random.nextDouble(), pos.getZ() + random.nextDouble())
(int)(16.0D / (Math.random() * 0.8D + 0.2D)), 0.4f + random.nextFloat() * 0.2f, .lifetime((int)(16.0D / (Math.random() * 0.8D + 0.2D)))
0.6f + random.nextFloat() * 0.4f, 0.6f + random.nextFloat() * 0.4f); .colour(0.4f + random.nextFloat() * 0.2f, 0.6f + random.nextFloat() * 0.4f, 0.6f + random.nextFloat() * 0.4f)
.shaded(true).spawn(world);
// Top surface // Top surface
Wizardry.proxy.spawnParticle(WizardryParticleType.DUST, world, pos.getX() + random.nextDouble(), pos.getY() + 1, for(int i=0; i<2; i++){
pos.getZ() + random.nextDouble(), 0, 0, 0, (int)(16.0D / (Math.random() * 0.8D + 0.2D)), ParticleBuilder.create(Type.DUST)
0.4f + random.nextFloat() * 0.2f, 0.6f + random.nextFloat() * 0.4f, 0.6f + random.nextFloat() * 0.4f); .pos(pos.getX() + random.nextDouble(), pos.getY() + 1, pos.getZ() + random.nextDouble())
Wizardry.proxy.spawnParticle(WizardryParticleType.DUST, world, pos.getX() + random.nextDouble(), pos.getY() + 1, .lifetime((int)(16.0D / (Math.random() * 0.8D + 0.2D)))
pos.getZ() + random.nextDouble(), 0, 0, 0, (int)(16.0D / (Math.random() * 0.8D + 0.2D)), .colour(0.4f + random.nextFloat() * 0.2f, 0.6f + random.nextFloat() * 0.4f, 0.6f + random.nextFloat() * 0.4f)
0.4f + random.nextFloat() * 0.2f, 0.6f + random.nextFloat() * 0.4f, 0.6f + random.nextFloat() * 0.4f); .shaded(true).spawn(world);
}
} }
// Overriden to make the block always look full brightness despite not emitting // Overriden to make the block always look full brightness despite not emitting
@@ -2,6 +2,7 @@ package electroblob.wizardry.client;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map;
import org.lwjgl.input.Keyboard; import org.lwjgl.input.Keyboard;
@@ -11,11 +12,13 @@ import electroblob.wizardry.WizardData;
import electroblob.wizardry.Wizardry; import electroblob.wizardry.Wizardry;
import electroblob.wizardry.client.model.ModelWizardArmour; import electroblob.wizardry.client.model.ModelWizardArmour;
import electroblob.wizardry.client.particle.ParticleBlizzard; import electroblob.wizardry.client.particle.ParticleBlizzard;
import electroblob.wizardry.client.particle.ParticleBuff;
import electroblob.wizardry.client.particle.ParticleDarkMagic; import electroblob.wizardry.client.particle.ParticleDarkMagic;
import electroblob.wizardry.client.particle.ParticleDust; import electroblob.wizardry.client.particle.ParticleDust;
import electroblob.wizardry.client.particle.ParticleGiantBubble; import electroblob.wizardry.client.particle.ParticleFlash;
import electroblob.wizardry.client.particle.ParticleIce; import electroblob.wizardry.client.particle.ParticleIce;
import electroblob.wizardry.client.particle.ParticleLeaf; import electroblob.wizardry.client.particle.ParticleLeaf;
import electroblob.wizardry.client.particle.ParticleMagicBubble;
import electroblob.wizardry.client.particle.ParticleMagicFlame; import electroblob.wizardry.client.particle.ParticleMagicFlame;
import electroblob.wizardry.client.particle.ParticlePath; import electroblob.wizardry.client.particle.ParticlePath;
import electroblob.wizardry.client.particle.ParticleRotatingSparkle; import electroblob.wizardry.client.particle.ParticleRotatingSparkle;
@@ -23,6 +26,8 @@ import electroblob.wizardry.client.particle.ParticleSnow;
import electroblob.wizardry.client.particle.ParticleSpark; import electroblob.wizardry.client.particle.ParticleSpark;
import electroblob.wizardry.client.particle.ParticleSparkle; import electroblob.wizardry.client.particle.ParticleSparkle;
import electroblob.wizardry.client.particle.ParticleTornado; import electroblob.wizardry.client.particle.ParticleTornado;
import electroblob.wizardry.client.particle.ParticleWizardry;
import electroblob.wizardry.client.particle.ParticleWizardry.IWizardryParticleFactory;
import electroblob.wizardry.client.renderer.LayerStone; import electroblob.wizardry.client.renderer.LayerStone;
import electroblob.wizardry.client.renderer.RenderArc; import electroblob.wizardry.client.renderer.RenderArc;
import electroblob.wizardry.client.renderer.RenderArcaneWorkbench; import electroblob.wizardry.client.renderer.RenderArcaneWorkbench;
@@ -114,8 +119,9 @@ import electroblob.wizardry.spell.Spell;
import electroblob.wizardry.tileentity.TileEntityArcaneWorkbench; import electroblob.wizardry.tileentity.TileEntityArcaneWorkbench;
import electroblob.wizardry.tileentity.TileEntityMagicLight; import electroblob.wizardry.tileentity.TileEntityMagicLight;
import electroblob.wizardry.tileentity.TileEntityStatue; import electroblob.wizardry.tileentity.TileEntityStatue;
import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WandHelper; import electroblob.wizardry.util.WandHelper;
import electroblob.wizardry.util.WizardryParticleType;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.FontRenderer;
@@ -135,7 +141,6 @@ import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.SoundEvent; import net.minecraft.util.SoundEvent;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.config.Property; import net.minecraftforge.common.config.Property;
@@ -154,6 +159,9 @@ public class ClientProxy extends CommonProxy {
/** Static instance of the mixed font renderer */ /** Static instance of the mixed font renderer */
public static MixedFontRenderer mixedFontRenderer; public static MixedFontRenderer mixedFontRenderer;
/** Static particle factory map */
private static Map<Type, IWizardryParticleFactory> factories;
// Key Bindings // Key Bindings
public static final KeyBinding NEXT_SPELL = new KeyBinding("key." + Wizardry.MODID + ".next_spell", Keyboard.KEY_N, "key.categories." + Wizardry.MODID); public static final KeyBinding NEXT_SPELL = new KeyBinding("key." + Wizardry.MODID + ".next_spell", Keyboard.KEY_N, "key.categories." + Wizardry.MODID);
public static final KeyBinding PREVIOUS_SPELL = new KeyBinding("key." + Wizardry.MODID + ".previous_spell", Keyboard.KEY_B, "key.categories." + Wizardry.MODID); public static final KeyBinding PREVIOUS_SPELL = new KeyBinding("key." + Wizardry.MODID + ".previous_spell", Keyboard.KEY_B, "key.categories." + Wizardry.MODID);
@@ -265,67 +273,44 @@ public class ClientProxy extends CommonProxy {
// =============================================================================================================== // ===============================================================================================================
@Override @Override
public void spawnParticle(WizardryParticleType type, World world, double x, double y, double z, double velX, double velY, double velZ, int maxAge, public void initParticleFactories(){
float r, float g, float b, boolean doGravity, double radius){
// Colour values are now automatically clamped to between 0 and 1, as values outside this range seem to factories = new HashMap<>();
// cause strange effects in 1.10 (or more specifically, particles that are bright pink!)
// TODO: This is a terrible dirty fix, but it'll do for now. Find a nicer way in future.
if(type != WizardryParticleType.MAGIC_FIRE) r = MathHelper.clamp(r, 0, 1);
g = MathHelper.clamp(g, 0, 1);
b = MathHelper.clamp(b, 0, 1);
switch(type){ factories.put(Type.BLIZZARD, (world, x, y, z) -> new ParticleBlizzard(world, x, y, z));
factories.put(Type.DARK_MAGIC, (world, x, y, z) -> new ParticleDarkMagic(world, x, y, z));
factories.put(Type.DUST, (world, x, y, z) -> new ParticleDust(world, x, y, z));
factories.put(Type.FLASH, (world, x, y, z) -> new ParticleFlash(world, x, y, z));
factories.put(Type.ICE, (world, x, y, z) -> new ParticleIce(world, x, y, z));
factories.put(Type.LEAF, (world, x, y, z) -> new ParticleLeaf(world, x, y, z));
factories.put(Type.MAGIC_BUBBLE, (world, x, y, z) -> new ParticleMagicBubble(world, x, y, z));
factories.put(Type.MAGIC_FIRE, (world, x, y, z) -> new ParticleMagicFlame(world, x, y, z));
factories.put(Type.PATH, (world, x, y, z) -> new ParticlePath(world, x, y, z));
factories.put(Type.SNOW, (world, x, y, z) -> new ParticleSnow(world, x, y, z));
factories.put(Type.SPARK, (world, x, y, z) -> new ParticleSpark(world, x, y, z));
factories.put(Type.SPARKLE, (world, x, y, z) -> new ParticleSparkle(world, x, y, z));
factories.put(Type.SPARKLE_ROTATING, (world, x, y, z) -> new ParticleRotatingSparkle(world, x, y, z));
}
case BLIZZARD: @Override
Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleBlizzard(world, maxAge, x, z, radius, y)); public ParticleWizardry createParticle(Type type, World world, double x, double y, double z){
break; IWizardryParticleFactory factory = factories.get(type);
case BRIGHT_DUST: if(factory == null){
Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleDust(world, x, y, z, velX, velY, velZ, r, g, b, false)); Wizardry.logger.warn("Unrecognised particle type %s! Ensure the particle is properly registered.", type);
break; return null;
case DARK_MAGIC:
Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleDarkMagic(world, x, y, z, velX, velY, velZ, r, g, b));
break;
case DUST:
Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleDust(world, x, y, z, velX, velY, velZ, r, g, b, true));
break;
case ICE:
Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleIce(world, x, y, z, velX, velY, velZ, maxAge));
break;
case LEAF:
Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleLeaf(world, x, y, z, velX, velY, velZ, maxAge));
break;
case MAGIC_BUBBLE:
Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleGiantBubble(world, x, y, z, velX, velY, velZ));
break;
case MAGIC_FIRE:
Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleMagicFlame(world, x, y, z, velX, velY, velZ, maxAge, r == 0 ? 1 + world.rand.nextFloat() : r));
break;
case PATH:
Minecraft.getMinecraft().effectRenderer.addEffect(new ParticlePath(world, x, y, z, velX, velY, velZ, r, g, b, maxAge));
break;
case SNOW:
Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleSnow(world, x, y, z, velX, velY, velZ));
break;
case SPARK:
Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleSpark(world, x, y, z, velX, velY, velZ));
break;
case SPARKLE:
Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleSparkle(world, x, y, z, velX, velY, velZ, r, g, b, maxAge, doGravity));
break;
case SPARKLE_ROTATING:
Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleRotatingSparkle(world, maxAge, x, z, radius, y, r, g, b));
break;
default:
break;
} }
return factory.createParticle(world, x, y, z);
} }
@Override @Override
public void spawnTornadoParticle(World world, double x, double y, double z, double velX, double velZ, double radius, int maxAge, public void spawnTornadoParticle(World world, double x, double y, double z, double velX, double velZ, double radius, int maxAge,
IBlockState block, BlockPos pos){ IBlockState block, BlockPos pos){
Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleTornado(world, maxAge, x, z, radius, y, velX, velZ, block).setBlockPos(pos));// , Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleTornado(world, maxAge, x, z, radius, y, velX, velZ, block).setBlockPos(pos));// , world.rand.nextInt(6)));
// world.rand.nextInt(6))); }
@Override
public void spawnEntityParticle(World world, Entity entity, int maxAge, float r, float g, float b){
Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleBuff(world, entity, maxAge, r, g, b, world.rand.nextBoolean()));
} }
// SECTION Packet Handlers // SECTION Packet Handlers
@@ -431,8 +416,8 @@ public class ClientProxy extends CommonProxy {
double x = caster.posX + radius * Math.cos(angle); double x = caster.posX + radius * Math.cos(angle);
double y = caster.getEntityBoundingBox().minY + world.rand.nextDouble() * 2; double y = caster.getEntityBoundingBox().minY + world.rand.nextDouble() * 2;
double z = caster.posZ + radius * Math.sin(angle); double z = caster.posZ + radius * Math.sin(angle);
Minecraft.getMinecraft().effectRenderer ParticleBuilder.create(Type.SPARKLE).pos(x, y, z).vel(0, 0.02, 0).colour(0.6f, 1, 0.6f)
.addEffect(new ParticleSparkle(world, x, y, z, 0, 0.02, 0, 0.6f, 1.0f, 0.6f, 80 + world.rand.nextInt(10))); .lifetime(80 + world.rand.nextInt(10)).spawn(world);
} }
for(int i = 0; i < 20; i++){ for(int i = 0; i < 20; i++){
double radius = 1; double radius = 1;
@@ -11,15 +11,14 @@ public class ParticleBlizzard extends ParticleSnow {
private double radius; private double radius;
private double speed; private double speed;
public ParticleBlizzard(World world, int maxAge, double originX, double originZ, double radius, double yPos){ public ParticleBlizzard(World world, double ox, double y, double oz){
super(world, 0, 0, 0, 0, 0, 0, maxAge); super(world, ox, y, oz);
this.angle = this.rand.nextDouble() * Math.PI * 2; this.angle = this.rand.nextDouble() * Math.PI * 2;
double x = originX - Math.cos(angle) * radius; double x = ox - Math.cos(angle) * radius;
double z = originZ + radius * Math.sin(angle); double z = oz + radius * Math.sin(angle);
this.radius = radius; this.setPosition(x, y, z);
this.setPosition(x, yPos, z);
this.prevPosX = x; this.prevPosX = x;
this.prevPosY = yPos; this.prevPosY = y;
this.prevPosZ = z; this.prevPosZ = z;
if(rand.nextBoolean()){ if(rand.nextBoolean()){
speed = rand.nextDouble() * 2 + 1; speed = rand.nextDouble() * 2 + 1;
@@ -29,12 +28,6 @@ public class ParticleBlizzard extends ParticleSnow {
this.multipleParticleScaleBy(1.5f); this.multipleParticleScaleBy(1.5f);
} }
@Override
public void init(){
super.init();
this.fullBrightness = true;
}
// @Override // @Override
// public void renderParticle(VertexBuffer buffer, Entity entity, float partialTicks, float rotationX, float // public void renderParticle(VertexBuffer buffer, Entity entity, float partialTicks, float rotationX, float
// rotationZ, float rotationYZ, float rotationXY, float rotationXZ){ // rotationZ, float rotationYZ, float rotationXY, float rotationXZ){
@@ -13,43 +13,14 @@ import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
/** @Deprecated
* Abstract superclass for all particles that use custom textures. This is intended to centralise as much code as public abstract class ParticleCustomTexture extends ParticleWizardry {
* possible; all subclasses need to do is to define the texture to use, how the frames are arranged (and which to
* choose), and any properties like gravity and collisions.
*
* @author Electroblob
* @since Wizardry 1.2
*/
@SideOnly(Side.CLIENT)
public abstract class ParticleCustomTexture extends Particle {
/** True if the particle always renders at full brightness. Defaults to false. */ public ParticleCustomTexture(World world, double x, double y, double z){
protected boolean fullBrightness = false; super(world, x, y, z);
public ParticleCustomTexture(World world, double x, double y, double z, double vx, double vy, double vz){
super(world, x, y, z, vx, vy, vz);
this.motionX = vx;
this.motionY = vy;
this.motionZ = vz;
this.init();
} }
public ParticleCustomTexture(World world, double x, double y, double z, double vx, double vy, double vz,
int maxAge){
this(world, x, y, z, vx, vy, vz);
this.particleMaxAge = maxAge;
}
/**
* Called from both constructors to set constants, avoiding duplicate code. Common fields to set here include:
* particleScale, particleGravity, canCollide, fullBrightness and setting the texture index.
*/
public abstract void init();
/** /**
* Returns a ResourceLocation for the particle's texture sheet. Do not create a new ResourceLocation in this method, * Returns a ResourceLocation for the particle's texture sheet. Do not create a new ResourceLocation in this method,
* only return a constant. * only return a constant.
@@ -83,59 +54,6 @@ public abstract class ParticleCustomTexture extends Particle {
this.particleTextureIndexY = index / getYFrames(); this.particleTextureIndexY = index / getYFrames();
} }
// Overridden to fix the bug with vanilla that makes particles frictionless. (y != y... seriously, Mojang?)
// TESTME: Probably no longer necessary.
// @Override
// public void move(double x, double y, double z){
//
// double d0 = y;
//
// if (this.canCollide)
// {
// List<AxisAlignedBB> list = this.world.getCollisionBoxes((Entity)null, this.getBoundingBox().addCoord(x, y, z));
//
// for (AxisAlignedBB axisalignedbb : list)
// {
// y = axisalignedbb.calculateYOffset(this.getBoundingBox(), y);
// }
//
// this.setBoundingBox(this.getBoundingBox().offset(0.0D, y, 0.0D));
//
// for (AxisAlignedBB axisalignedbb1 : list)
// {
// x = axisalignedbb1.calculateXOffset(this.getBoundingBox(), x);
// }
//
// this.setBoundingBox(this.getBoundingBox().offset(x, 0.0D, 0.0D));
//
// for (AxisAlignedBB axisalignedbb2 : list)
// {
// z = axisalignedbb2.calculateZOffset(this.getBoundingBox(), z);
// }
//
// this.setBoundingBox(this.getBoundingBox().offset(0.0D, 0.0D, z));
// }
// else
// {
// this.setBoundingBox(this.getBoundingBox().offset(x, y, z));
// }
//
// this.resetPositionToBB();
// this.onGround = d0 != y && d0 < 0.0D;
//
// /* Can never be true! - But this doesn't seem to make any difference anyway.
// if (x != x)
// {
// this.motionX = 0.0D;
// }
//
// if (z != z)
// {
// this.motionZ = 0.0D;
// }
// */
// }
// Overridden to bind the new texture. I think this can be done with TextureAtlasSprite, but this works as it is // Overridden to bind the new texture. I think this can be done with TextureAtlasSprite, but this works as it is
// so I'm not changing it for the time being. // so I'm not changing it for the time being.
@Override @Override
@@ -211,9 +129,4 @@ public abstract class ParticleCustomTexture extends Particle {
*/ */
public void undoGLStateChanges(){ public void undoGLStateChanges(){
} }
@Override
public int getBrightnessForRender(float partialTick){
return fullBrightness ? 15728880 : super.getBrightnessForRender(partialTick);
}
} }
@@ -1,6 +1,5 @@
package electroblob.wizardry.client.particle; package electroblob.wizardry.client.particle;
import net.minecraft.client.particle.Particle;
import net.minecraft.client.renderer.BufferBuilder; import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.world.World; import net.minecraft.world.World;
@@ -8,20 +7,16 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class ParticleDarkMagic extends Particle { public class ParticleDarkMagic extends ParticleWizardry {
/** Base spell texture index */ /** Base spell texture index */
private int baseSpellTextureIndex = 128; private int baseSpellTextureIndex = 128;
public ParticleDarkMagic(World par1World, double par2, double par4, double par6, double par8, double par10, public ParticleDarkMagic(World world, double x, double y, double z){
double par12, float r, float g, float b){ super(world, x, y, z);
super(par1World, par2, par4, par6, par8, par10, par12);
this.motionY *= 0.20000000298023224D; this.motionY *= 0.20000000298023224D;
this.setRBGColorF(1, 1, 1);
this.particleRed = r;
this.particleGreen = g;
this.particleBlue = b;
this.particleScale *= 0.75F; this.particleScale *= 0.75F;
this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); this.particleMaxAge = (int)(8.0D / (Math.random() * 0.8D + 0.2D));
this.canCollide = true; this.canCollide = true;
@@ -43,9 +38,7 @@ public class ParticleDarkMagic extends Particle {
super.renderParticle(buffer, entity, partialTicks, rotationX, rotationZ, rotationYZ, rotationXY, rotationXZ); super.renderParticle(buffer, entity, partialTicks, rotationX, rotationZ, rotationYZ, rotationXY, rotationXZ);
} }
/** @Override
* Called to update the entity's position/logic.
*/
public void onUpdate(){ public void onUpdate(){
this.prevPosX = this.posX; this.prevPosX = this.posX;
this.prevPosY = this.posY; this.prevPosY = this.posY;
@@ -1,34 +1,25 @@
package electroblob.wizardry.client.particle; package electroblob.wizardry.client.particle;
import net.minecraft.client.particle.Particle;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class ParticleDust extends Particle { public class ParticleDust extends ParticleWizardry {
private final boolean shaded; public ParticleDust(World world, double x, double y, double z){
super(world, x, y, z);
public ParticleDust(World par1World, double x, double y, double z, double par8, double par10, double par12, float r,
float g, float b, boolean shaded){
super(par1World, x, y, z, par8, par10, par12);
this.particleRed = r;
this.particleGreen = g;
this.particleBlue = b;
this.setParticleTextureIndex(0); this.setParticleTextureIndex(0);
this.setSize(0.01F, 0.01F); this.setSize(0.01F, 0.01F);
// Defaults
this.particleScale *= this.rand.nextFloat() + 0.2F; this.particleScale *= this.rand.nextFloat() + 0.2F;
this.motionX = par8;
this.motionY = par10;
this.motionZ = par12;
this.particleMaxAge = (int)(16.0D / (Math.random() * 0.8D + 0.2D)); this.particleMaxAge = (int)(16.0D / (Math.random() * 0.8D + 0.2D));
this.shaded = shaded; this.setRBGColorF(1, 1, 1);
} }
/** @Override
* Called to update the entity's position/logic.
*/
public void onUpdate(){ public void onUpdate(){
this.prevPosX = this.posX; this.prevPosX = this.posX;
this.prevPosY = this.posY; this.prevPosY = this.posY;
@@ -39,10 +30,4 @@ public class ParticleDust extends Particle {
this.setExpired(); this.setExpired();
} }
} }
@Override
public int getBrightnessForRender(float par1){
return shaded ? super.getBrightnessForRender(par1) : 15728880;
}
/* @Override public float getBrightness(float par1) { return shaded ? super.getBrightness(par1) : 1.0F; } */
} }
@@ -9,24 +9,18 @@ import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class ParticleIce extends ParticleCustomTexture { public class ParticleIce extends ParticleCustomTexture {
private static final ResourceLocation TEXTURE = new ResourceLocation(Wizardry.MODID, private static final ResourceLocation TEXTURE = new ResourceLocation(Wizardry.MODID, "textures/particle/ice_particles.png");
"textures/particle/ice_particles.png");
public ParticleIce(World world, double x, double y, double z, double vx, double vy, double vz){ public ParticleIce(World world, double x, double y, double z){
super(world, x, y, z, vx, vy, vz); super(world, x, y, z);
}
public ParticleIce(World world, double x, double y, double z, double vx, double vy, double vz, int maxAge){
super(world, x, y, z, vx, vy, vz, maxAge);
}
@Override
public void init(){
this.setParticleTextureIndex(rand.nextInt(8)); this.setParticleTextureIndex(rand.nextInt(8));
this.particleScale *= 0.75f;
this.particleGravity = 1;
this.canCollide = true; this.canCollide = true;
this.fullBrightness = true;
// Defaults
this.particleScale *= 0.75f;
this.setGravity(true);
this.shaded = false;
} }
@Override @Override
@@ -12,16 +12,10 @@ public class ParticleLeaf extends ParticleCustomTexture {
private static final ResourceLocation TEXTURE = new ResourceLocation(Wizardry.MODID, private static final ResourceLocation TEXTURE = new ResourceLocation(Wizardry.MODID,
"textures/particle/leaf_particles.png"); "textures/particle/leaf_particles.png");
public ParticleLeaf(World world, double x, double y, double z, double vx, double vy, double vz){ public ParticleLeaf(World world, double x, double y, double z){
super(world, x, y, z, vx, vy, vz); super(world, x, y, z);
} this.setVelocity(0, -0.03, 0);
this.setLifetime(10 + rand.nextInt(5));
public ParticleLeaf(World world, double x, double y, double z, double vx, double vy, double vz, int maxAge){
super(world, x, y, z, vx, vy, vz, maxAge);
}
@Override
public void init(){
this.setParticleTextureIndex(rand.nextInt(16)); this.setParticleTextureIndex(rand.nextInt(16));
this.particleScale *= 1.4f; this.particleScale *= 1.4f;
this.particleGravity = 0; this.particleGravity = 0;
@@ -8,24 +8,21 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class ParticleMagicFlame extends Particle { public class ParticleMagicFlame extends ParticleWizardry {
/** The scale of the flame particle */ /** The scale of the flame particle */
private float flameScale; private float flameScale;
public ParticleMagicFlame(World par1World, double par2, double par4, double par6, double par8, double par10, public ParticleMagicFlame(World world, double x, double y, double z){
double par12, int maxAge, float scale){ super(world, x, y, z);
super(par1World, par2, par4, par6, par8, par10, par12); // Not sure what these did but they sure as heck won't do anything now...
this.motionX = this.motionX * 0.009999999776482582D + par8; // TESTME: If it looks the same as before, delete these.
this.motionY = this.motionY * 0.009999999776482582D + par10; // this.motionX = this.motionX * 0.009999999776482582D + par8;
this.motionZ = this.motionZ * 0.009999999776482582D + par12; // this.motionY = this.motionY * 0.009999999776482582D + par10;
this.flameScale = scale; // this.motionZ = this.motionZ * 0.009999999776482582D + par12;
this.particleRed = this.particleGreen = this.particleBlue = 1.0F; this.flameScale = 1 + world.rand.nextFloat();
if(maxAge == 0){ this.setRBGColorF(1, 1, 1);
this.particleMaxAge = (int)(2.0D / (Math.random() * 0.8D + 0.2D)); this.particleMaxAge = (int)(2.0D / (Math.random() * 0.8D + 0.2D));
}else{
this.particleMaxAge = maxAge;
}
// IDEA: Make the particles for ray spells collide properly and not spawn on the other side of stuff. // IDEA: Make the particles for ray spells collide properly and not spawn on the other side of stuff.
this.canCollide = false; this.canCollide = false;
this.setParticleTextureIndex(48); this.setParticleTextureIndex(48);
@@ -43,4 +40,10 @@ public class ParticleMagicFlame extends Particle {
public int getBrightnessForRender(float par1){ public int getBrightnessForRender(float par1){
return 256; return 256;
} }
@Override
public Particle multipleParticleScaleBy(float scale){
this.flameScale *= scale;
return super.multipleParticleScaleBy(scale);
}
} }
@@ -19,32 +19,20 @@ public class ParticlePath extends ParticleCustomTexture {
private final double originX, originY, originZ; private final double originX, originY, originZ;
public ParticlePath(World world, double x, double y, double z, double vx, double vy, double vz, float r, float g, public ParticlePath(World world, double x, double y, double z){
float b){ super(world, x, y, z);
super(world, x, y, z, vx, vy, vz);
this.setRBGColorF(r, g, b);
this.originX = x; this.originX = x;
this.originY = y; this.originY = y;
this.originZ = z; this.originZ = z;
}
public ParticlePath(World world, double x, double y, double z, double vx, double vy, double vz, float r, float g,
float b, int maxAge){
super(world, x, y, z, vx, vy, vz, maxAge);
this.setRBGColorF(r, g, b);
this.originX = x;
this.originY = y;
this.originZ = z;
}
@Override
public void init(){
this.setParticleTextureIndex(0); this.setParticleTextureIndex(0);
// Set to a constant to remove the randomness from Particle. // Set to a constant to remove the randomness from Particle.
this.particleScale = 1.25f; this.particleScale = 1.25f;
this.particleGravity = 0; this.particleGravity = 0;
this.fullBrightness = true; this.shaded = false;
this.canCollide = false; this.canCollide = false;
this.setRBGColorF(1, 1, 1);
} }
@Override @Override
@@ -11,16 +11,15 @@ public class ParticleRotatingSparkle extends ParticleSparkle {
private double radius; private double radius;
private double speed; private double speed;
public ParticleRotatingSparkle(World world, int maxAge, double originX, double originZ, double radius, double yPos, public ParticleRotatingSparkle(World world, double ox, double y, double oz){
float r, float g, float b){ super(world, ox, y, oz);
super(world, 0, 0, 0, 0, 0, 0, r, g, b, maxAge);
this.angle = this.rand.nextDouble() * Math.PI * 2; this.angle = this.rand.nextDouble() * Math.PI * 2;
double x = originX - Math.cos(angle) * radius; double x = ox - Math.cos(angle) * radius;
double z = originZ + radius * Math.sin(angle); double z = oz + radius * Math.sin(angle);
this.radius = radius; this.radius = 1; // TODO: Find a suitable default value
this.setPosition(x, yPos, z); this.setPosition(x, y, z);
this.prevPosX = x; this.prevPosX = x;
this.prevPosY = yPos; this.prevPosY = y;
this.prevPosZ = z; this.prevPosZ = z;
if(rand.nextBoolean()){ if(rand.nextBoolean()){
speed = rand.nextDouble() * 2 + 1; speed = rand.nextDouble() * 2 + 1;
@@ -12,20 +12,14 @@ public class ParticleSnow extends ParticleCustomTexture {
private static final ResourceLocation TEXTURE = new ResourceLocation(Wizardry.MODID, private static final ResourceLocation TEXTURE = new ResourceLocation(Wizardry.MODID,
"textures/particle/snow_particles.png"); "textures/particle/snow_particles.png");
public ParticleSnow(World world, double x, double y, double z, double vx, double vy, double vz){ public ParticleSnow(World world, double x, double y, double z){
super(world, x, y, z, vx, vy, vz); super(world, x, y, z);
}
public ParticleSnow(World world, double x, double y, double z, double vx, double vy, double vz, int maxAge){
super(world, x, y, z, vx, vy, vz, maxAge);
}
@Override
public void init(){
this.setParticleTextureIndex(rand.nextInt(8)); this.setParticleTextureIndex(rand.nextInt(8));
this.setVelocity(0, -0.02, 0);
this.particleScale *= 0.6f; this.particleScale *= 0.6f;
this.particleGravity = 0; this.particleGravity = 0;
this.canCollide = true; this.canCollide = true;
this.setLifetime(40 + rand.nextInt(10));
} }
@Override @Override
@@ -16,18 +16,14 @@ public class ParticleSpark extends ParticleCustomTexture {
private static final ResourceLocation TEXTURE = new ResourceLocation(Wizardry.MODID, private static final ResourceLocation TEXTURE = new ResourceLocation(Wizardry.MODID,
"textures/particle/lightning_particles.png"); "textures/particle/lightning_particles.png");
public ParticleSpark(World world, double x, double y, double z, double vx, double vy, double vz){ public ParticleSpark(World world, double x, double y, double z){
// Max age is always 3. super(world, x, y, z);
super(world, x, y, z, vx, vy, vz, 3);
}
@Override
public void init(){
// Multiplied by 4 because the index works slightly differently for spark particles. // Multiplied by 4 because the index works slightly differently for spark particles.
this.setParticleTextureIndex(rand.nextInt(8) * 4); this.setParticleTextureIndex(rand.nextInt(8) * 4);
this.particleScale *= 1.4f; this.particleScale *= 1.4f;
this.fullBrightness = true; this.shaded = false;
this.canCollide = false; this.canCollide = false;
this.setLifetime(3); // Lifetime defaults to 3 (and is very unlikely to be changed)
} }
@Override @Override
@@ -9,64 +9,31 @@ import net.minecraftforge.fml.relauncher.SideOnly;
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
public class ParticleSparkle extends ParticleCustomTexture { public class ParticleSparkle extends ParticleCustomTexture {
/* I have now figured out what particle factories are for: they separate out the individual uses of the varargs
* parameter in spawnParticle so they are kept with the particle class. For my purposes, it would be easier to do
* that in the particle spawning method itself. */
private static final ResourceLocation TEXTURE = new ResourceLocation(Wizardry.MODID, private static final ResourceLocation TEXTURE = new ResourceLocation(Wizardry.MODID,
"textures/particle/sparkle_particles.png"); "textures/particle/sparkle_particles.png");
// NOTE: Uncomment once 2.1.0 is released // Implementation of colour fading (perhaps these belong in ParticleWizardry?)
// private final float initialRed; private float initialRed;
// private final float initialGreen; private float initialGreen;
// private final float initialBlue; private float initialBlue;
// TODO: Assign these via the constructors, as part of the refactoring for particle parameters. public ParticleSparkle(World world, double x, double y, double z){
// NOTE: Uncomment once 2.1.0 is released super(world, x, y, z);
// private final float fadeRed = 1; this.setRBGColorF(1, 1, 1);
// private final float fadeGreen = 1;
// private final float fadeBlue = 0;
public ParticleSparkle(World world, double x, double y, double z, double vx, double vy, double vz, float r, float g,
float b){
super(world, x, y, z, vx, vy, vz);
this.setRBGColorF(r, g, b);
// NOTE: Uncomment once 2.1.0 is released
// initialRed = r;
// initialGreen = g;
// initialBlue = b;
this.particleMaxAge = 48 + this.rand.nextInt(12); this.particleMaxAge = 48 + this.rand.nextInt(12);
}
public ParticleSparkle(World world, double x, double y, double z, double vx, double vy, double vz, float r, float g,
float b, int maxAge){
super(world, x, y, z, vx, vy, vz, maxAge);
this.setRBGColorF(r, g, b);
// NOTE: Uncomment once 2.1.0 is released
// initialRed = r;
// initialGreen = g;
// initialBlue = b;
}
public ParticleSparkle(World world, double x, double y, double z, double vx, double vy, double vz, float r, float g,
float b, boolean doGravity){
this(world, x, y, z, vx, vy, vz, r, g, b);
this.particleGravity = doGravity ? 1 : 0;
}
public ParticleSparkle(World world, double x, double y, double z, double vx, double vy, double vz, float r, float g,
float b, int maxAge, boolean doGravity){
this(world, x, y, z, vx, vy, vz, r, g, b, maxAge);
this.particleGravity = doGravity ? 1 : 0;
}
@Override
public void init(){
this.setParticleTextureIndex(rand.nextInt(16));
this.particleScale *= 0.75f; this.particleScale *= 0.75f;
this.particleGravity = 0; this.particleGravity = 0;
this.canCollide = false; this.canCollide = false;
this.fullBrightness = true; this.shaded = false;
}
// Overridden to set the initial colour values
@Override
public void setRBGColorF(float r, float g, float b){
super.setRBGColorF(r, g, b);
initialRed = r;
initialGreen = g;
initialBlue = b;
} }
@Override @Override
@@ -88,16 +55,19 @@ public class ParticleSparkle extends ParticleCustomTexture {
public void onUpdate(){ public void onUpdate(){
super.onUpdate(); super.onUpdate();
// Fading // Fading
if(this.particleAge > this.particleMaxAge / 2){ if(this.particleAge > this.particleMaxAge / 2){
this.setAlphaF( this.setAlphaF(
1.0F - ((float)this.particleAge - (float)(this.particleMaxAge / 2)) / (float)this.particleMaxAge); 1.0F - ((float)this.particleAge - (float)(this.particleMaxAge / 2)) / (float)this.particleMaxAge);
} }
// Colour fading TODO Uncomment once 2.1.0 is released
// float ageFraction = (float)this.particleAge / (float)this.particleMaxAge; // Colour fading
// this.setRBGColorF(this.initialRed + (this.fadeRed - this.initialRed)*ageFraction, float ageFraction = (float)this.particleAge / (float)this.particleMaxAge;
// this.initialGreen + (this.fadeGreen - this.initialGreen)*ageFraction, // No longer uses setRBGColorF because that method now also sets the initial values
// this.initialBlue + (this.fadeBlue - this.initialBlue)*ageFraction); this.particleRed = this.initialRed + (this.fadeRed - this.initialRed)*ageFraction;
this.particleGreen = this.initialGreen + (this.fadeGreen - this.initialGreen)*ageFraction;
this.particleBlue = this.initialBlue + (this.fadeBlue - this.initialBlue)*ageFraction;
this.setParticleTextureIndex((this.particleAge * 11)/this.particleMaxAge); this.setParticleTextureIndex((this.particleAge * 11)/this.particleMaxAge);
} }
@@ -2,12 +2,12 @@ package electroblob.wizardry.entity.construct;
import java.util.List; import java.util.List;
import electroblob.wizardry.Wizardry;
import electroblob.wizardry.registry.WizardryPotions; import electroblob.wizardry.registry.WizardryPotions;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.MagicDamage; import electroblob.wizardry.util.MagicDamage;
import electroblob.wizardry.util.MagicDamage.DamageType; import electroblob.wizardry.util.MagicDamage.DamageType;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.potion.PotionEffect; import net.minecraft.potion.PotionEffect;
@@ -61,16 +61,23 @@ public class EntityBlizzard extends EntityMagicConstruct {
target.addPotionEffect(new PotionEffect(WizardryPotions.frost, 20, 0)); target.addPotionEffect(new PotionEffect(WizardryPotions.frost, 20, 0));
} }
}else{ }else{
// For some reason this number of particles now causes the game to lag significantly, despite it being fine for(int i=1; i<6; i++){
// in 1.7.10. I thought particles were supposed to be LESS laggy now...
for(int i = 1; i < 6; i++){
float brightness = 0.5f + (rand.nextFloat() / 2); float brightness = 0.5f + (rand.nextFloat() / 2);
Wizardry.proxy.spawnParticle(WizardryParticleType.BLIZZARD, world, this.posX,
this.posY + rand.nextDouble() * 3, this.posZ, 0, 0, 0, 100, brightness, brightness + 0.1f, 1.0f, ParticleBuilder.create(Type.BLIZZARD)
false, rand.nextDouble() * 2.5d + 0.5d); .pos(this.posX, this.posY + rand.nextDouble() * 3, this.posZ)
Wizardry.proxy.spawnParticle(WizardryParticleType.BLIZZARD, world, this.posX, .lifetime(100)
this.posY + rand.nextDouble() * 3, this.posZ, 0, 0, 0, 100, 1.0f, 1.0f, 1.0f, false, .colour(brightness, brightness + 0.1f, 1.0f)
rand.nextDouble() * 2.5d + 0.5d); .radius(rand.nextDouble() * 2.5d + 0.5d)
.spawn(world);
ParticleBuilder.create(Type.BLIZZARD)
.pos(this.posX, this.posY + rand.nextDouble() * 3, this.posZ)
.lifetime(100)
.colour(1, 1, 1)
.radius(rand.nextDouble() * 2.5d + 0.5d)
.spawn(world);
} }
} }
} }
@@ -2,9 +2,9 @@ package electroblob.wizardry.entity.construct;
import java.util.List; import java.util.List;
import electroblob.wizardry.Wizardry;
import electroblob.wizardry.registry.WizardryPotions; import electroblob.wizardry.registry.WizardryPotions;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.init.SoundEvents; import net.minecraft.init.SoundEvents;
@@ -53,12 +53,17 @@ public class EntityDecay extends EntityMagicConstruct {
target.addPotionEffect(new PotionEffect(WizardryPotions.decay, LIFETIME, 0)); target.addPotionEffect(new PotionEffect(WizardryPotions.decay, LIFETIME, 0));
} }
} }
}else if(this.rand.nextInt(15) == 0){ }else if(this.rand.nextInt(15) == 0){
double radius = rand.nextDouble() * 0.8; double radius = rand.nextDouble() * 0.8;
double angle = rand.nextDouble() * Math.PI * 2; double angle = rand.nextDouble() * Math.PI * 2;
float brightness = rand.nextFloat() * 0.4f; float brightness = rand.nextFloat() * 0.4f;
Wizardry.proxy.spawnParticle(WizardryParticleType.DARK_MAGIC, world, this.posX + radius * Math.cos(angle),
this.posY, this.posZ + radius * Math.sin(angle), 0, 0, 0, 0, brightness, 0, brightness + 0.1f); ParticleBuilder.create(Type.DARK_MAGIC)
.pos(this.posX + radius * Math.cos(angle), this.posY, this.posZ + radius * Math.sin(angle))
.colour(brightness, 0, brightness + 0.1f)
.spawn(world);
} }
} }
@@ -2,9 +2,9 @@ package electroblob.wizardry.entity.construct;
import java.util.List; import java.util.List;
import electroblob.wizardry.Wizardry;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@@ -62,15 +62,18 @@ public class EntityForcefield extends EntityMagicConstruct {
} }
}else{ }else{
for(int i = 1; i < 40; i++){ for(int i = 1; i < 40; i++){
// Generates a spherical pattern of particles
float brightness = 0.5f + (rand.nextFloat() * 0.5f); float brightness = 0.5f + (rand.nextFloat() * 0.5f);
double radius = 3; double radius = 3;
double yaw = rand.nextDouble() * Math.PI * 2; double yaw = rand.nextDouble() * Math.PI * 2;
double pitch = (rand.nextDouble() - 0.5) * Math.PI; double pitch = (rand.nextDouble() - 0.5) * Math.PI;
// Generates a spherical pattern of particles
Wizardry.proxy.spawnParticle(WizardryParticleType.BRIGHT_DUST, world, ParticleBuilder.create(Type.DUST)
this.posX + radius * Math.cos(yaw) * Math.cos(pitch), this.posY + 3 + radius * Math.sin(pitch), .pos(this.posX + radius * Math.cos(yaw) * Math.cos(pitch), this.posY + 3 + radius * Math.sin(pitch),
this.posZ + radius * Math.sin(yaw) * Math.cos(pitch), 0, 0, 0, 48 + this.rand.nextInt(12), this.posZ + radius * Math.sin(yaw) * Math.cos(pitch))
brightness, brightness, 1.0f); .lifetime(48 + this.rand.nextInt(12))
.colour(brightness, brightness, 1.0f);
} }
} }
} }
@@ -2,12 +2,12 @@ package electroblob.wizardry.entity.construct;
import java.util.List; import java.util.List;
import electroblob.wizardry.Wizardry;
import electroblob.wizardry.registry.WizardryPotions; import electroblob.wizardry.registry.WizardryPotions;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.MagicDamage; import electroblob.wizardry.util.MagicDamage;
import electroblob.wizardry.util.MagicDamage.DamageType; import electroblob.wizardry.util.MagicDamage.DamageType;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.potion.PotionEffect; import net.minecraft.potion.PotionEffect;
@@ -74,8 +74,10 @@ public class EntityFrostSigil extends EntityMagicConstruct {
}else if(this.rand.nextInt(15) == 0){ }else if(this.rand.nextInt(15) == 0){
double radius = 0.5 + rand.nextDouble() * 0.3; double radius = 0.5 + rand.nextDouble() * 0.3;
double angle = rand.nextDouble() * Math.PI * 2; double angle = rand.nextDouble() * Math.PI * 2;
Wizardry.proxy.spawnParticle(WizardryParticleType.SNOW, world, this.posX + radius * Math.cos(angle), ParticleBuilder.create(Type.SNOW)
this.posY + 0.1, this.posZ + radius * Math.sin(angle), 0, 0, 0, 40 + rand.nextInt(10)); .pos(this.posX + radius * Math.cos(angle), this.posY + 0.1, this.posZ + radius * Math.sin(angle))
.vel(0, 0, 0) // Required since default for snow is not stationary
.spawn(world);
} }
} }
@@ -7,7 +7,8 @@ import electroblob.wizardry.entity.EntityArc;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.MagicDamage; import electroblob.wizardry.util.MagicDamage;
import electroblob.wizardry.util.MagicDamage.DamageType; import electroblob.wizardry.util.MagicDamage.DamageType;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState; import net.minecraft.block.state.IBlockState;
@@ -69,8 +70,9 @@ public class EntityHammer extends EntityMagicConstruct {
} }
if(this.world.isRemote && this.ticksExisted % 3 == 0){ if(this.world.isRemote && this.ticksExisted % 3 == 0){
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world, this.posX - 0.5d + rand.nextDouble(), ParticleBuilder.create(Type.SPARK)
this.posY + 2 * rand.nextDouble(), this.posZ - 0.5d + rand.nextDouble(), 0, 0, 0, 3); .pos(this.posX - 0.5d + rand.nextDouble(), this.posY + 2 * rand.nextDouble(), this.posZ - 0.5d + rand.nextDouble())
.spawn(world);
} }
if(!this.world.isRemote){ if(!this.world.isRemote){
@@ -109,12 +111,14 @@ public class EntityHammer extends EntityMagicConstruct {
target.posY + target.height / 2, target.posZ); target.posY + target.height / 2, target.posZ);
world.spawnEntity(arc); world.spawnEntity(arc);
}else{ }else{
for(int j = 0; j < 8; j++){ // TODO: Move all the arc particle (and sound?) stuff into a method in WizardryUtilities
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world, for(int j=0; j<8; j++){
target.posX + world.rand.nextFloat() - 0.5, ParticleBuilder.create(Type.SPARK)
target.getEntityBoundingBox().minY + target.height / 2 .pos(target.posX + world.rand.nextFloat() - 0.5,
+ world.rand.nextFloat() * 2 - 1, target.getEntityBoundingBox().minY + target.height / 2 + world.rand.nextFloat() * 2 - 1,
target.posZ + world.rand.nextFloat() - 0.5, 0, 0, 0, 3); target.posZ + world.rand.nextFloat() - 0.5)
.spawn(world);
world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, target.posX + rand.nextFloat(), world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, target.posX + rand.nextFloat(),
target.getEntityBoundingBox().minY + target.height / 2 + rand.nextFloat(), target.getEntityBoundingBox().minY + target.height / 2 + rand.nextFloat(),
target.posZ + rand.nextFloat(), 0, 0, 0); target.posZ + rand.nextFloat(), 0, 0, 0);
@@ -2,11 +2,11 @@ package electroblob.wizardry.entity.construct;
import java.util.List; import java.util.List;
import electroblob.wizardry.Wizardry;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.MagicDamage; import electroblob.wizardry.util.MagicDamage;
import electroblob.wizardry.util.MagicDamage.DamageType; import electroblob.wizardry.util.MagicDamage.DamageType;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
@@ -69,13 +69,16 @@ public class EntityHealAura extends EntityMagicConstruct {
} }
} }
}else{ }else{
for(int i = 1; i < 3; i++){ for(int i=1; i<3; i++){
float brightness = 0.5f + (rand.nextFloat() * 0.5f); float brightness = 0.5f + (rand.nextFloat() * 0.5f);
double radius = rand.nextDouble() * 2.0; double radius = rand.nextDouble() * 2.0;
double angle = rand.nextDouble() * Math.PI * 2; double angle = rand.nextDouble() * Math.PI * 2;
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, this.posX + radius * Math.cos(angle), ParticleBuilder.create(Type.SPARKLE)
this.posY, this.posZ + radius * Math.sin(angle), 0, 0.05f, 0, 48 + this.rand.nextInt(12), 1.0f, .pos(this.posX + radius * Math.cos(angle), this.posY, this.posZ + radius * Math.sin(angle))
1.0f, brightness); .vel(0, 0.05, 0)
.lifetime(48 + this.rand.nextInt(12))
.colour(1.0f, 1.0f, brightness)
.spawn(world);
} }
} }
} }
@@ -2,12 +2,12 @@ package electroblob.wizardry.entity.construct;
import java.util.List; import java.util.List;
import electroblob.wizardry.Wizardry;
import electroblob.wizardry.entity.EntityArc; import electroblob.wizardry.entity.EntityArc;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.MagicDamage; import electroblob.wizardry.util.MagicDamage;
import electroblob.wizardry.util.MagicDamage.DamageType; import electroblob.wizardry.util.MagicDamage.DamageType;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.util.DamageSource; import net.minecraft.util.DamageSource;
@@ -44,8 +44,6 @@ public class EntityLightningSigil extends EntityMagicConstruct {
this.setDead(); this.setDead();
} }
// if(!this.world.isRemote){
List<EntityLivingBase> targets = WizardryUtilities.getEntitiesWithinRadius(1.0d, this.posX, this.posY, List<EntityLivingBase> targets = WizardryUtilities.getEntitiesWithinRadius(1.0d, this.posX, this.posY,
this.posZ, this.world); this.posZ, this.world);
@@ -90,11 +88,11 @@ public class EntityLightningSigil extends EntityMagicConstruct {
world.spawnEntity(arc); world.spawnEntity(arc);
}else{ }else{
for(int k = 0; k < 8; k++){ for(int k = 0; k < 8; k++){
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world, ParticleBuilder.create(Type.SPARK)
secondaryTarget.posX + world.rand.nextFloat() - 0.5, .pos(secondaryTarget.posX + world.rand.nextFloat() - 0.5,
secondaryTarget.getEntityBoundingBox().minY + secondaryTarget.height / 2 secondaryTarget.getEntityBoundingBox().minY + secondaryTarget.height / 2 + world.rand.nextFloat() * 2 - 1,
+ world.rand.nextFloat() * 2 - 1, secondaryTarget.posZ + world.rand.nextFloat() - 0.5)
secondaryTarget.posZ + world.rand.nextFloat() - 0.5, 0, 0, 0, 3); .spawn(world);
world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, world.spawnParticle(EnumParticleTypes.SMOKE_LARGE,
secondaryTarget.posX + world.rand.nextFloat() - 0.5, secondaryTarget.posX + world.rand.nextFloat() - 0.5,
secondaryTarget.getEntityBoundingBox().minY + secondaryTarget.height / 2 secondaryTarget.getEntityBoundingBox().minY + secondaryTarget.height / 2
@@ -116,13 +114,13 @@ public class EntityLightningSigil extends EntityMagicConstruct {
} }
} }
} }
// }
if(this.world.isRemote && this.rand.nextInt(15) == 0){ if(this.world.isRemote && this.rand.nextInt(15) == 0){
double radius = 0.5 + rand.nextDouble() * 0.3; double radius = 0.5 + rand.nextDouble() * 0.3;
double angle = rand.nextDouble() * Math.PI * 2; double angle = rand.nextDouble() * Math.PI * 2;
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world, this.posX + radius * Math.cos(angle), ParticleBuilder.create(Type.SPARK)
this.posY + 0.1, this.posZ + radius * Math.sin(angle), 0, 0, 0, 3); .pos(this.posX + radius * Math.cos(angle), this.posY + 0.1, this.posZ + radius * Math.sin(angle))
.spawn(world);
} }
} }
@@ -7,7 +7,8 @@ import electroblob.wizardry.registry.WizardryAdvancementTriggers;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.MagicDamage; import electroblob.wizardry.util.MagicDamage;
import electroblob.wizardry.util.MagicDamage.DamageType; import electroblob.wizardry.util.MagicDamage.DamageType;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import net.minecraft.block.material.Material; import net.minecraft.block.material.Material;
@@ -134,23 +135,21 @@ public class EntityTornado extends EntityMagicConstruct {
Wizardry.proxy.spawnTornadoParticle(world, this.posX, this.posY + yPos, this.posZ, this.velX, this.velZ, Wizardry.proxy.spawnTornadoParticle(world, this.posX, this.posY + yPos, this.posZ, this.velX, this.velZ,
yPos / 3 + 0.5d, 100, block, pos1); yPos / 3 + 0.5d, 100, block, pos1);
// Sometimes spawns leaf particles if the block is leaves // Sometimes spawns leaf particles if the block is leaves, or snow particles if the block is snow
if(block.getMaterial() == Material.LEAVES && this.rand.nextInt(3) == 0){ if(this.rand.nextInt(3) == 0){
double yPos1 = rand.nextDouble() * 8;
Wizardry.proxy.spawnParticle(WizardryParticleType.LEAF, world, Type type = null;
this.posX + (rand.nextDouble() * 2 - 1) * (yPos1 / 3 + 0.5d), this.posY + yPos1,
this.posZ + (rand.nextDouble() * 2 - 1) * (yPos1 / 3 + 0.5d), 0, -0.05, 0, if(block.getMaterial() == Material.LEAVES) type = Type.LEAF;
40 + rand.nextInt(10)); if(block.getMaterial() == Material.SNOW || block.getMaterial() == Material.CRAFTED_SNOW)
} type = Type.SNOW;
// Sometimes spawns snow particles if the block is snow
if(block.getMaterial() == Material.SNOW
|| block.getMaterial() == Material.CRAFTED_SNOW && this.rand.nextInt(3) == 0){
double yPos1 = rand.nextDouble() * 8; double yPos1 = rand.nextDouble() * 8;
Wizardry.proxy.spawnParticle(WizardryParticleType.SNOW, world, ParticleBuilder.create(type)
this.posX + (rand.nextDouble() * 2 - 1) * (yPos1 / 3 + 0.5d), this.posY + yPos1, .pos(this.posX + (rand.nextDouble() * 2 - 1) * (yPos1 / 3 + 0.5d), this.posY + yPos1,
this.posZ + (rand.nextDouble() * 2 - 1) * (yPos1 / 3 + 0.5d), 0, -0.02, 0, this.posZ + (rand.nextDouble() * 2 - 1) * (yPos1 / 3 + 0.5d))
40 + rand.nextInt(10)); .lifetime(40 + rand.nextInt(10))
.spawn(world);
} }
} }
} }
@@ -2,8 +2,8 @@ package electroblob.wizardry.entity.living;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
import electroblob.wizardry.Wizardry; import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.SharedMonsterAttributes;
@@ -40,10 +40,13 @@ public class EntityDecoy extends EntitySummonedCreature {
public void onDespawn(){ public void onDespawn(){
super.onDespawn(); super.onDespawn();
for(int i = 0; i < 20; i++){ for(int i = 0; i < 20; i++){
Wizardry.proxy.spawnParticle(WizardryParticleType.DUST, world, ParticleBuilder.create(Type.DUST)
this.posX + (this.rand.nextDouble() - 0.5) * this.width, .pos(this.posX + (this.rand.nextDouble() - 0.5) * this.width, this.getEntityBoundingBox().minY
this.getEntityBoundingBox().minY + this.rand.nextDouble() * this.height, + this.rand.nextDouble() * this.height, this.posZ + (this.rand.nextDouble() - 0.5) * this.width)
this.posZ + (this.rand.nextDouble() - 0.5) * this.width, 0, 0, 0, 40, 0.2f, 1.0f, 0.8f); .lifetime(40)
.colour(0.2f, 1.0f, 0.8f)
.shaded(true)
.spawn(world);
} }
} }
@@ -16,8 +16,9 @@ import electroblob.wizardry.registry.WizardryItems;
import electroblob.wizardry.registry.WizardryPotions; import electroblob.wizardry.registry.WizardryPotions;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.spell.Spell; import electroblob.wizardry.spell.Spell;
import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
@@ -200,20 +201,19 @@ public class EntityEvilWizard extends EntityMob implements ISpellCaster, IEntity
// deathTime == 0 checks the wizard isn't currently dying // deathTime == 0 checks the wizard isn't currently dying
}else if(healCooldown == -1 && this.deathTime == 0){ }else if(healCooldown == -1 && this.deathTime == 0){
// Heal particles // Heal particles TODO: Change this so it uses the heal spell directly
if(world.isRemote){ if(world.isRemote){
for(int i = 0; i < 10; i++){ for(int i=0; i<10; i++){
double d0 = (double)((float)this.posX + rand.nextFloat() * 2 - 1.0F); double x = (double)((float)this.posX + rand.nextFloat() * 2 - 1.0F);
// Apparently the client side spawns the particles 1 block higher than it should... hence the - // Apparently the client side spawns the particles 1 block higher than it should... hence the -
// 0.5F. // 0.5F.
double d1 = (double)((float)this.posY - 0.5F + rand.nextFloat()); double y = (double)((float)this.posY - 0.5F + rand.nextFloat());
double d2 = (double)((float)this.posZ + rand.nextFloat() * 2 - 1.0F); double z = (double)((float)this.posZ + rand.nextFloat() * 2 - 1.0F);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, d0, d1, d2, 0, 0.1F, 0, ParticleBuilder.create(Type.SPARKLE).pos(x, y, z).vel(0, 0.1F, 0).colour(1, 1, 0.3f).spawn(world);
48 + rand.nextInt(12), 1.0f, 1.0f, 0.3f);
} }
}else{ }else{
if(this.getHealth() < 10){ if(this.getHealth() < 10){
// Wizard heals himself more often if he has low health // Wizards heal themseselves more often if they have low health
this.setHealCooldown(150); this.setHealCooldown(150);
}else{ }else{
this.setHealCooldown(400); this.setHealCooldown(400);
@@ -6,7 +6,8 @@ import java.util.UUID;
import electroblob.wizardry.Wizardry; import electroblob.wizardry.Wizardry;
import electroblob.wizardry.registry.WizardryPotions; import electroblob.wizardry.registry.WizardryPotions;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.ParticleBuilder.Type;
import net.minecraft.entity.EntityFlying; import net.minecraft.entity.EntityFlying;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.ai.EntityAIAttackMelee; import net.minecraft.entity.ai.EntityAIAttackMelee;
@@ -144,10 +145,12 @@ public class EntityIceGiant extends EntityIronGolem implements ISummonedCreature
if(this.world.isRemote){ if(this.world.isRemote){
for(int i = 0; i < 30; i++){ for(int i = 0; i < 30; i++){
float brightness = 0.5f + (rand.nextFloat() / 2); float brightness = 0.5f + (rand.nextFloat() / 2);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, this.world, ParticleBuilder.create(Type.SPARKLE)
this.posX - 1 + rand.nextDouble() * 2, this.posY + rand.nextDouble() * 3, .pos(this.posX - 1 + rand.nextDouble() * 2, this.posY + rand.nextDouble() * 3, this.posZ - 1 + rand.nextDouble() * 2)
this.posZ - 1 + rand.nextDouble() * 2, 0, -0.02, 0, 12 + rand.nextInt(8), brightness, .vel(0, -0.02, 0)
brightness + 0.1f, 1.0f); .lifetime(12 + rand.nextInt(8))
.colour(brightness, brightness + 0.1f, 1.0f)
.spawn(world);
} }
} }
} }
@@ -158,9 +161,9 @@ public class EntityIceGiant extends EntityIronGolem implements ISummonedCreature
super.onLivingUpdate(); super.onLivingUpdate();
if(this.world.isRemote){ if(this.world.isRemote){
Wizardry.proxy.spawnParticle(WizardryParticleType.SNOW, this.world, this.posX - 1 + rand.nextDouble() * 2, ParticleBuilder.create(Type.SNOW)
this.posY + rand.nextDouble() * 3, this.posZ - 1 + rand.nextDouble() * 2, 0, -0.02, 0, .pos(this.posX - 1 + rand.nextDouble() * 2, this.posY + rand.nextDouble() * 3, this.posZ - 1 + rand.nextDouble() * 2)
40 + rand.nextInt(10)); .spawn(world);
} }
} }
@@ -1,10 +1,10 @@
package electroblob.wizardry.entity.living; package electroblob.wizardry.entity.living;
import electroblob.wizardry.Wizardry;
import electroblob.wizardry.registry.Spells; import electroblob.wizardry.registry.Spells;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.ai.EntityAIBase; import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.entity.ai.EntityAILookIdle; import net.minecraft.entity.ai.EntityAILookIdle;
@@ -50,9 +50,13 @@ public class EntityIceWraith extends EntityBlazeMinion {
if(this.world.isRemote){ if(this.world.isRemote){
for(int i = 0; i < 15; i++){ for(int i = 0; i < 15; i++){
float brightness = 0.5f + (rand.nextFloat() / 2); float brightness = 0.5f + (rand.nextFloat() / 2);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, this.posX - 0.5d + rand.nextDouble(), ParticleBuilder.create(Type.SPARKLE)
this.posY + this.height / 2 - 0.5d + rand.nextDouble(), this.posZ - 0.5d + rand.nextDouble(), 0, .pos(this.posX - 0.5d + rand.nextDouble(), this.posY + this.height / 2 - 0.5d + rand.nextDouble(),
0.05f, 0, 20 + rand.nextInt(10), brightness, brightness + 0.1f, 1.0f); this.posZ - 0.5d + rand.nextDouble())
.vel(0, 0.05f, 0)
.lifetime(20 + rand.nextInt(10))
.colour(brightness, brightness + 0.1f, 1.0f)
.spawn(world);
} }
} }
} }
@@ -1,9 +1,9 @@
package electroblob.wizardry.entity.living; package electroblob.wizardry.entity.living;
import electroblob.wizardry.Wizardry;
import electroblob.wizardry.registry.Spells; import electroblob.wizardry.registry.Spells;
import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.ai.EntityAIBase; import net.minecraft.entity.ai.EntityAIBase;
import net.minecraft.entity.ai.EntityAILookIdle; import net.minecraft.entity.ai.EntityAILookIdle;
@@ -44,9 +44,12 @@ public class EntityLightningWraith extends EntityBlazeMinion {
if(this.world.isRemote){ if(this.world.isRemote){
for(int i = 0; i < 15; i++){ for(int i = 0; i < 15; i++){
float brightness = 0.3f + (rand.nextFloat() / 2); float brightness = 0.3f + (rand.nextFloat() / 2);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, this.posX - 0.5d + rand.nextDouble(), ParticleBuilder.create(Type.SPARKLE)
this.posY + this.height / 2 - 0.5d + rand.nextDouble(), this.posZ - 0.5d + rand.nextDouble(), 0, .pos(this.posX - 0.5d + rand.nextDouble(), this.posY + this.height / 2 - 0.5d + rand.nextDouble(), this.posZ - 0.5d + rand.nextDouble())
0.05f, 0, 20 + rand.nextInt(10), brightness, brightness + 0.2f, 1.0f); .vel(0, 0.05, 0)
.lifetime(20 + rand.nextInt(10))
.colour(brightness, brightness + 0.2f, 1.0f)
.spawn(world);
} }
} }
} }
@@ -56,10 +59,7 @@ public class EntityLightningWraith extends EntityBlazeMinion {
// Fortunately, lightning wraiths don't replace any of blazes' particle effects or the fire sound, they only // Fortunately, lightning wraiths don't replace any of blazes' particle effects or the fire sound, they only
// add the sparks, so it's fine to call super here. // add the sparks, so it's fine to call super here.
if(world.isRemote){ if(world.isRemote){
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world, ParticleBuilder.create(Type.SPARK, this).spawn(world);
this.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width,
this.posY + this.rand.nextDouble() * (double)this.height,
this.posZ + (this.rand.nextDouble() - 0.5D) * (double)this.width, 0, 0, 0, 3);
} }
super.onLivingUpdate(); super.onLivingUpdate();
} }
@@ -3,11 +3,11 @@ package electroblob.wizardry.entity.living;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import electroblob.wizardry.Wizardry;
import electroblob.wizardry.registry.Spells; import electroblob.wizardry.registry.Spells;
import electroblob.wizardry.spell.Spell; import electroblob.wizardry.spell.Spell;
import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIAttackMelee; import net.minecraft.entity.ai.EntityAIAttackMelee;
@@ -128,9 +128,13 @@ public class EntityShadowWraith extends EntitySummonedCreature implements ISpell
if(this.world.isRemote){ if(this.world.isRemote){
for(int i = 0; i < 15; i++){ for(int i = 0; i < 15; i++){
float brightness = rand.nextFloat() * 0.4f; float brightness = rand.nextFloat() * 0.4f;
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, this.posX - 0.5d + rand.nextDouble(), ParticleBuilder.create(Type.SPARKLE)
this.posY + this.height / 2 - 0.5d + rand.nextDouble(), this.posZ - 0.5d + rand.nextDouble(), 0, .pos(this.posX - 0.5d + rand.nextDouble(), this.posY + this.height / 2 - 0.5d + rand.nextDouble(),
0.05f, 0, 20 + rand.nextInt(10), brightness, 0.0f, brightness); this.posZ - 0.5d + rand.nextDouble())
.vel(0, 0.05, 0)
.lifetime(20 + rand.nextInt(10))
.colour(brightness, 0.0f, brightness)
.spawn(world);
} }
} }
} }
@@ -149,26 +153,25 @@ public class EntityShadowWraith extends EntitySummonedCreature implements ISpell
} }
if(world.isRemote){ if(world.isRemote){
for(int i = 0; i < 2; i++){
for(int i=0; i<2; i++){
world.spawnParticle(EnumParticleTypes.PORTAL, world.spawnParticle(EnumParticleTypes.PORTAL,
this.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width, this.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width,
this.posY + this.rand.nextDouble() * (double)this.height, this.posY + this.rand.nextDouble() * (double)this.height,
this.posZ + (this.rand.nextDouble() - 0.5D) * (double)this.width, 0, 0, 0); this.posZ + (this.rand.nextDouble() - 0.5D) * (double)this.width, 0, 0, 0);
world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, world.spawnParticle(EnumParticleTypes.SMOKE_LARGE,
this.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width, this.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width,
this.posY + this.rand.nextDouble() * (double)this.height, this.posY + this.rand.nextDouble() * (double)this.height,
this.posZ + (this.rand.nextDouble() - 0.5D) * (double)this.width, 0, 0, 0); this.posZ + (this.rand.nextDouble() - 0.5D) * (double)this.width, 0, 0, 0);
float brightness = rand.nextFloat() * 0.2f; float brightness = rand.nextFloat() * 0.2f;
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world,
this.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width, ParticleBuilder.create(Type.SPARKLE, this).vel(0, 0.05, 0).lifetime(20 + rand.nextInt(10))
this.posY + this.rand.nextDouble() * (double)this.height, .colour(brightness, 0.0f, brightness).spawn(world);
this.posZ + (this.rand.nextDouble() - 0.5D) * (double)this.width, 0, 0.05f, 0,
20 + rand.nextInt(10), brightness, 0.0f, brightness); ParticleBuilder.create(Type.DARK_MAGIC, this).colour(0.1f, 0.0f, 0.0f).spawn(world);
Wizardry.proxy.spawnParticle(WizardryParticleType.DARK_MAGIC, world,
this.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width,
this.posY + this.rand.nextDouble() * (double)this.height,
this.posZ + (this.rand.nextDouble() - 0.5D) * (double)this.width, 0.0d, 0.0d, 0.0d, 0, 0.1f,
0.0f, 0.0f);
} }
} }
@@ -4,7 +4,8 @@ import java.lang.ref.WeakReference;
import java.util.UUID; import java.util.UUID;
import electroblob.wizardry.Wizardry; import electroblob.wizardry.Wizardry;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.ParticleBuilder.Type;
import net.minecraft.entity.EntityFlying; import net.minecraft.entity.EntityFlying;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.ai.EntityAIAttackMelee; import net.minecraft.entity.ai.EntityAIAttackMelee;
@@ -119,9 +120,10 @@ public class EntitySilverfishMinion extends EntitySilverfish implements ISummone
private void spawnParticleEffect(){ private void spawnParticleEffect(){
if(this.world.isRemote){ if(this.world.isRemote){
for(int i = 0; i < 15; i++){ for(int i = 0; i < 15; i++){
Wizardry.proxy.spawnParticle(WizardryParticleType.DARK_MAGIC, world, this.posX + this.rand.nextFloat(), ParticleBuilder.create(Type.DARK_MAGIC)
this.posY + this.rand.nextFloat(), this.posZ + this.rand.nextFloat(), 0.0d, 0.0d, 0.0d, 0, 0.3f, .pos(this.posX + this.rand.nextFloat(), this.posY + this.rand.nextFloat(), this.posZ + this.rand.nextFloat())
0.3f, 0.3f); .colour(0.3f, 0.3f, 0.3f)
.spawn(world);
} }
} }
} }
@@ -4,7 +4,8 @@ import java.lang.ref.WeakReference;
import java.util.UUID; import java.util.UUID;
import electroblob.wizardry.Wizardry; import electroblob.wizardry.Wizardry;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.ParticleBuilder.Type;
import net.minecraft.entity.EntityFlying; import net.minecraft.entity.EntityFlying;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.IEntityLivingData; import net.minecraft.entity.IEntityLivingData;
@@ -147,9 +148,10 @@ public class EntitySpiderMinion extends EntityCaveSpider implements ISummonedCre
private void spawnParticleEffect(){ private void spawnParticleEffect(){
if(this.world.isRemote){ if(this.world.isRemote){
for(int i = 0; i < 15; i++){ for(int i = 0; i < 15; i++){
Wizardry.proxy.spawnParticle(WizardryParticleType.DARK_MAGIC, world, this.posX + this.rand.nextFloat(), ParticleBuilder.create(Type.DARK_MAGIC)
this.posY + this.rand.nextFloat(), this.posZ + this.rand.nextFloat(), 0.0d, 0.0d, 0.0d, 0, 0.1f, .pos(this.posX + this.rand.nextFloat(), this.posY + this.rand.nextFloat(), this.posZ + this.rand.nextFloat())
0.2f, 0.0f); .colour(0.1f, 0.2f, 0.0f)
.spawn(world);
} }
} }
} }
@@ -4,7 +4,8 @@ import electroblob.wizardry.WizardData;
import electroblob.wizardry.Wizardry; import electroblob.wizardry.Wizardry;
import electroblob.wizardry.item.ItemWand; import electroblob.wizardry.item.ItemWand;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@@ -85,17 +86,15 @@ public class EntitySpiritHorse extends EntityHorse {
if(itemstack.getItem() instanceof ItemWand && this.getOwner() == player && player.isSneaking()){ if(itemstack.getItem() instanceof ItemWand && this.getOwner() == player && player.isSneaking()){
// Prevents accidental double clicking. // Prevents accidental double clicking.
if(this.ticksExisted > 20){ if(this.ticksExisted > 20){
for(int i = 0; i < 15; i++){
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, this.spawnAppearParticles();
this.posX - this.width / 2 + this.rand.nextFloat() * width,
this.posY + this.height * this.rand.nextFloat() + 0.2f,
this.posZ - this.width / 2 + this.rand.nextFloat() * width, 0, 0, 0,
48 + this.rand.nextInt(12), 0.8f, 0.8f, 1.0f);
}
this.setDead(); this.setDead();
if(WizardData.get(player) != null){ if(WizardData.get(player) != null){
WizardData.get(player).hasSpiritHorse = false; WizardData.get(player).hasSpiritHorse = false;
} }
this.playSound(WizardrySounds.SPELL_HEAL, 0.7F, rand.nextFloat() * 0.4F + 1.0F); this.playSound(WizardrySounds.SPELL_HEAL, 0.7F, rand.nextFloat() * 0.4F + 1.0F);
// This is necessary to prevent the wand's spell being cast when performing this action. // This is necessary to prevent the wand's spell being cast when performing this action.
return true; return true;
@@ -106,6 +105,15 @@ public class EntitySpiritHorse extends EntityHorse {
return super.processInteract(player, hand); return super.processInteract(player, hand);
} }
private void spawnAppearParticles(){
for(int i=0; i<15; i++){
double x = this.posX - this.width / 2 + this.rand.nextFloat() * width;
double y = this.posY + this.height * this.rand.nextFloat() + 0.2f;
double z = this.posZ - this.width / 2 + this.rand.nextFloat() * width;
ParticleBuilder.create(Type.SPARKLE).pos(x, y, z).colour(0.8f, 0.8f, 1.0f).spawn(world);
}
}
@Override @Override
public void onDeath(DamageSource par1DamageSource){ public void onDeath(DamageSource par1DamageSource){
@@ -137,10 +145,10 @@ public class EntitySpiritHorse extends EntityHorse {
// Adds a dust particle effect // Adds a dust particle effect
if(this.world.isRemote){ if(this.world.isRemote){
Wizardry.proxy.spawnParticle(WizardryParticleType.DUST, world, double x = this.posX - this.width / 2 + this.rand.nextFloat() * width;
this.posX - this.width / 2 + this.rand.nextFloat() * width, double y = this.posY + this.height * this.rand.nextFloat() + 0.2f;
this.posY + this.height * this.rand.nextFloat() + 0.2f, double z = this.posZ - this.width / 2 + this.rand.nextFloat() * width;
this.posZ - this.width / 2 + this.rand.nextFloat() * width, 0, 0, 0, 0, 0.8f, 0.8f, 1.0f); ParticleBuilder.create(Type.DUST).pos(x, y, z).colour(0.8f, 0.8f, 1.0f).shaded(true).spawn(world);
} }
// Spirit horse disappears a short time after being dismounted. // Spirit horse disappears a short time after being dismounted.
@@ -151,20 +159,17 @@ public class EntitySpiritHorse extends EntityHorse {
} }
if(this.idleTimer > 200){ if(this.idleTimer > 200){
if(this.world.isRemote){ if(this.world.isRemote){
for(int i = 0; i < 15; i++){ this.spawnAppearParticles();
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world,
this.posX - this.width / 2 + this.rand.nextFloat() * width,
this.posY + this.height * this.rand.nextFloat() + 0.2f,
this.posZ - this.width / 2 + this.rand.nextFloat() * width, 0, 0, 0,
48 + this.rand.nextInt(12), 0.8f, 0.8f, 1.0f);
}
} }
this.playSound(WizardrySounds.SPELL_HEAL, 0.7F, rand.nextFloat() * 0.4F + 1.0F); this.playSound(WizardrySounds.SPELL_HEAL, 0.7F, rand.nextFloat() * 0.4F + 1.0F);
// Allows player to summon another spirit horse once this one has disappeared. // Allows player to summon another spirit horse once this one has disappeared.
if(this.getOwner() instanceof EntityPlayer && WizardData.get((EntityPlayer)this.getOwner()) != null){ if(this.getOwner() instanceof EntityPlayer && WizardData.get((EntityPlayer)this.getOwner()) != null){
WizardData.get((EntityPlayer)this.getOwner()).hasSpiritHorse = false; WizardData.get((EntityPlayer)this.getOwner()).hasSpiritHorse = false;
} }
this.setDead(); this.setDead();
} }
} }
@@ -179,13 +184,7 @@ public class EntitySpiritHorse extends EntityHorse {
// Adds Particles on spawn. Due to client/server differences this cannot be done in the item. // Adds Particles on spawn. Due to client/server differences this cannot be done in the item.
if(this.world.isRemote){ if(this.world.isRemote){
for(int i = 0; i < 15; i++){ this.spawnAppearParticles();
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world,
this.posX - this.width / 2 + this.rand.nextFloat() * width,
this.posY + this.height * this.rand.nextFloat() + 0.2f,
this.posZ - this.width / 2 + this.rand.nextFloat() * width, 0, 0, 0, 48 + this.rand.nextInt(12),
0.8f, 0.8f, 1.0f);
}
} }
return super.onInitialSpawn(difficulty, data); return super.onInitialSpawn(difficulty, data);
@@ -4,7 +4,8 @@ import electroblob.wizardry.WizardData;
import electroblob.wizardry.Wizardry; import electroblob.wizardry.Wizardry;
import electroblob.wizardry.item.ItemWand; import electroblob.wizardry.item.ItemWand;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.ParticleBuilder.Type;
import net.minecraft.entity.EntityAgeable; import net.minecraft.entity.EntityAgeable;
import net.minecraft.entity.IEntityLivingData; import net.minecraft.entity.IEntityLivingData;
import net.minecraft.entity.ai.EntityAIAttackMelee; import net.minecraft.entity.ai.EntityAIAttackMelee;
@@ -81,18 +82,21 @@ public class EntitySpiritWolf extends EntityWolf {
// Adds Particles on spawn. Due to client/server differences this cannot be done // Adds Particles on spawn. Due to client/server differences this cannot be done
// in the item. // in the item.
if(this.world.isRemote){ if(this.world.isRemote){
for(int i = 0; i < 15; i++){ this.spawnAppearParticles();
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world,
this.posX - this.width / 2 + this.rand.nextFloat() * width,
this.posY + this.height * this.rand.nextFloat() + 0.2f,
this.posZ - this.width / 2 + this.rand.nextFloat() * width, 0, 0, 0, 48 + this.rand.nextInt(12),
0.8f, 0.8f, 1.0f);
}
} }
return livingdata; return livingdata;
} }
private void spawnAppearParticles(){
for(int i=0; i<15; i++){
double x = this.posX - this.width / 2 + this.rand.nextFloat() * width;
double y = this.posY + this.height * this.rand.nextFloat() + 0.2f;
double z = this.posZ - this.width / 2 + this.rand.nextFloat() * width;
ParticleBuilder.create(Type.SPARKLE).pos(x, y, z).colour(0.8f, 0.8f, 1.0f).spawn(world);
}
}
@Override @Override
public void onUpdate(){ public void onUpdate(){
@@ -100,10 +104,10 @@ public class EntitySpiritWolf extends EntityWolf {
// Adds a dust particle effect // Adds a dust particle effect
if(this.world.isRemote){ if(this.world.isRemote){
Wizardry.proxy.spawnParticle(WizardryParticleType.DUST, world, double x = this.posX - this.width / 2 + this.rand.nextFloat() * width;
this.posX - this.width / 2 + this.rand.nextFloat() * width, double y = this.posY + this.height * this.rand.nextFloat() + 0.2f;
this.posY + this.height * this.rand.nextFloat() + 0.2f, double z = this.posZ - this.width / 2 + this.rand.nextFloat() * width;
this.posZ - this.width / 2 + this.rand.nextFloat() * width, 0, 0, 0, 0, 0.8f, 0.8f, 1.0f); ParticleBuilder.create(Type.DUST).pos(x, y, z).colour(0.8f, 0.8f, 1.0f).shaded(true).spawn(world);
} }
} }
@@ -119,17 +123,17 @@ public class EntitySpiritWolf extends EntityWolf {
if(stack.getItem() instanceof ItemWand && this.getOwner() == player && player.isSneaking()){ if(stack.getItem() instanceof ItemWand && this.getOwner() == player && player.isSneaking()){
// Prevents accidental double clicking. // Prevents accidental double clicking.
if(this.ticksExisted > 20){ if(this.ticksExisted > 20){
for(int i = 0; i < 10; i++){
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, if(this.world.isRemote){
this.posX - this.width / 2 + this.rand.nextFloat() * width, this.spawnAppearParticles();
this.posY + this.height * this.rand.nextFloat() + 0.2f,
this.posZ - this.width / 2 + this.rand.nextFloat() * width, 0, 0, 0,
48 + this.rand.nextInt(12), 0.8f, 0.8f, 1.0f);
} }
this.setDead(); this.setDead();
if(WizardData.get(player) != null){ if(WizardData.get(player) != null){
WizardData.get(player).hasSpiritWolf = false; WizardData.get(player).hasSpiritWolf = false;
} }
this.playSound(WizardrySounds.SPELL_HEAL, 0.7F, rand.nextFloat() * 0.4F + 1.0F); this.playSound(WizardrySounds.SPELL_HEAL, 0.7F, rand.nextFloat() * 0.4F + 1.0F);
// This is necessary to prevent the wand's spell being cast when performing this // This is necessary to prevent the wand's spell being cast when performing this
// action. // action.
@@ -3,12 +3,12 @@ package electroblob.wizardry.entity.living;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import electroblob.wizardry.Wizardry;
import electroblob.wizardry.registry.Spells; import electroblob.wizardry.registry.Spells;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.spell.Spell; import electroblob.wizardry.spell.Spell;
import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.EntityAIAttackMelee; import net.minecraft.entity.ai.EntityAIAttackMelee;
@@ -135,22 +135,23 @@ public class EntityStormElemental extends EntitySummonedCreature implements ISpe
if(world.isRemote){ if(world.isRemote){
for(int i = 0; i < 2; ++i){ for(int i=0; i<2; ++i){
world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, world.spawnParticle(EnumParticleTypes.SMOKE_LARGE,
this.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width, this.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width,
this.posY + this.rand.nextDouble() * (double)this.height, this.posY + this.rand.nextDouble() * (double)this.height,
this.posZ + (this.rand.nextDouble() - 0.5D) * (double)this.width, 0, 0, 0); this.posZ + (this.rand.nextDouble() - 0.5D) * (double)this.width, 0, 0, 0);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world,
this.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width, ParticleBuilder.create(Type.SPARK, this).spawn(world);
this.posY + this.rand.nextDouble() * (double)this.height,
this.posZ + (this.rand.nextDouble() - 0.5D) * (double)this.width, 0.0d, 0.0d, 0.0d, 0, 0, 0, 0);
} }
for(int i = 0; i < 10; i++){ for(int i=0; i<10; i++){
float brightness = rand.nextFloat() * 0.2f; float brightness = rand.nextFloat() * 0.2f;
double dy = this.rand.nextDouble() * (double)this.height; double dy = this.rand.nextDouble() * (double)this.height;
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE_ROTATING, world, this.posX, this.posY + dy,
this.posZ, 0, 0, 0, 20 + rand.nextInt(10), 0, brightness, brightness, false, 0.2f + 0.5f * dy); ParticleBuilder.create(Type.SPARKLE_ROTATING).pos(this.posX, this.posY + dy, this.posZ)
.lifetime(20 + rand.nextInt(10)).colour(0, brightness, brightness).radius(0.2f + 0.5f * dy).spawn(world);
} }
} }
@@ -21,10 +21,11 @@ import electroblob.wizardry.registry.WizardryItems;
import electroblob.wizardry.registry.WizardryPotions; import electroblob.wizardry.registry.WizardryPotions;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.spell.Spell; import electroblob.wizardry.spell.Spell;
import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WandHelper; import electroblob.wizardry.util.WandHelper;
import electroblob.wizardry.util.WildcardTradeList; import electroblob.wizardry.util.WildcardTradeList;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
@@ -245,20 +246,19 @@ public class EntityWizard extends EntityVillager implements ISpellCaster, IEntit
// deathTime == 0 checks the wizard isn't currently dying // deathTime == 0 checks the wizard isn't currently dying
}else if(healCooldown == -1 && this.deathTime == 0){ }else if(healCooldown == -1 && this.deathTime == 0){
// Heal particles // Heal particles TODO: Change this so it uses the heal spell directly
if(world.isRemote){ if(world.isRemote){
for(int i = 0; i < 10; i++){ for(int i=0; i<10; i++){
double d0 = (double)((float)this.posX + rand.nextFloat() * 2 - 1.0F); double x = (double)((float)this.posX + rand.nextFloat() * 2 - 1.0F);
// Apparently the client side spawns the particles 1 block higher than it should... hence the - // Apparently the client side spawns the particles 1 block higher than it should... hence the -
// 0.5F. // 0.5F.
double d1 = (double)((float)this.posY - 0.5F + rand.nextFloat()); double y = (double)((float)this.posY - 0.5F + rand.nextFloat());
double d2 = (double)((float)this.posZ + rand.nextFloat() * 2 - 1.0F); double z = (double)((float)this.posZ + rand.nextFloat() * 2 - 1.0F);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, d0, d1, d2, 0, 0.1F, 0, ParticleBuilder.create(Type.SPARKLE).pos(x, y, z).vel(0, 0.1F, 0).colour(1, 1, 0.3f).spawn(world);
48 + rand.nextInt(12), 1.0f, 1.0f, 0.3f);
} }
}else{ }else{
if(this.getHealth() < 10){ if(this.getHealth() < 10){
// Wizard heals himself more often if he has low health // Wizards heal themseselves more often if they have low health
this.setHealCooldown(150); this.setHealCooldown(150);
}else{ }else{
this.setHealCooldown(400); this.setHealCooldown(400);
@@ -16,7 +16,8 @@ import electroblob.wizardry.util.IElementalDamage;
import electroblob.wizardry.util.IndirectMinionDamage; import electroblob.wizardry.util.IndirectMinionDamage;
import electroblob.wizardry.util.MagicDamage.DamageType; import electroblob.wizardry.util.MagicDamage.DamageType;
import electroblob.wizardry.util.MinionDamage; import electroblob.wizardry.util.MinionDamage;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
@@ -288,9 +289,10 @@ public interface ISummonedCreature extends IEntityAdditionalSpawnData {
} }
if(this.hasParticleEffect() && thisEntity.world.isRemote && thisEntity.world.rand.nextInt(8) == 0) if(this.hasParticleEffect() && thisEntity.world.isRemote && thisEntity.world.rand.nextInt(8) == 0)
Wizardry.proxy.spawnParticle(WizardryParticleType.DARK_MAGIC, thisEntity.world, thisEntity.posX, ParticleBuilder.create(Type.DARK_MAGIC)
thisEntity.posY + thisEntity.world.rand.nextDouble() * 1.5, thisEntity.posZ, 0.0d, 0.0d, 0.0d, 0, .pos(thisEntity.posX, thisEntity.posY + thisEntity.world.rand.nextDouble() * 1.5, thisEntity.posZ)
0.1f, 0.0f, 0.0f); .colour(0.1f, 0.0f, 0.0f)
.spawn(thisEntity.world);
} }
@@ -1,9 +1,9 @@
package electroblob.wizardry.entity.projectile; package electroblob.wizardry.entity.projectile;
import electroblob.wizardry.Wizardry;
import electroblob.wizardry.util.MagicDamage; import electroblob.wizardry.util.MagicDamage;
import electroblob.wizardry.util.MagicDamage.DamageType; import electroblob.wizardry.util.MagicDamage.DamageType;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.ParticleBuilder.Type;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.init.MobEffects; import net.minecraft.init.MobEffects;
@@ -13,6 +13,7 @@ import net.minecraft.util.math.RayTraceResult;
import net.minecraft.world.World; import net.minecraft.world.World;
public class EntityDarknessOrb extends EntityMagicProjectile { public class EntityDarknessOrb extends EntityMagicProjectile {
public EntityDarknessOrb(World par1World){ public EntityDarknessOrb(World par1World){
super(par1World); super(par1World);
} }
@@ -59,17 +60,13 @@ public class EntityDarknessOrb extends EntityMagicProjectile {
super.onUpdate(); super.onUpdate();
if(world.isRemote){ if(world.isRemote){
float brightness = rand.nextFloat() * 0.2f; float brightness = rand.nextFloat() * 0.2f;
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world,
this.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width, ParticleBuilder.create(Type.SPARKLE, this).lifetime(20 + rand.nextInt(10))
this.posY + this.rand.nextDouble() * (double)this.height, .colour(brightness, 0.0f, brightness).spawn(world);
this.posZ + (this.rand.nextDouble() - 0.5D) * (double)this.width, 0, 0, 0, 20 + rand.nextInt(10),
brightness, 0.0f, brightness); ParticleBuilder.create(Type.DARK_MAGIC, this).colour(0.1f, 0.0f, 0.0f).spawn(world);
Wizardry.proxy.spawnParticle(WizardryParticleType.DARK_MAGIC, world,
this.posX + (this.rand.nextDouble() - 0.5D) * (double)this.width,
this.posY + this.rand.nextDouble() * (double)this.height,
this.posZ + (this.rand.nextDouble() - 0.5D) * (double)this.width, 0.0d, 0.0d, 0.0d, 0, 0.1f, 0.0f,
0.0f);
} }
if(this.ticksExisted > 150){ if(this.ticksExisted > 150){
@@ -1,8 +1,8 @@
package electroblob.wizardry.entity.projectile; package electroblob.wizardry.entity.projectile;
import electroblob.wizardry.Wizardry;
import electroblob.wizardry.util.MagicDamage.DamageType; import electroblob.wizardry.util.MagicDamage.DamageType;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.ParticleBuilder.Type;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.init.MobEffects; import net.minecraft.init.MobEffects;
@@ -56,10 +56,8 @@ public class EntityDart extends EntityMagicArrow {
@Override @Override
public void tickInAir(){ public void tickInAir(){
if(this.world.isRemote){ if(this.world.isRemote){
Wizardry.proxy.spawnParticle(WizardryParticleType.LEAF, world, this.posX, this.posY, this.posZ, 0, -0.03, 0, ParticleBuilder.create(Type.LEAF).pos(this.posX, this.posY, this.posZ).lifetime(10 + rand.nextInt(5));
10 + rand.nextInt(5));
} }
} }
@@ -2,10 +2,10 @@ package electroblob.wizardry.entity.projectile;
import java.util.List; import java.util.List;
import electroblob.wizardry.Wizardry;
import electroblob.wizardry.util.MagicDamage; import electroblob.wizardry.util.MagicDamage;
import electroblob.wizardry.util.MagicDamage.DamageType; import electroblob.wizardry.util.MagicDamage.DamageType;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@@ -33,10 +33,9 @@ public class EntityFirebomb extends EntityBomb {
super(par1World, par2, par4, par6); super(par1World, par2, par4, par6);
} }
/** @Override
* Called when this EntityThrowable hits a block or entity.
*/
protected void onImpact(RayTraceResult par1RayTraceResult){ protected void onImpact(RayTraceResult par1RayTraceResult){
Entity entityHit = par1RayTraceResult.entityHit; Entity entityHit = par1RayTraceResult.entityHit;
if(entityHit != null){ if(entityHit != null){
@@ -52,21 +51,16 @@ public class EntityFirebomb extends EntityBomb {
// Particle effect // Particle effect
if(world.isRemote){ if(world.isRemote){
this.world.spawnParticle(EnumParticleTypes.EXPLOSION_LARGE, this.posX, this.posY, this.posZ, 0, 0, 0); this.world.spawnParticle(EnumParticleTypes.EXPLOSION_LARGE, this.posX, this.posY, this.posZ, 0, 0, 0);
for(int i = 0; i < 60 * blastMultiplier; i++){ for(int i = 0; i < 60 * blastMultiplier; i++){
// this.world.spawnParticle(EnumParticleTypes.FLAME, this.posX + (this.rand.nextDouble()*4 -
// 2)*blastMultiplier, this.posY + (this.rand.nextDouble()*4 - 2)*blastMultiplier, this.posZ + ParticleBuilder.create(Type.MAGIC_FIRE, rand, posX, posY, posZ, 2*blastMultiplier, false)
// (this.rand.nextDouble()*4 - 2)*blastMultiplier, 0, 0, 0); .lifetime(15 + rand.nextInt(5)).scale(2 + rand.nextFloat()).spawn(world);
Wizardry.proxy.spawnParticle(WizardryParticleType.MAGIC_FIRE, world,
this.posX + (this.rand.nextDouble() * 4 - 2) * blastMultiplier, ParticleBuilder.create(Type.DARK_MAGIC, rand, posX, posY, posZ, 2*blastMultiplier, false)
this.posY + (this.rand.nextDouble() * 4 - 2) * blastMultiplier, .colour(1.0f, 0.2f + rand.nextFloat() * 0.4f, 0.0f).spawn(world);
this.posZ + (this.rand.nextDouble() * 4 - 2) * blastMultiplier, 0, 0, 0, 15 + rand.nextInt(5),
2 + rand.nextFloat(), 0, 0);
Wizardry.proxy.spawnParticle(WizardryParticleType.DARK_MAGIC, world,
this.posX + (this.rand.nextDouble() * 4 - 2) * blastMultiplier,
this.posY + (this.rand.nextDouble() * 4 - 2) * blastMultiplier,
this.posZ + (this.rand.nextDouble() * 4 - 2) * blastMultiplier, 0.0d, 0.0d, 0.0d, 0, 1.0f,
0.2f + rand.nextFloat() * 0.4f, 0.0f);
} }
} }
@@ -2,10 +2,10 @@ package electroblob.wizardry.entity.projectile;
import java.util.List; import java.util.List;
import electroblob.wizardry.Wizardry;
import electroblob.wizardry.util.MagicDamage; import electroblob.wizardry.util.MagicDamage;
import electroblob.wizardry.util.MagicDamage.DamageType; import electroblob.wizardry.util.MagicDamage.DamageType;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.init.SoundEvents; import net.minecraft.init.SoundEvents;
@@ -54,11 +54,8 @@ public class EntityForceOrb extends EntityMagicProjectile {
if(this.world.isRemote){ if(this.world.isRemote){
for(int j = 0; j < 20; j++){ for(int j = 0; j < 20; j++){
float brightness = 0.5f + (rand.nextFloat() / 2); float brightness = 0.5f + (rand.nextFloat() / 2);
double x = this.posX - 0.25d + (rand.nextDouble() / 2); ParticleBuilder.create(Type.SPARKLE, rand, posX, posY, posZ, 0.25, true).lifetime(6)
double y = this.posY - 0.25d + (rand.nextDouble() / 2); .colour(brightness, 1.0f, brightness + 0.2f).spawn(world);
double z = this.posZ - 0.25d + (rand.nextDouble() / 2);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x, y, z, (x - this.posX) * 2,
(y - this.posY) * 2, (z - this.posZ) * 2, 6, brightness, 1.0f, brightness + 0.2f);
} }
this.world.spawnParticle(EnumParticleTypes.EXPLOSION_LARGE, this.posX, this.posY, this.posZ, 0, 0, 0); this.world.spawnParticle(EnumParticleTypes.EXPLOSION_LARGE, this.posX, this.posY, this.posZ, 0, 0, 0);
} }
@@ -2,12 +2,12 @@ package electroblob.wizardry.entity.projectile;
import java.util.List; import java.util.List;
import electroblob.wizardry.Wizardry;
import electroblob.wizardry.registry.WizardryPotions; import electroblob.wizardry.registry.WizardryPotions;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.MagicDamage; import electroblob.wizardry.util.MagicDamage;
import electroblob.wizardry.util.MagicDamage.DamageType; import electroblob.wizardry.util.MagicDamage.DamageType;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@@ -60,16 +60,13 @@ public class EntityIceCharge extends EntityBomb {
if(world.isRemote){ if(world.isRemote){
this.world.spawnParticle(EnumParticleTypes.EXPLOSION_LARGE, this.posX, this.posY, this.posZ, 0, 0, 0); this.world.spawnParticle(EnumParticleTypes.EXPLOSION_LARGE, this.posX, this.posY, this.posZ, 0, 0, 0);
for(int i = 0; i < 30 * blastMultiplier; i++){ for(int i = 0; i < 30 * blastMultiplier; i++){
ParticleBuilder.create(Type.ICE, rand, this.posX, this.posY, this.posZ, 2 * blastMultiplier, false)
.lifetime(35).spawn(world);
float brightness = 0.4f + rand.nextFloat() * 0.5f; float brightness = 0.4f + rand.nextFloat() * 0.5f;
Wizardry.proxy.spawnParticle(WizardryParticleType.ICE, world, ParticleBuilder.create(Type.DARK_MAGIC, rand, this.posX, this.posY, this.posZ, 2 * blastMultiplier, false)
this.posX + (this.rand.nextDouble() * 4 - 2) * blastMultiplier, .colour(brightness, brightness + 0.1f, 1.0f).spawn(world);
this.posY + (this.rand.nextDouble() * 4 - 2) * blastMultiplier,
this.posZ + (this.rand.nextDouble() * 4 - 2) * blastMultiplier, 0.0d, 0.0d, 0.0d, 35);
Wizardry.proxy.spawnParticle(WizardryParticleType.DARK_MAGIC, world,
this.posX + (this.rand.nextDouble() * 4 - 2) * blastMultiplier,
this.posY + (this.rand.nextDouble() * 4 - 2) * blastMultiplier,
this.posZ + (this.rand.nextDouble() * 4 - 2) * blastMultiplier, 0.0d, 0.0d, 0.0d, 0, brightness,
brightness + 0.1f, 1.0f);
} }
} }
@@ -1,10 +1,10 @@
package electroblob.wizardry.entity.projectile; package electroblob.wizardry.entity.projectile;
import electroblob.wizardry.Wizardry;
import electroblob.wizardry.registry.WizardryPotions; import electroblob.wizardry.registry.WizardryPotions;
import electroblob.wizardry.util.MagicDamage; import electroblob.wizardry.util.MagicDamage;
import electroblob.wizardry.util.MagicDamage.DamageType; import electroblob.wizardry.util.MagicDamage.DamageType;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.ParticleBuilder.Type;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.init.SoundEvents; import net.minecraft.init.SoundEvents;
@@ -68,11 +68,8 @@ public class EntityIceLance extends EntityMagicArrow {
// Adds a particle effect when the ice lance hits a block. // Adds a particle effect when the ice lance hits a block.
if(this.world.isRemote){ if(this.world.isRemote){
for(int j = 0; j < 10; j++){ for(int j = 0; j < 10; j++){
double x = this.posX - 0.25d + (rand.nextDouble() / 2); ParticleBuilder.create(Type.ICE, this.rand, this.posX, this.posY, this.posZ, 0.5, true)
double y = this.posY - 0.25d + (rand.nextDouble() / 2); .lifetime(20 + rand.nextInt(10)).spawn(world);
double z = this.posZ - 0.25d + (rand.nextDouble() / 2);
Wizardry.proxy.spawnParticle(WizardryParticleType.ICE, world, x, y, z, x - this.posX, y - this.posY,
z - this.posZ, 20 + rand.nextInt(10));
} }
} }
// Parameters for sound: sound event name, volume, pitch. // Parameters for sound: sound event name, volume, pitch.
@@ -1,10 +1,10 @@
package electroblob.wizardry.entity.projectile; package electroblob.wizardry.entity.projectile;
import electroblob.wizardry.Wizardry;
import electroblob.wizardry.registry.WizardryPotions; import electroblob.wizardry.registry.WizardryPotions;
import electroblob.wizardry.util.MagicDamage; import electroblob.wizardry.util.MagicDamage;
import electroblob.wizardry.util.MagicDamage.DamageType; import electroblob.wizardry.util.MagicDamage.DamageType;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.ParticleBuilder.Type;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.init.SoundEvents; import net.minecraft.init.SoundEvents;
@@ -64,11 +64,8 @@ public class EntityIceShard extends EntityMagicArrow {
// Adds a particle effect when the ice shard hits a block. // Adds a particle effect when the ice shard hits a block.
if(this.world.isRemote){ if(this.world.isRemote){
for(int j = 0; j < 10; j++){ for(int j = 0; j < 10; j++){
double x = this.posX - 0.25d + (rand.nextDouble() / 2); ParticleBuilder.create(Type.ICE, this.rand, this.posX, this.posY, this.posZ, 0.5, true)
double y = this.posY - 0.25d + (rand.nextDouble() / 2); .lifetime(20 + rand.nextInt(10)).spawn(world);
double z = this.posZ - 0.25d + (rand.nextDouble() / 2);
Wizardry.proxy.spawnParticle(WizardryParticleType.ICE, world, x, y, z, x - this.posX, y - this.posY,
z - this.posZ, 20 + rand.nextInt(10));
} }
} }
// Parameters for sound: sound event name, volume, pitch. // Parameters for sound: sound event name, volume, pitch.
@@ -1,9 +1,9 @@
package electroblob.wizardry.entity.projectile; package electroblob.wizardry.entity.projectile;
import electroblob.wizardry.Wizardry;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.MagicDamage.DamageType; import electroblob.wizardry.util.MagicDamage.DamageType;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.ParticleBuilder.Type;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.world.World; import net.minecraft.world.World;
@@ -46,15 +46,10 @@ public class EntityLightningArrow extends EntityMagicArrow {
if(world.isRemote){ if(world.isRemote){
for(int j = 0; j < 8; j++){ for(int j = 0; j < 8; j++){
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world, this.posX + rand.nextFloat() - 0.5, ParticleBuilder.create(Type.SPARK, rand, posX, posY + height / 2, posZ, 1, false).spawn(world);
this.posY + this.height / 2 + rand.nextFloat() - 0.5, this.posZ + rand.nextFloat() - 0.5, 0, 0,
0, 3);
} }
} }
/* Pretty sure this needn't be here, probably missed it when I implemented the damage type system. if(entityHit
* instanceof EntityCreeper && !((EntityCreeper)entityHit).getPowered()){
* entityHit.getDataWatcher().updateObject(17, Byte.valueOf((byte)1)); if(this.getShootingEntity() instanceof
* EntityPlayer) ((EntityPlayer)this.getShootingEntity()).addStat(Wizardry.chargeCreeper); } */
this.playSound(WizardrySounds.SPELL_SPARK, 1.0F, 1.0F); this.playSound(WizardrySounds.SPELL_SPARK, 1.0F, 1.0F);
} }
@@ -66,8 +61,7 @@ public class EntityLightningArrow extends EntityMagicArrow {
} }
if(world.isRemote){ if(world.isRemote){
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world, this.posX, this.posY, this.posZ, 0, 0, 0, ParticleBuilder.create(Type.SPARK).pos(posX, posY, posZ).spawn(world);
3);
} }
} }
@@ -2,11 +2,11 @@ package electroblob.wizardry.entity.projectile;
import java.util.List; import java.util.List;
import electroblob.wizardry.Wizardry;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.MagicDamage; import electroblob.wizardry.util.MagicDamage;
import electroblob.wizardry.util.MagicDamage.DamageType; import electroblob.wizardry.util.MagicDamage.DamageType;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@@ -14,6 +14,7 @@ import net.minecraft.util.math.RayTraceResult;
import net.minecraft.world.World; import net.minecraft.world.World;
public class EntityLightningDisc extends EntityMagicProjectile { public class EntityLightningDisc extends EntityMagicProjectile {
public EntityLightningDisc(World par1World){ public EntityLightningDisc(World par1World){
super(par1World); super(par1World);
} }
@@ -38,8 +39,9 @@ public class EntityLightningDisc extends EntityMagicProjectile {
} }
@Override @Override
protected void onImpact(RayTraceResult mop){ protected void onImpact(RayTraceResult result){
Entity entityHit = mop.entityHit;
Entity entityHit = result.entityHit;
if(entityHit != null){ if(entityHit != null){
float damage = 12 * damageMultiplier; float damage = 12 * damageMultiplier;
@@ -50,7 +52,7 @@ public class EntityLightningDisc extends EntityMagicProjectile {
this.playSound(WizardrySounds.SPELL_SPARK, 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F)); this.playSound(WizardrySounds.SPELL_SPARK, 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F));
if(mop.typeOfHit == RayTraceResult.Type.BLOCK) this.setDead(); if(result.typeOfHit == RayTraceResult.Type.BLOCK) this.setDead();
} }
@Override @Override
@@ -61,10 +63,9 @@ public class EntityLightningDisc extends EntityMagicProjectile {
// Particle effect // Particle effect
if(world.isRemote){ if(world.isRemote){
for(int i = 0; i < 8; i++){ for(int i = 0; i < 8; i++){
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world, this.posX + rand.nextFloat() * 2 - 1, // TODO: Why are the x and z parameters different?
this.posY, this.posZ + rand.nextFloat() - 0.5, 0, 0, 0, 3); ParticleBuilder.create(Type.SPARK).pos(this.posX + rand.nextFloat() * 2 - 1,
// world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, this.posX + rand.nextFloat() - 0.5, this.posY + this.posY, this.posZ + rand.nextFloat() - 0.5).spawn(world);
// this.height/2 + rand.nextFloat() - 0.5, this.posZ + rand.nextFloat() - 0.5, 0, 0, 0);
} }
} }
@@ -1,7 +1,7 @@
package electroblob.wizardry.entity.projectile; package electroblob.wizardry.entity.projectile;
import electroblob.wizardry.Wizardry; import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.init.SoundEvents; import net.minecraft.init.SoundEvents;
@@ -53,16 +53,8 @@ public class EntityMagicMissile extends EntityMagicArrow {
} }
if(this.world.isRemote){ if(this.world.isRemote){
ParticleBuilder.create(Type.SPARKLE).pos(this.posX, this.posY, this.posZ).lifetime(20 + rand.nextInt(10))
if(this.ticksExisted % 2 == 1){ .colour(0.5f + (rand.nextFloat() / 2), 0.5f + (rand.nextFloat() / 2), 0.5f + (rand.nextFloat() / 2)).spawn(world);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, this.posX, this.posY, this.posZ, 0, 0,
0, 20 + rand.nextInt(10), 0.5f + (rand.nextFloat() / 2), 0.5f + (rand.nextFloat() / 2),
0.5f + (rand.nextFloat() / 2));
}else{
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, this.posX, this.posY, this.posZ, 0, 0,
0, 20 + rand.nextInt(10), 0.5f + (rand.nextFloat() / 2), 0.5f + (rand.nextFloat() / 2),
0.5f + (rand.nextFloat() / 2));
}
} }
} }
@@ -2,10 +2,10 @@ package electroblob.wizardry.entity.projectile;
import java.util.List; import java.util.List;
import electroblob.wizardry.Wizardry;
import electroblob.wizardry.util.MagicDamage; import electroblob.wizardry.util.MagicDamage;
import electroblob.wizardry.util.MagicDamage.DamageType; import electroblob.wizardry.util.MagicDamage.DamageType;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@@ -54,16 +54,12 @@ public class EntityPoisonBomb extends EntityBomb {
// Particle effect // Particle effect
if(world.isRemote){ if(world.isRemote){
for(int i = 0; i < 60 * blastMultiplier; i++){ for(int i = 0; i < 60 * blastMultiplier; i++){
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world,
this.posX + (this.rand.nextDouble() * 4 - 2) * blastMultiplier, ParticleBuilder.create(Type.SPARKLE, rand, posX, posY, posZ, 2*blastMultiplier, false).lifetime(35)
this.posY + (this.rand.nextDouble() * 4 - 2) * blastMultiplier, .colour(0.2f + rand.nextFloat() * 0.3f, 0.6f, 0.0f).spawn(world);
this.posZ + (this.rand.nextDouble() * 4 - 2) * blastMultiplier, 0.0d, 0.0d, 0.0d, 35,
0.2f + rand.nextFloat() * 0.3f, 0.6f, 0.0f); ParticleBuilder.create(Type.DARK_MAGIC, rand, posX, posY, posZ, 2*blastMultiplier, false)
Wizardry.proxy.spawnParticle(WizardryParticleType.DARK_MAGIC, world, .colour(0.2f + rand.nextFloat() * 0.2f, 0.8f, 0.0f).spawn(world);
this.posX + (this.rand.nextDouble() * 4 - 2) * blastMultiplier,
this.posY + (this.rand.nextDouble() * 4 - 2) * blastMultiplier,
this.posZ + (this.rand.nextDouble() * 4 - 2) * blastMultiplier, 0.0d, 0.0d, 0.0d, 0,
0.2f + rand.nextFloat() * 0.2f, 0.8f, 0.0f);
} }
// Spawning this after the other particles fixes the rendering colour bug. It's a bit of a cheat, but it // Spawning this after the other particles fixes the rendering colour bug. It's a bit of a cheat, but it
// works pretty well. // works pretty well.
@@ -2,9 +2,9 @@ package electroblob.wizardry.entity.projectile;
import java.util.List; import java.util.List;
import electroblob.wizardry.Wizardry;
import electroblob.wizardry.registry.WizardryPotions; import electroblob.wizardry.registry.WizardryPotions;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@@ -42,16 +42,15 @@ public class EntitySmokeBomb extends EntityBomb {
if(world.isRemote){ if(world.isRemote){
this.world.spawnParticle(EnumParticleTypes.EXPLOSION_LARGE, this.posX, this.posY, this.posZ, 0, 0, 0); this.world.spawnParticle(EnumParticleTypes.EXPLOSION_LARGE, this.posX, this.posY, this.posZ, 0, 0, 0);
for(int i = 0; i < 60 * blastMultiplier; i++){ for(int i = 0; i < 60 * blastMultiplier; i++){
this.world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, this.world.spawnParticle(EnumParticleTypes.SMOKE_LARGE,
this.posX + (this.rand.nextDouble() * 4 - 2) * blastMultiplier, this.posX + (this.rand.nextDouble() * 4 - 2) * blastMultiplier,
this.posY + (this.rand.nextDouble() * 4 - 2) * blastMultiplier, this.posY + (this.rand.nextDouble() * 4 - 2) * blastMultiplier,
this.posZ + (this.rand.nextDouble() * 4 - 2) * blastMultiplier, 0, 0, 0); this.posZ + (this.rand.nextDouble() * 4 - 2) * blastMultiplier, 0, 0, 0);
float brightness = rand.nextFloat() * 0.3f; float brightness = rand.nextFloat() * 0.3f;
Wizardry.proxy.spawnParticle(WizardryParticleType.DARK_MAGIC, world, ParticleBuilder.create(Type.DARK_MAGIC, rand, posX, posY, posZ, 2*blastMultiplier, false)
this.posX + (this.rand.nextDouble() * 4 - 2) * blastMultiplier, .colour(brightness, brightness, brightness).spawn(world);
this.posY + (this.rand.nextDouble() * 4 - 2) * blastMultiplier,
this.posZ + (this.rand.nextDouble() * 4 - 2) * blastMultiplier, 0.0d, 0.0d, 0.0d, 0, brightness,
brightness, brightness);
} }
} }
@@ -2,11 +2,11 @@ package electroblob.wizardry.entity.projectile;
import java.util.List; import java.util.List;
import electroblob.wizardry.Wizardry;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.MagicDamage; import electroblob.wizardry.util.MagicDamage;
import electroblob.wizardry.util.MagicDamage.DamageType; import electroblob.wizardry.util.MagicDamage.DamageType;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@@ -55,9 +55,10 @@ public class EntitySpark extends EntityMagicProjectile {
// Particle effect // Particle effect
if(world.isRemote){ if(world.isRemote){
for(int i = 0; i < 8; i++){ for(int i = 0; i < 8; i++){
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world, this.posX + rand.nextFloat() - 0.5, double x = this.posX + rand.nextDouble() - 0.5;
this.posY + this.height / 2 + rand.nextFloat() - 0.5, this.posZ + rand.nextFloat() - 0.5, 0, 0, double y = this.posY + this.height / 2 + rand.nextDouble() - 0.5;
0, 3); double z = this.posZ + rand.nextDouble() - 0.5;
ParticleBuilder.create(Type.SPARK).pos(x, y, z).spawn(world);
} }
} }
@@ -2,12 +2,12 @@ package electroblob.wizardry.entity.projectile;
import java.util.List; import java.util.List;
import electroblob.wizardry.Wizardry;
import electroblob.wizardry.entity.EntityArc; import electroblob.wizardry.entity.EntityArc;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.MagicDamage; import electroblob.wizardry.util.MagicDamage;
import electroblob.wizardry.util.MagicDamage.DamageType; import electroblob.wizardry.util.MagicDamage.DamageType;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import io.netty.buffer.ByteBuf; import io.netty.buffer.ByteBuf;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
@@ -63,9 +63,10 @@ public class EntitySparkBomb extends EntityBomb {
// Particle effect // Particle effect
if(world.isRemote){ if(world.isRemote){
for(int i = 0; i < 8; i++){ for(int i = 0; i < 8; i++){
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world, this.posX + rand.nextFloat() - 0.5, double x = this.posX + rand.nextDouble() - 0.5;
this.posY + this.height / 2 + rand.nextFloat() - 0.5, this.posZ + rand.nextFloat() - 0.5, 0, 0, double y = this.posY + this.height / 2 + rand.nextDouble() - 0.5;
0, 3); double z = this.posZ + rand.nextDouble() - 0.5;
ParticleBuilder.create(Type.SPARK).pos(x, y, z).spawn(world);
world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, this.posX + rand.nextFloat() - 0.5, world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, this.posX + rand.nextFloat() - 0.5,
this.posY + this.height / 2 + rand.nextFloat() - 0.5, this.posZ + rand.nextFloat() - 0.5, 0, 0, this.posY + this.height / 2 + rand.nextFloat() - 0.5, this.posZ + rand.nextFloat() - 0.5, 0, 0,
0); 0);
@@ -106,10 +107,10 @@ public class EntitySparkBomb extends EntityBomb {
}else{ }else{
// Particle effect // Particle effect
for(int j = 0; j < 8; j++){ for(int j = 0; j < 8; j++){
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world, double x = target.posX + rand.nextFloat() - 0.5;
target.posX + rand.nextFloat() - 0.5, double y = target.getEntityBoundingBox().minY + target.height * rand.nextFloat();
target.getEntityBoundingBox().minY + target.height * rand.nextFloat(), double z = target.posZ + rand.nextFloat() - 0.5;
target.posZ + rand.nextFloat() - 0.5, 0, 0, 0, 3); ParticleBuilder.create(Type.SPARK).pos(x, y, z).spawn(world);
world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, target.posX + rand.nextFloat() - 0.5, world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, target.posX + rand.nextFloat() - 0.5,
target.getEntityBoundingBox().minY + target.height * rand.nextFloat(), target.getEntityBoundingBox().minY + target.height * rand.nextFloat(),
target.posZ + rand.nextFloat() - 0.5, 0, 0, 0); target.posZ + rand.nextFloat() - 0.5, 0, 0, 0);
@@ -1,9 +1,9 @@
package electroblob.wizardry.entity.projectile; package electroblob.wizardry.entity.projectile;
import electroblob.wizardry.Wizardry;
import electroblob.wizardry.util.MagicDamage; import electroblob.wizardry.util.MagicDamage;
import electroblob.wizardry.util.MagicDamage.DamageType; import electroblob.wizardry.util.MagicDamage.DamageType;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.ParticleBuilder.Type;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.init.SoundEvents; import net.minecraft.init.SoundEvents;
@@ -68,9 +68,7 @@ public class EntityThunderbolt extends EntityMagicProjectile {
super.onUpdate(); super.onUpdate();
if(world.isRemote){ if(world.isRemote){
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world, this.posX + rand.nextFloat() * 0.2 - 0.1, ParticleBuilder.create(Type.SPARK, rand, posX, posY + height/2, posZ, 0.1, false).spawn(world);
this.posY + this.height / 2 + rand.nextFloat() * 0.2 - 0.1,
this.posZ + rand.nextFloat() * 0.2 - 0.1, 0, 0, 0, 3);
for(int i = 0; i < 4; i++){ for(int i = 0; i < 4; i++){
world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, this.posX + rand.nextFloat() * 0.2 - 0.1, world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, this.posX + rand.nextFloat() * 0.2 - 0.1,
this.posY + this.height / 2 + rand.nextFloat() * 0.2 - 0.1, this.posY + this.height / 2 + rand.nextFloat() * 0.2 - 0.1,
@@ -3,7 +3,8 @@ package electroblob.wizardry.potion;
import electroblob.wizardry.Wizardry; import electroblob.wizardry.Wizardry;
import electroblob.wizardry.constants.Constants; import electroblob.wizardry.constants.Constants;
import electroblob.wizardry.registry.WizardryPotions; import electroblob.wizardry.registry.WizardryPotions;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.SharedMonsterAttributes;
@@ -39,8 +40,7 @@ public class PotionFrost extends Potion implements ICustomPotionParticles {
@Override @Override
public void spawnCustomParticle(World world, double x, double y, double z){ public void spawnCustomParticle(World world, double x, double y, double z){
Wizardry.proxy.spawnParticle(WizardryParticleType.SNOW, world, x, y, z, 0, -0.02, 0, ParticleBuilder.create(Type.SNOW).pos(x, y, z).lifetime(15 + world.rand.nextInt(5)).spawn(world);
15 + world.rand.nextInt(5));
} }
@Override @Override
@@ -5,7 +5,8 @@ import electroblob.wizardry.potion.PotionDecay;
import electroblob.wizardry.potion.PotionFrost; import electroblob.wizardry.potion.PotionFrost;
import electroblob.wizardry.potion.PotionMagicEffect; import electroblob.wizardry.potion.PotionMagicEffect;
import electroblob.wizardry.potion.PotionMagicEffectParticles; import electroblob.wizardry.potion.PotionMagicEffectParticles;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.ParticleBuilder.Type;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.potion.Potion; import net.minecraft.potion.Potion;
import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.EnumParticleTypes;
@@ -36,8 +37,7 @@ public final class WizardryPotions {
public static final Potion transience = new PotionMagicEffectParticles(false, 0, 0){ public static final Potion transience = new PotionMagicEffectParticles(false, 0, 0){
@Override @Override
public void spawnCustomParticle(World world, double x, double y, double z){ public void spawnCustomParticle(World world, double x, double y, double z){
Wizardry.proxy.spawnParticle(WizardryParticleType.DUST, world, x, y, z, 0, 0, 0, ParticleBuilder.create(Type.DUST).pos(x, y, z).colour(0.8f, 0.8f, 1.0f).shaded(true).spawn(world);
(int)(16.0D / (Math.random() * 0.8D + 0.2D)), 0.8f, 0.8f, 1.0f);
} }
}.setBeneficial(); // 0xffe89b }.setBeneficial(); // 0xffe89b
@@ -58,17 +58,15 @@ public final class WizardryPotions {
@Override @Override
public void spawnCustomParticle(World world, double x, double y, double z){ public void spawnCustomParticle(World world, double x, double y, double z){
float brightness = 0.5f + (world.rand.nextFloat() / 2); float brightness = 0.5f + (world.rand.nextFloat() / 2);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x, y, z, 0, 0, 0, ParticleBuilder.create(Type.SPARKLE).pos(x, y, z).colour(brightness, brightness + 0.1f, 1.0f).gravity(true).spawn(world);
48 + world.rand.nextInt(12), brightness, brightness + 0.1f, 1.0f, true, 0); ParticleBuilder.create(Type.SNOW).pos(x, y, z).spawn(world);
Wizardry.proxy.spawnParticle(WizardryParticleType.SNOW, world, x, y, z, 0, -0.02, 0,
40 + world.rand.nextInt(10));
} }
}.setBeneficial(); // 0x52f1ff }.setBeneficial(); // 0x52f1ff
public static final Potion static_aura = new PotionMagicEffectParticles(false, 0, 3){ public static final Potion static_aura = new PotionMagicEffectParticles(false, 0, 3){
@Override @Override
public void spawnCustomParticle(World world, double x, double y, double z){ public void spawnCustomParticle(World world, double x, double y, double z){
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world, x, y, z, 0, 0, 0, 3); ParticleBuilder.create(Type.SPARK).pos(x, y, z).spawn(world);
} }
}.setBeneficial(); // 0x0070ff }.setBeneficial(); // 0x0070ff
@@ -6,8 +6,9 @@ import electroblob.wizardry.constants.SpellType;
import electroblob.wizardry.constants.Tier; import electroblob.wizardry.constants.Tier;
import electroblob.wizardry.registry.WizardryItems; import electroblob.wizardry.registry.WizardryItems;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.ParticleBuilder;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.MobEffects; import net.minecraft.init.MobEffects;
@@ -31,13 +32,13 @@ public class Agility extends Spell {
caster.addPotionEffect(new PotionEffect(MobEffects.JUMP_BOOST, caster.addPotionEffect(new PotionEffect(MobEffects.JUMP_BOOST,
(int)(600 * modifiers.get(WizardryItems.duration_upgrade)), 1, false, false)); (int)(600 * modifiers.get(WizardryItems.duration_upgrade)), 1, false, false));
for(int i = 0; i < 10; i++){ if(world.isRemote){
double x1 = (double)((float)caster.posX + world.rand.nextFloat() * 2 - 1.0F); for(int i = 0; i < 10; i++){
double y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F + world.rand.nextFloat()); double x1 = (double)((float)caster.posX + world.rand.nextFloat() * 2 - 1.0F);
double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F); double y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F + world.rand.nextFloat());
if(world.isRemote){ double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0, ParticleBuilder.create(Type.SPARKLE).pos(x1, y1, z1).vel(0, 0.1F, 0)
48 + world.rand.nextInt(12), 0.6f, 0.6f, 1.0f); .lifetime(48 + world.rand.nextInt(12)).colour(0.4f, 1.0f, 0.8f).spawn(world);
} }
} }
@@ -10,7 +10,7 @@ import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.MagicDamage; import electroblob.wizardry.util.MagicDamage;
import electroblob.wizardry.util.MagicDamage.DamageType; import electroblob.wizardry.util.MagicDamage.DamageType;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
@@ -48,7 +48,7 @@ public class Arc extends Spell {
world.spawnEntity(arc); world.spawnEntity(arc);
}else{ }else{
for(int i = 0; i < 8; i++){ for(int i = 0; i < 8; i++){
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world, Wizardry.proxy.spawnParticle(Type.SPARK, world,
target.posX + world.rand.nextFloat() - 0.5, target.posX + world.rand.nextFloat() - 0.5,
target.getEntityBoundingBox().minY + target.height / 2 + world.rand.nextFloat() * 2 - 1, target.getEntityBoundingBox().minY + target.height / 2 + world.rand.nextFloat() * 2 - 1,
target.posZ + world.rand.nextFloat() - 0.5, 0, 0, 0, 3); target.posZ + world.rand.nextFloat() - 0.5, 0, 0, 0, 3);
@@ -88,7 +88,7 @@ public class Arc extends Spell {
world.spawnEntity(arc); world.spawnEntity(arc);
}else{ }else{
for(int i = 0; i < 8; i++){ for(int i = 0; i < 8; i++){
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world, Wizardry.proxy.spawnParticle(Type.SPARK, world,
target.posX + world.rand.nextFloat() - 0.5, target.posX + world.rand.nextFloat() - 0.5,
target.getEntityBoundingBox().minY + target.height / 2 + world.rand.nextFloat() * 2 - 1, target.getEntityBoundingBox().minY + target.height / 2 + world.rand.nextFloat() * 2 - 1,
target.posZ + world.rand.nextFloat() - 0.5, 0, 0, 0, 3); target.posZ + world.rand.nextFloat() - 0.5, 0, 0, 0, 3);
@@ -11,7 +11,7 @@ import electroblob.wizardry.registry.WizardryItems;
import electroblob.wizardry.registry.WizardryPotions; import electroblob.wizardry.registry.WizardryPotions;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@@ -56,7 +56,7 @@ public class ArcaneJammer extends Spell {
double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.y * i / 2 double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.y * i / 2
+ world.rand.nextFloat() / 5 - 0.1f; + world.rand.nextFloat() / 5 - 0.1f;
double z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f; double z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, 0.0d, 0.0d, 0.0d, Wizardry.proxy.spawnParticle(Type.SPARKLE, world, x1, y1, z1, 0.0d, 0.0d, 0.0d,
12 + world.rand.nextInt(8), 0.9f, 0.3f, 0.7f); 12 + world.rand.nextInt(8), 0.9f, 0.3f, 0.7f);
} }
} }
@@ -89,7 +89,7 @@ public class ArcaneJammer extends Spell {
- 0.1f; - 0.1f;
double z1 = caster.posZ + dz * i / 2 + world.rand.nextFloat() / 5 - 0.1f; double z1 = caster.posZ + dz * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, 0.0d, 0.0d, 0.0d, Wizardry.proxy.spawnParticle(Type.SPARKLE, world, x1, y1, z1, 0.0d, 0.0d, 0.0d,
12 + world.rand.nextInt(8), 0.9f, 0.3f, 0.7f); 12 + world.rand.nextInt(8), 0.9f, 0.3f, 0.7f);
} }
} }
@@ -6,7 +6,7 @@ import electroblob.wizardry.constants.SpellType;
import electroblob.wizardry.constants.Tier; import electroblob.wizardry.constants.Tier;
import electroblob.wizardry.registry.WizardryItems; import electroblob.wizardry.registry.WizardryItems;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@@ -87,7 +87,7 @@ public class Banish extends Spell {
double z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f; double z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
world.spawnParticle(EnumParticleTypes.PORTAL, x1, y1 - 0.5, z1, 0.0d, 0.0d, 0.0d); world.spawnParticle(EnumParticleTypes.PORTAL, x1, y1 - 0.5, z1, 0.0d, 0.0d, 0.0d);
Wizardry.proxy.spawnParticle(WizardryParticleType.DARK_MAGIC, world, x1, y1, z1, 0.0d, 0.0d, 0.0d, 0, Wizardry.proxy.spawnParticle(Type.DARK_MAGIC, world, x1, y1, z1, 0.0d, 0.0d, 0.0d, 0,
0.2f, 0.0f, 0.2f); 0.2f, 0.0f, 0.2f);
} }
} }
@@ -125,7 +125,7 @@ public class Banish extends Spell {
double z1 = caster.posZ + dz * i / 2 + world.rand.nextFloat() / 5 - 0.1f; double z1 = caster.posZ + dz * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
world.spawnParticle(EnumParticleTypes.PORTAL, x1, y1 - 0.5, z1, 0.0d, 0.0d, 0.0d); world.spawnParticle(EnumParticleTypes.PORTAL, x1, y1 - 0.5, z1, 0.0d, 0.0d, 0.0d);
Wizardry.proxy.spawnParticle(WizardryParticleType.DARK_MAGIC, world, x1, y1, z1, 0.0d, 0.0d, 0.0d, Wizardry.proxy.spawnParticle(Type.DARK_MAGIC, world, x1, y1, z1, 0.0d, 0.0d, 0.0d,
0, 0.2f, 0.0f, 0.2f); 0, 0.2f, 0.0f, 0.2f);
} }
@@ -10,7 +10,7 @@ import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.MagicDamage; import electroblob.wizardry.util.MagicDamage;
import electroblob.wizardry.util.MagicDamage.DamageType; import electroblob.wizardry.util.MagicDamage.DamageType;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@@ -59,7 +59,7 @@ public class Bubble extends Spell {
double z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f; double z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
world.spawnParticle(EnumParticleTypes.WATER_SPLASH, x1, y1, z1, 0.0d, 0.0d, 0.0d); world.spawnParticle(EnumParticleTypes.WATER_SPLASH, x1, y1, z1, 0.0d, 0.0d, 0.0d);
Wizardry.proxy.spawnParticle(WizardryParticleType.MAGIC_BUBBLE, world, x1, y1, z1, 0.0d, 0.0d, 0.0d, 0); Wizardry.proxy.spawnParticle(Type.MAGIC_BUBBLE, world, x1, y1, z1, 0.0d, 0.0d, 0.0d, 0);
} }
} }
caster.swingArm(hand); caster.swingArm(hand);
@@ -102,7 +102,7 @@ public class Bubble extends Spell {
double z1 = caster.posZ + dz * i / 2 + world.rand.nextFloat() / 5 - 0.1f; double z1 = caster.posZ + dz * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
world.spawnParticle(EnumParticleTypes.WATER_SPLASH, x1, y1, z1, 0.0d, 0.0d, 0.0d); world.spawnParticle(EnumParticleTypes.WATER_SPLASH, x1, y1, z1, 0.0d, 0.0d, 0.0d);
Wizardry.proxy.spawnParticle(WizardryParticleType.MAGIC_BUBBLE, world, x1, y1, z1, 0.0d, 0.0d, 0.0d, Wizardry.proxy.spawnParticle(Type.MAGIC_BUBBLE, world, x1, y1, z1, 0.0d, 0.0d, 0.0d,
0); 0);
} }
} }
@@ -12,7 +12,7 @@ import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.MagicDamage; import electroblob.wizardry.util.MagicDamage;
import electroblob.wizardry.util.MagicDamage.DamageType; import electroblob.wizardry.util.MagicDamage.DamageType;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@@ -55,7 +55,7 @@ public class ChainLightning extends Spell {
world.spawnEntity(arc); world.spawnEntity(arc);
}else{ }else{
for(int i = 0; i < 8; i++){ for(int i = 0; i < 8; i++){
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world, Wizardry.proxy.spawnParticle(Type.SPARK, world,
target.posX + world.rand.nextFloat() - 0.5, target.posX + world.rand.nextFloat() - 0.5,
target.getEntityBoundingBox().minY + target.height / 2 + world.rand.nextFloat() * 2 - 1, target.getEntityBoundingBox().minY + target.height / 2 + world.rand.nextFloat() * 2 - 1,
target.posZ + world.rand.nextFloat() - 0.5, 0, 0, 0, 3); target.posZ + world.rand.nextFloat() - 0.5, 0, 0, 0, 3);
@@ -97,7 +97,7 @@ public class ChainLightning extends Spell {
world.spawnEntity(arc); world.spawnEntity(arc);
}else{ }else{
for(int j = 0; j < 8; j++){ for(int j = 0; j < 8; j++){
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world, Wizardry.proxy.spawnParticle(Type.SPARK, world,
secondaryTarget.posX + world.rand.nextFloat() - 0.5, secondaryTarget.posX + world.rand.nextFloat() - 0.5,
secondaryTarget.getEntityBoundingBox().minY + secondaryTarget.height / 2 secondaryTarget.getEntityBoundingBox().minY + secondaryTarget.height / 2
+ world.rand.nextFloat() * 2 - 1, + world.rand.nextFloat() * 2 - 1,
@@ -144,7 +144,7 @@ public class ChainLightning extends Spell {
world.spawnEntity(arc); world.spawnEntity(arc);
}else{ }else{
for(int k = 0; k < 8; k++){ for(int k = 0; k < 8; k++){
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world, Wizardry.proxy.spawnParticle(Type.SPARK, world,
tertiaryTarget.posX + world.rand.nextFloat() - 0.5, tertiaryTarget.posX + world.rand.nextFloat() - 0.5,
tertiaryTarget.getEntityBoundingBox().minY + tertiaryTarget.height / 2 tertiaryTarget.getEntityBoundingBox().minY + tertiaryTarget.height / 2
+ world.rand.nextFloat() * 2 - 1, + world.rand.nextFloat() * 2 - 1,
@@ -13,7 +13,7 @@ import electroblob.wizardry.registry.WizardryItems;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WandHelper; import electroblob.wizardry.util.WandHelper;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryPathFinder; import electroblob.wizardry.util.WizardryPathFinder;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.SharedMonsterAttributes;
@@ -123,7 +123,7 @@ public class Clairvoyance extends Spell {
nextPoint = path.getCurrentPathLength() - path.getCurrentPathIndex() <= 2 ? path.getFinalPathPoint() nextPoint = path.getCurrentPathLength() - path.getCurrentPathIndex() <= 2 ? path.getFinalPathPoint()
: path.getPathPointFromIndex(path.getCurrentPathIndex() + 2); : path.getPathPointFromIndex(path.getCurrentPathIndex() + 2);
Wizardry.proxy.spawnParticle(WizardryParticleType.PATH, world, point.x + 0.5, point.y + 0.5, point.z + 0.5, Wizardry.proxy.spawnParticle(Type.PATH, world, point.x + 0.5, point.y + 0.5, point.z + 0.5,
(nextPoint.x - point.x) / (float)PARTICLE_MOVEMENT_INTERVAL, (nextPoint.y - point.y) / (float)PARTICLE_MOVEMENT_INTERVAL, (nextPoint.x - point.x) / (float)PARTICLE_MOVEMENT_INTERVAL, (nextPoint.y - point.y) / (float)PARTICLE_MOVEMENT_INTERVAL,
(nextPoint.z - point.z) / (float)PARTICLE_MOVEMENT_INTERVAL, (int)(1800 * durationMultiplier), 0, 1, 0.3f); (nextPoint.z - point.z) / (float)PARTICLE_MOVEMENT_INTERVAL, (int)(1800 * durationMultiplier), 0, 1, 0.3f);
@@ -133,7 +133,7 @@ public class Clairvoyance extends Spell {
point = path.getFinalPathPoint(); point = path.getFinalPathPoint();
Wizardry.proxy.spawnParticle(WizardryParticleType.PATH, world, point.x + 0.5, point.y + 0.5, point.z + 0.5, 0, 0, 0, Wizardry.proxy.spawnParticle(Type.PATH, world, point.x + 0.5, point.y + 0.5, point.z + 0.5, 0, 0, 0,
(int)(1800 * durationMultiplier), 1, 1, 1); (int)(1800 * durationMultiplier), 1, 1, 1);
} }
@@ -8,7 +8,7 @@ import electroblob.wizardry.item.IConjuredItem;
import electroblob.wizardry.registry.WizardryItems; import electroblob.wizardry.registry.WizardryItems;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.EntityEquipmentSlot; import net.minecraft.inventory.EntityEquipmentSlot;
@@ -54,7 +54,7 @@ public class ConjureArmour extends Spell {
double y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F double y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F
+ world.rand.nextFloat()); + world.rand.nextFloat());
double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F); double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0, Wizardry.proxy.spawnParticle(Type.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0,
48 + world.rand.nextInt(12), 0.7f, 0.9f, 1.0f); 48 + world.rand.nextInt(12), 0.7f, 0.9f, 1.0f);
} }
} }
@@ -8,7 +8,7 @@ import electroblob.wizardry.item.IConjuredItem;
import electroblob.wizardry.registry.WizardryItems; import electroblob.wizardry.registry.WizardryItems;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction; import net.minecraft.item.EnumAction;
@@ -36,7 +36,7 @@ public class ConjureBow extends Spell {
double y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F + world.rand.nextFloat()); double y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F + world.rand.nextFloat());
double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F); double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F);
if(world.isRemote){ if(world.isRemote){
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0, Wizardry.proxy.spawnParticle(Type.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0,
48 + world.rand.nextInt(12), 0.7f, 0.9f, 1.0f); 48 + world.rand.nextInt(12), 0.7f, 0.9f, 1.0f);
} }
} }
@@ -8,7 +8,7 @@ import electroblob.wizardry.item.IConjuredItem;
import electroblob.wizardry.registry.WizardryItems; import electroblob.wizardry.registry.WizardryItems;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction; import net.minecraft.item.EnumAction;
@@ -37,7 +37,7 @@ public class ConjurePickaxe extends Spell {
double y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F double y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F
+ world.rand.nextFloat()); + world.rand.nextFloat());
double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F); double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0, Wizardry.proxy.spawnParticle(Type.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0,
48 + world.rand.nextInt(12), 0.7f, 0.9f, 1.0f); 48 + world.rand.nextInt(12), 0.7f, 0.9f, 1.0f);
} }
} }
@@ -8,7 +8,7 @@ import electroblob.wizardry.item.IConjuredItem;
import electroblob.wizardry.registry.WizardryItems; import electroblob.wizardry.registry.WizardryItems;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction; import net.minecraft.item.EnumAction;
@@ -36,7 +36,7 @@ public class ConjureSword extends Spell {
double y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F + world.rand.nextFloat()); double y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F + world.rand.nextFloat());
double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F); double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F);
if(world.isRemote){ if(world.isRemote){
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0, Wizardry.proxy.spawnParticle(Type.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0,
48 + world.rand.nextInt(12), 0.7f, 0.9f, 1.0f); 48 + world.rand.nextInt(12), 0.7f, 0.9f, 1.0f);
} }
} }
@@ -6,7 +6,7 @@ import electroblob.wizardry.constants.SpellType;
import electroblob.wizardry.constants.Tier; import electroblob.wizardry.constants.Tier;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@@ -29,7 +29,7 @@ public class CureEffects extends Spell {
double x1 = (double)((float)caster.posX + world.rand.nextFloat() * 2 - 1.0F); double x1 = (double)((float)caster.posX + world.rand.nextFloat() * 2 - 1.0F);
double y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F + world.rand.nextFloat()); double y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F + world.rand.nextFloat());
double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F); double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0, Wizardry.proxy.spawnParticle(Type.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0,
48 + world.rand.nextInt(12), 0.6f, 0.6f, 1.0f); 48 + world.rand.nextInt(12), 0.6f, 0.6f, 1.0f);
} }
} }
@@ -58,7 +58,7 @@ public class CureEffects extends Spell {
double x1 = (double)((float)caster.posX + world.rand.nextFloat() * 2 - 1.0F); double x1 = (double)((float)caster.posX + world.rand.nextFloat() * 2 - 1.0F);
double y1 = (double)((float)caster.posY + caster.getEyeHeight() - 0.5F + world.rand.nextFloat()); double y1 = (double)((float)caster.posY + caster.getEyeHeight() - 0.5F + world.rand.nextFloat());
double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F); double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0, Wizardry.proxy.spawnParticle(Type.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0,
48 + world.rand.nextInt(12), 0.6f, 0.6f, 1.0f); 48 + world.rand.nextInt(12), 0.6f, 0.6f, 1.0f);
} }
} }
@@ -8,7 +8,7 @@ import electroblob.wizardry.constants.Tier;
import electroblob.wizardry.registry.WizardryItems; import electroblob.wizardry.registry.WizardryItems;
import electroblob.wizardry.util.IElementalDamage; import electroblob.wizardry.util.IElementalDamage;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@@ -52,11 +52,11 @@ public class CurseOfSoulbinding extends Spell {
+ world.rand.nextFloat() / 5 - 0.1f; + world.rand.nextFloat() / 5 - 0.1f;
double z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f; double z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
// world.spawnParticle("mobSpell", x1, y1, z1, -1*look.xCoord, -1*look.yCoord, -1*look.zCoord); // world.spawnParticle("mobSpell", x1, y1, z1, -1*look.xCoord, -1*look.yCoord, -1*look.zCoord);
Wizardry.proxy.spawnParticle(WizardryParticleType.DARK_MAGIC, world, x1, y1, z1, 0.0d, 0.0d, 0.0d, 0, Wizardry.proxy.spawnParticle(Type.DARK_MAGIC, world, x1, y1, z1, 0.0d, 0.0d, 0.0d, 0,
0.4f, 0.0f, 0.0f); 0.4f, 0.0f, 0.0f);
Wizardry.proxy.spawnParticle(WizardryParticleType.DARK_MAGIC, world, x1, y1, z1, 0.0d, 0.0d, 0.0d, 0, Wizardry.proxy.spawnParticle(Type.DARK_MAGIC, world, x1, y1, z1, 0.0d, 0.0d, 0.0d, 0,
0.1f, 0.0f, 0.0f); 0.1f, 0.0f, 0.0f);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, 0.0d, 0.0d, 0.0d, Wizardry.proxy.spawnParticle(Type.SPARKLE, world, x1, y1, z1, 0.0d, 0.0d, 0.0d,
12 + world.rand.nextInt(8), 1.0f, 0.8f, 1.0f); 12 + world.rand.nextInt(8), 1.0f, 0.8f, 1.0f);
} }
} }
@@ -7,7 +7,7 @@ import electroblob.wizardry.constants.Tier;
import electroblob.wizardry.registry.WizardryItems; import electroblob.wizardry.registry.WizardryItems;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.MobEffects; import net.minecraft.init.MobEffects;
@@ -33,7 +33,7 @@ public class Darkvision extends Spell {
double x1 = (double)((float)caster.posX + world.rand.nextFloat() * 2 - 1.0F); double x1 = (double)((float)caster.posX + world.rand.nextFloat() * 2 - 1.0F);
double y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F + world.rand.nextFloat()); double y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F + world.rand.nextFloat());
double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F); double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0, Wizardry.proxy.spawnParticle(Type.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0,
48 + world.rand.nextInt(12), 0.0f, 0.4f, 0.7f); 48 + world.rand.nextInt(12), 0.0f, 0.4f, 0.7f);
} }
} }
@@ -7,7 +7,7 @@ import electroblob.wizardry.constants.Tier;
import electroblob.wizardry.registry.WizardryItems; import electroblob.wizardry.registry.WizardryItems;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.MobEffects; import net.minecraft.init.MobEffects;
@@ -33,13 +33,13 @@ public class Diamondflesh extends Spell {
double x1 = (double)((float)caster.posX + world.rand.nextFloat() * 2 - 1.0F); double x1 = (double)((float)caster.posX + world.rand.nextFloat() * 2 - 1.0F);
double y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F + world.rand.nextFloat()); double y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F + world.rand.nextFloat());
double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F); double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0, Wizardry.proxy.spawnParticle(Type.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0,
48 + world.rand.nextInt(12), 0.0f, 0.5f, 1.0f); 48 + world.rand.nextInt(12), 0.0f, 0.5f, 1.0f);
x1 = (double)((float)caster.posX + world.rand.nextFloat() * 2 - 1.0F); x1 = (double)((float)caster.posX + world.rand.nextFloat() * 2 - 1.0F);
y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F + world.rand.nextFloat()); y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F + world.rand.nextFloat());
z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F); z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0, Wizardry.proxy.spawnParticle(Type.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0,
48 + world.rand.nextInt(12), 0.6f, 0.7f, 0.9f); 48 + world.rand.nextInt(12), 0.6f, 0.7f, 0.9f);
} }
@@ -9,7 +9,7 @@ import electroblob.wizardry.registry.WizardryItems;
import electroblob.wizardry.util.MagicDamage; import electroblob.wizardry.util.MagicDamage;
import electroblob.wizardry.util.MagicDamage.DamageType; import electroblob.wizardry.util.MagicDamage.DamageType;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@@ -57,7 +57,7 @@ public class Entrapment extends Spell {
double z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f; double z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
world.spawnParticle(EnumParticleTypes.PORTAL, x1, y1 - 0.5, z1, 0.0d, 0.0d, 0.0d); world.spawnParticle(EnumParticleTypes.PORTAL, x1, y1 - 0.5, z1, 0.0d, 0.0d, 0.0d);
Wizardry.proxy.spawnParticle(WizardryParticleType.DARK_MAGIC, world, x1, y1, z1, 0.0d, 0.0d, 0.0d, 0, Wizardry.proxy.spawnParticle(Type.DARK_MAGIC, world, x1, y1, z1, 0.0d, 0.0d, 0.0d, 0,
0.1f, 0.0f, 0.0f); 0.1f, 0.0f, 0.0f);
} }
} }
@@ -99,7 +99,7 @@ public class Entrapment extends Spell {
double z1 = caster.posZ + dz * i / 2 + world.rand.nextFloat() / 5 - 0.1f; double z1 = caster.posZ + dz * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
world.spawnParticle(EnumParticleTypes.PORTAL, x1, y1 - 0.5, z1, 0.0d, 0.0d, 0.0d); world.spawnParticle(EnumParticleTypes.PORTAL, x1, y1 - 0.5, z1, 0.0d, 0.0d, 0.0d);
Wizardry.proxy.spawnParticle(WizardryParticleType.DARK_MAGIC, world, x1, y1, z1, 0.0d, 0.0d, 0.0d, Wizardry.proxy.spawnParticle(Type.DARK_MAGIC, world, x1, y1, z1, 0.0d, 0.0d, 0.0d,
0, 0.1f, 0.0f, 0.0f); 0, 0.1f, 0.0f, 0.0f);
} }
} }
@@ -7,7 +7,7 @@ import electroblob.wizardry.constants.Tier;
import electroblob.wizardry.registry.WizardryItems; import electroblob.wizardry.registry.WizardryItems;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@@ -35,7 +35,7 @@ public class FireResistance extends Spell {
double x1 = (double)((float)caster.posX + world.rand.nextFloat() * 2 - 1.0F); double x1 = (double)((float)caster.posX + world.rand.nextFloat() * 2 - 1.0F);
double y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F + world.rand.nextFloat()); double y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F + world.rand.nextFloat());
double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F); double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0, Wizardry.proxy.spawnParticle(Type.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0,
48 + world.rand.nextInt(12), 1.0f, 0.5f, 0.0f); 48 + world.rand.nextInt(12), 1.0f, 0.5f, 0.0f);
} }
} }
@@ -59,7 +59,7 @@ public class FireResistance extends Spell {
double x1 = (double)((float)caster.posX + world.rand.nextFloat() * 2 - 1.0F); double x1 = (double)((float)caster.posX + world.rand.nextFloat() * 2 - 1.0F);
double y1 = (double)((float)caster.posY + caster.getEyeHeight() - 0.5F + world.rand.nextFloat()); double y1 = (double)((float)caster.posY + caster.getEyeHeight() - 0.5F + world.rand.nextFloat());
double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F); double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0, Wizardry.proxy.spawnParticle(Type.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0,
48 + world.rand.nextInt(12), 1.0f, 0.5f, 0.0f); 48 + world.rand.nextInt(12), 1.0f, 0.5f, 0.0f);
} }
} }
@@ -9,7 +9,7 @@ import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.MagicDamage; import electroblob.wizardry.util.MagicDamage;
import electroblob.wizardry.util.MagicDamage.DamageType; import electroblob.wizardry.util.MagicDamage.DamageType;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@@ -70,11 +70,11 @@ public class Firestorm extends Spell {
double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.y * i / 2 double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.y * i / 2
+ world.rand.nextFloat() * 0.4f - 0.2f; + world.rand.nextFloat() * 0.4f - 0.2f;
double z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() * 0.6f - 0.3f; double z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() * 0.6f - 0.3f;
Wizardry.proxy.spawnParticle(WizardryParticleType.MAGIC_FIRE, world, x1, y1, z1, Wizardry.proxy.spawnParticle(Type.MAGIC_FIRE, world, x1, y1, z1,
look.x * modifiers.get(WizardryItems.range_upgrade), look.x * modifiers.get(WizardryItems.range_upgrade),
look.y * modifiers.get(WizardryItems.range_upgrade), look.y * modifiers.get(WizardryItems.range_upgrade),
look.z * modifiers.get(WizardryItems.range_upgrade), 0, 3 + world.rand.nextFloat(), 0, 0); look.z * modifiers.get(WizardryItems.range_upgrade), 0, 3 + world.rand.nextFloat(), 0, 0);
Wizardry.proxy.spawnParticle(WizardryParticleType.MAGIC_FIRE, world, x1, y1, z1, Wizardry.proxy.spawnParticle(Type.MAGIC_FIRE, world, x1, y1, z1,
look.x * modifiers.get(WizardryItems.range_upgrade), look.x * modifiers.get(WizardryItems.range_upgrade),
look.y * modifiers.get(WizardryItems.range_upgrade), look.y * modifiers.get(WizardryItems.range_upgrade),
look.z * modifiers.get(WizardryItems.range_upgrade), 0, 3 + world.rand.nextFloat(), 0, 0); look.z * modifiers.get(WizardryItems.range_upgrade), 0, 3 + world.rand.nextFloat(), 0, 0);
@@ -9,7 +9,7 @@ import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.MagicDamage; import electroblob.wizardry.util.MagicDamage;
import electroblob.wizardry.util.MagicDamage.DamageType; import electroblob.wizardry.util.MagicDamage.DamageType;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@@ -58,11 +58,11 @@ public class FlameRay extends Spell {
double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.y * i / 2 double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.y * i / 2
+ world.rand.nextFloat() / 5 - 0.1f; + world.rand.nextFloat() / 5 - 0.1f;
double z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f; double z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
Wizardry.proxy.spawnParticle(WizardryParticleType.MAGIC_FIRE, world, x1, y1, z1, Wizardry.proxy.spawnParticle(Type.MAGIC_FIRE, world, x1, y1, z1,
look.x * modifiers.get(WizardryItems.range_upgrade), look.x * modifiers.get(WizardryItems.range_upgrade),
look.y * modifiers.get(WizardryItems.range_upgrade), look.y * modifiers.get(WizardryItems.range_upgrade),
look.z * modifiers.get(WizardryItems.range_upgrade), 0); look.z * modifiers.get(WizardryItems.range_upgrade), 0);
Wizardry.proxy.spawnParticle(WizardryParticleType.MAGIC_FIRE, world, x1, y1, z1, Wizardry.proxy.spawnParticle(Type.MAGIC_FIRE, world, x1, y1, z1,
look.x * modifiers.get(WizardryItems.range_upgrade), look.x * modifiers.get(WizardryItems.range_upgrade),
look.y * modifiers.get(WizardryItems.range_upgrade), look.y * modifiers.get(WizardryItems.range_upgrade),
look.z * modifiers.get(WizardryItems.range_upgrade), 0); look.z * modifiers.get(WizardryItems.range_upgrade), 0);
@@ -94,11 +94,11 @@ public class FlameRay extends Spell {
double y1 = caster.posY + caster.getEyeHeight() - 0.4f + vec.y * i / 2 + world.rand.nextFloat() / 5 double y1 = caster.posY + caster.getEyeHeight() - 0.4f + vec.y * i / 2 + world.rand.nextFloat() / 5
- 0.1f; - 0.1f;
double z1 = caster.posZ + vec.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f; double z1 = caster.posZ + vec.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
Wizardry.proxy.spawnParticle(WizardryParticleType.MAGIC_FIRE, world, x1, y1, z1, Wizardry.proxy.spawnParticle(Type.MAGIC_FIRE, world, x1, y1, z1,
vec.x * modifiers.get(WizardryItems.range_upgrade), vec.x * modifiers.get(WizardryItems.range_upgrade),
vec.y * modifiers.get(WizardryItems.range_upgrade), vec.y * modifiers.get(WizardryItems.range_upgrade),
vec.z * modifiers.get(WizardryItems.range_upgrade), 0); vec.z * modifiers.get(WizardryItems.range_upgrade), 0);
Wizardry.proxy.spawnParticle(WizardryParticleType.MAGIC_FIRE, world, x1, y1, z1, Wizardry.proxy.spawnParticle(Type.MAGIC_FIRE, world, x1, y1, z1,
vec.x * modifiers.get(WizardryItems.range_upgrade), vec.x * modifiers.get(WizardryItems.range_upgrade),
vec.y * modifiers.get(WizardryItems.range_upgrade), vec.y * modifiers.get(WizardryItems.range_upgrade),
vec.z * modifiers.get(WizardryItems.range_upgrade), 0); vec.z * modifiers.get(WizardryItems.range_upgrade), 0);
@@ -10,7 +10,7 @@ import electroblob.wizardry.registry.WizardryEnchantments;
import electroblob.wizardry.registry.WizardryItems; import electroblob.wizardry.registry.WizardryItems;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@@ -54,7 +54,7 @@ public class FlamingWeapon extends Spell {
double y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F double y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F
+ world.rand.nextFloat()); + world.rand.nextFloat());
double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F); double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0, Wizardry.proxy.spawnParticle(Type.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0,
48 + world.rand.nextInt(12), 0.9f, 0.7f, 1.0f); 48 + world.rand.nextInt(12), 0.9f, 0.7f, 1.0f);
} }
} }
@@ -5,7 +5,7 @@ import electroblob.wizardry.constants.Element;
import electroblob.wizardry.constants.SpellType; import electroblob.wizardry.constants.SpellType;
import electroblob.wizardry.constants.Tier; import electroblob.wizardry.constants.Tier;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.SoundEvents; import net.minecraft.init.SoundEvents;
@@ -37,11 +37,11 @@ public class Flight extends Spell {
caster.fallDistance = 0.0f; caster.fallDistance = 0.0f;
} }
if(world.isRemote){ if(world.isRemote){
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, Wizardry.proxy.spawnParticle(Type.SPARKLE, world,
caster.posX - 1 + world.rand.nextDouble() * 2, caster.posX - 1 + world.rand.nextDouble() * 2,
WizardryUtilities.getPlayerEyesPos(caster) - 0.5f + world.rand.nextDouble(), WizardryUtilities.getPlayerEyesPos(caster) - 0.5f + world.rand.nextDouble(),
caster.posZ - 1 + world.rand.nextDouble() * 2, 0, -0.1F, 0, 15, 0.8f, 1.0f, 0.5f); caster.posZ - 1 + world.rand.nextDouble() * 2, 0, -0.1F, 0, 15, 0.8f, 1.0f, 0.5f);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, Wizardry.proxy.spawnParticle(Type.SPARKLE, world,
caster.posX - 1 + world.rand.nextDouble() * 2, caster.posX - 1 + world.rand.nextDouble() * 2,
WizardryUtilities.getPlayerEyesPos(caster) - 0.5f + world.rand.nextDouble(), WizardryUtilities.getPlayerEyesPos(caster) - 0.5f + world.rand.nextDouble(),
caster.posZ - 1 + world.rand.nextDouble() * 2, 0, -0.1F, 0, 15, 1.0f, 1.0f, 1.0f); caster.posZ - 1 + world.rand.nextDouble() * 2, 0, -0.1F, 0, 15, 1.0f, 1.0f, 1.0f);
@@ -10,7 +10,7 @@ import electroblob.wizardry.registry.WizardryItems;
import electroblob.wizardry.registry.WizardryPotions; import electroblob.wizardry.registry.WizardryPotions;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction; import net.minecraft.item.EnumAction;
@@ -46,7 +46,7 @@ public class FontOfMana extends Spell {
double radius = (1 + world.rand.nextDouble() * 4) * modifiers.get(WizardryItems.blast_upgrade); double radius = (1 + world.rand.nextDouble() * 4) * modifiers.get(WizardryItems.blast_upgrade);
double angle = world.rand.nextDouble() * Math.PI * 2; double angle = world.rand.nextDouble() * Math.PI * 2;
float hue = world.rand.nextFloat() * 0.4f; float hue = world.rand.nextFloat() * 0.4f;
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, Wizardry.proxy.spawnParticle(Type.SPARKLE, world,
caster.posX + radius * Math.cos(angle), caster.getEntityBoundingBox().minY, caster.posX + radius * Math.cos(angle), caster.getEntityBoundingBox().minY,
caster.posZ + radius * Math.sin(angle), 0, 0.03, 0, 50, 1, 1 - hue, 0.6f + hue); caster.posZ + radius * Math.sin(angle), 0, 0.03, 0, 50, 1, 1 - hue, 0.6f + hue);
@@ -7,7 +7,7 @@ import electroblob.wizardry.constants.Tier;
import electroblob.wizardry.registry.WizardryItems; import electroblob.wizardry.registry.WizardryItems;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.MobEffects; import net.minecraft.init.MobEffects;
@@ -36,14 +36,14 @@ public class FontOfVitality extends Spell {
double y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F + world.rand.nextFloat()); double y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F + world.rand.nextFloat());
double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F); double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0, Wizardry.proxy.spawnParticle(Type.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0,
48 + world.rand.nextInt(12), 1.0f, 0.6f, 0.7f); 48 + world.rand.nextInt(12), 1.0f, 0.6f, 0.7f);
x1 = (double)((float)caster.posX + world.rand.nextFloat() * 2 - 1.0F); x1 = (double)((float)caster.posX + world.rand.nextFloat() * 2 - 1.0F);
y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F + world.rand.nextFloat()); y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F + world.rand.nextFloat());
z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F); z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0, Wizardry.proxy.spawnParticle(Type.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0,
48 + world.rand.nextInt(12), 1.0f, 0.8f, 0.3f); 48 + world.rand.nextInt(12), 1.0f, 0.8f, 0.3f);
} }
@@ -10,7 +10,7 @@ import electroblob.wizardry.registry.WizardryItems;
import electroblob.wizardry.util.MagicDamage; import electroblob.wizardry.util.MagicDamage;
import electroblob.wizardry.util.MagicDamage.DamageType; import electroblob.wizardry.util.MagicDamage.DamageType;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@@ -52,16 +52,16 @@ public class ForestsCurse extends Spell {
double radius = (1 + world.rand.nextDouble() * 4) * modifiers.get(WizardryItems.blast_upgrade); double radius = (1 + world.rand.nextDouble() * 4) * modifiers.get(WizardryItems.blast_upgrade);
double angle = world.rand.nextDouble() * Math.PI * 2; double angle = world.rand.nextDouble() * Math.PI * 2;
float brightness = world.rand.nextFloat() / 4; float brightness = world.rand.nextFloat() / 4;
Wizardry.proxy.spawnParticle(WizardryParticleType.DARK_MAGIC, world, Wizardry.proxy.spawnParticle(Type.DARK_MAGIC, world,
caster.posX + radius * Math.cos(angle), WizardryUtilities.getPlayerEyesPos(caster) + 0.5, caster.posX + radius * Math.cos(angle), WizardryUtilities.getPlayerEyesPos(caster) + 0.5,
caster.posZ + radius * Math.sin(angle), 0, -0.2, 0, 0, 0.05f + brightness, 0.2f + brightness, caster.posZ + radius * Math.sin(angle), 0, -0.2, 0, 0, 0.05f + brightness, 0.2f + brightness,
0.0f); 0.0f);
brightness = world.rand.nextFloat() / 4; brightness = world.rand.nextFloat() / 4;
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, Wizardry.proxy.spawnParticle(Type.SPARKLE, world,
caster.posX + radius * Math.cos(angle), WizardryUtilities.getPlayerEyesPos(caster) + 0.5, caster.posX + radius * Math.cos(angle), WizardryUtilities.getPlayerEyesPos(caster) + 0.5,
caster.posZ + radius * Math.sin(angle), 0, -0.05, 0, 50, 0.1f + brightness, 0.2f + brightness, caster.posZ + radius * Math.sin(angle), 0, -0.05, 0, 50, 0.1f + brightness, 0.2f + brightness,
0.0f); 0.0f);
Wizardry.proxy.spawnParticle(WizardryParticleType.LEAF, world, caster.posX + radius * Math.cos(angle), Wizardry.proxy.spawnParticle(Type.LEAF, world, caster.posX + radius * Math.cos(angle),
WizardryUtilities.getPlayerEyesPos(caster) + 0.5, caster.posZ + radius * Math.sin(angle), 0, WizardryUtilities.getPlayerEyesPos(caster) + 0.5, caster.posZ + radius * Math.sin(angle), 0,
-0.01, 0, 40 + world.rand.nextInt(12)); -0.01, 0, 40 + world.rand.nextInt(12));
@@ -11,7 +11,7 @@ import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.MagicDamage; import electroblob.wizardry.util.MagicDamage;
import electroblob.wizardry.util.MagicDamage.DamageType; import electroblob.wizardry.util.MagicDamage.DamageType;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@@ -71,12 +71,12 @@ public class Freeze extends Spell {
double dz = target.posZ - caster.posZ; double dz = target.posZ - caster.posZ;
for(int i = 1; i < 5; i++){ for(int i = 1; i < 5; i++){
float brightness = 0.5f + (world.rand.nextFloat() / 2); float brightness = 0.5f + (world.rand.nextFloat() / 2);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, Wizardry.proxy.spawnParticle(Type.SPARKLE, world,
caster.posX + (i * (dx / 5)) + world.rand.nextFloat() / 5, caster.posX + (i * (dx / 5)) + world.rand.nextFloat() / 5,
WizardryUtilities.getPlayerEyesPos(caster) + (i * (dy / 5)) + world.rand.nextFloat() / 5, WizardryUtilities.getPlayerEyesPos(caster) + (i * (dy / 5)) + world.rand.nextFloat() / 5,
caster.posZ + (i * (dz / 5)) + world.rand.nextFloat() / 5, 0.0d, 0.0d, 0.0d, caster.posZ + (i * (dz / 5)) + world.rand.nextFloat() / 5, 0.0d, 0.0d, 0.0d,
12 + world.rand.nextInt(8), brightness, brightness + 0.1f, 1.0f); 12 + world.rand.nextInt(8), brightness, brightness + 0.1f, 1.0f);
Wizardry.proxy.spawnParticle(WizardryParticleType.SNOW, world, Wizardry.proxy.spawnParticle(Type.SNOW, world,
caster.posX + (i * (dx / 5)) + world.rand.nextFloat() / 5, caster.posX + (i * (dx / 5)) + world.rand.nextFloat() / 5,
WizardryUtilities.getPlayerEyesPos(caster) + (i * (dy / 5)) + world.rand.nextFloat() / 5, WizardryUtilities.getPlayerEyesPos(caster) + (i * (dy / 5)) + world.rand.nextFloat() / 5,
caster.posZ + (i * (dz / 5)) + world.rand.nextFloat() / 5, 0, -0.02, 0, caster.posZ + (i * (dz / 5)) + world.rand.nextFloat() / 5, 0, -0.02, 0,
@@ -117,13 +117,13 @@ public class Freeze extends Spell {
for(int i = 1; i < 5; i++){ for(int i = 1; i < 5; i++){
float brightness = 0.5f + (world.rand.nextFloat() / 2); float brightness = 0.5f + (world.rand.nextFloat() / 2);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, Wizardry.proxy.spawnParticle(Type.SPARKLE, world,
caster.posX + (i * (dx / 5)) + world.rand.nextFloat() / 5, caster.posX + (i * (dx / 5)) + world.rand.nextFloat() / 5,
WizardryUtilities.getPlayerEyesPos(caster) + (i * (dy / 5)) WizardryUtilities.getPlayerEyesPos(caster) + (i * (dy / 5))
+ world.rand.nextFloat() / 5, + world.rand.nextFloat() / 5,
caster.posZ + (i * (dz / 5)) + world.rand.nextFloat() / 5, 0.0d, 0.0d, 0.0d, caster.posZ + (i * (dz / 5)) + world.rand.nextFloat() / 5, 0.0d, 0.0d, 0.0d,
20 + world.rand.nextInt(8), brightness, brightness + 0.1f, 1.0f); 20 + world.rand.nextInt(8), brightness, brightness + 0.1f, 1.0f);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, Wizardry.proxy.spawnParticle(Type.SPARKLE, world,
caster.posX + (i * (dx / 5)) + world.rand.nextFloat() / 5, caster.posX + (i * (dx / 5)) + world.rand.nextFloat() / 5,
WizardryUtilities.getPlayerEyesPos(caster) + (i * (dy / 5)) WizardryUtilities.getPlayerEyesPos(caster) + (i * (dy / 5))
+ world.rand.nextFloat() / 5, + world.rand.nextFloat() / 5,
@@ -169,12 +169,12 @@ public class Freeze extends Spell {
double dz = target.posZ - caster.posZ; double dz = target.posZ - caster.posZ;
for(int i = 1; i < 5; i++){ for(int i = 1; i < 5; i++){
float brightness = 0.5f + (world.rand.nextFloat() / 2); float brightness = 0.5f + (world.rand.nextFloat() / 2);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, Wizardry.proxy.spawnParticle(Type.SPARKLE, world,
caster.posX + (i * (dx / 5)) + world.rand.nextFloat() / 5, caster.posX + (i * (dx / 5)) + world.rand.nextFloat() / 5,
caster.posY + caster.getEyeHeight() + (i * (dy / 5)) + world.rand.nextFloat() / 5, caster.posY + caster.getEyeHeight() + (i * (dy / 5)) + world.rand.nextFloat() / 5,
caster.posZ + (i * (dz / 5)) + world.rand.nextFloat() / 5, 0.0d, 0.0d, 0.0d, caster.posZ + (i * (dz / 5)) + world.rand.nextFloat() / 5, 0.0d, 0.0d, 0.0d,
12 + world.rand.nextInt(8), brightness, brightness + 0.1f, 1.0f); 12 + world.rand.nextInt(8), brightness, brightness + 0.1f, 1.0f);
Wizardry.proxy.spawnParticle(WizardryParticleType.SNOW, world, Wizardry.proxy.spawnParticle(Type.SNOW, world,
caster.posX + (i * (dx / 5)) + world.rand.nextFloat() / 5, caster.posX + (i * (dx / 5)) + world.rand.nextFloat() / 5,
caster.posY + caster.getEyeHeight() + (i * (dy / 5)) + world.rand.nextFloat() / 5, caster.posY + caster.getEyeHeight() + (i * (dy / 5)) + world.rand.nextFloat() / 5,
caster.posZ + (i * (dz / 5)) + world.rand.nextFloat() / 5, 0, -0.02, 0, caster.posZ + (i * (dz / 5)) + world.rand.nextFloat() / 5, 0, -0.02, 0,
@@ -10,7 +10,7 @@ import electroblob.wizardry.registry.WizardryEnchantments;
import electroblob.wizardry.registry.WizardryItems; import electroblob.wizardry.registry.WizardryItems;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@@ -60,7 +60,7 @@ public class FreezingWeapon extends Spell {
double y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F double y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F
+ world.rand.nextFloat()); + world.rand.nextFloat());
double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F); double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0, Wizardry.proxy.spawnParticle(Type.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0,
48 + world.rand.nextInt(12), 0.9f, 0.7f, 1.0f); 48 + world.rand.nextInt(12), 0.9f, 0.7f, 1.0f);
} }
} }
@@ -8,7 +8,7 @@ import electroblob.wizardry.item.IConjuredItem;
import electroblob.wizardry.registry.WizardryItems; import electroblob.wizardry.registry.WizardryItems;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction; import net.minecraft.item.EnumAction;
@@ -38,7 +38,7 @@ public class FrostAxe extends Spell {
double y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F double y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F
+ world.rand.nextFloat()); + world.rand.nextFloat());
double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F); double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F);
Wizardry.proxy.spawnParticle(WizardryParticleType.SNOW, world, x1, y1, z1, 0, -0.02d, 0, Wizardry.proxy.spawnParticle(Type.SNOW, world, x1, y1, z1, 0, -0.02d, 0,
40 + world.rand.nextInt(10)); 40 + world.rand.nextInt(10));
} }
} }
@@ -10,7 +10,7 @@ import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.MagicDamage; import electroblob.wizardry.util.MagicDamage;
import electroblob.wizardry.util.MagicDamage.DamageType; import electroblob.wizardry.util.MagicDamage.DamageType;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@@ -69,7 +69,7 @@ public class FrostRay extends Spell {
double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.y * i / 2 double y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.y * i / 2
+ world.rand.nextFloat() / 5 - 0.1f; + world.rand.nextFloat() / 5 - 0.1f;
double z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f; double z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, Wizardry.proxy.spawnParticle(Type.SPARKLE, world, x1, y1, z1,
look.x * modifiers.get(WizardryItems.range_upgrade), look.x * modifiers.get(WizardryItems.range_upgrade),
look.y * modifiers.get(WizardryItems.range_upgrade), look.y * modifiers.get(WizardryItems.range_upgrade),
look.z * modifiers.get(WizardryItems.range_upgrade), 8 + world.rand.nextInt(12), 0.4f, look.z * modifiers.get(WizardryItems.range_upgrade), 8 + world.rand.nextInt(12), 0.4f,
@@ -79,7 +79,7 @@ public class FrostRay extends Spell {
y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.y * i / 2 y1 = WizardryUtilities.getPlayerEyesPos(caster) - 0.4f + look.y * i / 2
+ world.rand.nextFloat() / 5 - 0.1f; + world.rand.nextFloat() / 5 - 0.1f;
z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f; z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, Wizardry.proxy.spawnParticle(Type.SPARKLE, world, x1, y1, z1,
look.x * modifiers.get(WizardryItems.range_upgrade), look.x * modifiers.get(WizardryItems.range_upgrade),
look.y * modifiers.get(WizardryItems.range_upgrade), look.y * modifiers.get(WizardryItems.range_upgrade),
look.z * modifiers.get(WizardryItems.range_upgrade), 8 + world.rand.nextInt(12), 1.0f, look.z * modifiers.get(WizardryItems.range_upgrade), 8 + world.rand.nextInt(12), 1.0f,
@@ -125,7 +125,7 @@ public class FrostRay extends Spell {
double y1 = caster.posY + caster.getEyeHeight() - 0.4f + vec.y * i / 2 double y1 = caster.posY + caster.getEyeHeight() - 0.4f + vec.y * i / 2
+ world.rand.nextFloat() / 5 - 0.1f; + world.rand.nextFloat() / 5 - 0.1f;
double z1 = caster.posZ + vec.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f; double z1 = caster.posZ + vec.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, Wizardry.proxy.spawnParticle(Type.SPARKLE, world, x1, y1, z1,
vec.x * modifiers.get(WizardryItems.range_upgrade), vec.x * modifiers.get(WizardryItems.range_upgrade),
vec.y * modifiers.get(WizardryItems.range_upgrade), vec.y * modifiers.get(WizardryItems.range_upgrade),
vec.z * modifiers.get(WizardryItems.range_upgrade), 8 + world.rand.nextInt(12), 0.4f, vec.z * modifiers.get(WizardryItems.range_upgrade), 8 + world.rand.nextInt(12), 0.4f,
@@ -135,7 +135,7 @@ public class FrostRay extends Spell {
y1 = caster.posY + caster.getEyeHeight() - 0.4f + vec.y * i / 2 + world.rand.nextFloat() / 5 y1 = caster.posY + caster.getEyeHeight() - 0.4f + vec.y * i / 2 + world.rand.nextFloat() / 5
- 0.1f; - 0.1f;
z1 = caster.posZ + vec.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f; z1 = caster.posZ + vec.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, Wizardry.proxy.spawnParticle(Type.SPARKLE, world, x1, y1, z1,
vec.x * modifiers.get(WizardryItems.range_upgrade), vec.x * modifiers.get(WizardryItems.range_upgrade),
vec.y * modifiers.get(WizardryItems.range_upgrade), vec.y * modifiers.get(WizardryItems.range_upgrade),
vec.z * modifiers.get(WizardryItems.range_upgrade), 8 + world.rand.nextInt(12), 1.0f, vec.z * modifiers.get(WizardryItems.range_upgrade), 8 + world.rand.nextInt(12), 1.0f,
@@ -5,7 +5,7 @@ import electroblob.wizardry.constants.Element;
import electroblob.wizardry.constants.SpellType; import electroblob.wizardry.constants.SpellType;
import electroblob.wizardry.constants.Tier; import electroblob.wizardry.constants.Tier;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.SoundEvents; import net.minecraft.init.SoundEvents;
@@ -32,11 +32,11 @@ public class Glide extends Spell {
} }
if(world.isRemote){ if(world.isRemote){
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, Wizardry.proxy.spawnParticle(Type.SPARKLE, world,
caster.posX - 0.25d + world.rand.nextDouble() / 2, caster.posX - 0.25d + world.rand.nextDouble() / 2,
WizardryUtilities.getPlayerEyesPos(caster) - 1.5f + world.rand.nextDouble(), WizardryUtilities.getPlayerEyesPos(caster) - 1.5f + world.rand.nextDouble(),
caster.posZ - 0.25d + world.rand.nextDouble() / 2, 0, -0.1F, 0, 15, 1.0f, 1.0f, 1.0f); caster.posZ - 0.25d + world.rand.nextDouble() / 2, 0, -0.1F, 0, 15, 1.0f, 1.0f, 1.0f);
Wizardry.proxy.spawnParticle(WizardryParticleType.LEAF, world, Wizardry.proxy.spawnParticle(Type.LEAF, world,
caster.posX - 0.25d + world.rand.nextDouble() / 2, caster.posX - 0.25d + world.rand.nextDouble() / 2,
WizardryUtilities.getPlayerEyesPos(caster) - 1.5f + world.rand.nextDouble(), WizardryUtilities.getPlayerEyesPos(caster) - 1.5f + world.rand.nextDouble(),
caster.posZ - 0.25d + world.rand.nextDouble() / 2, 0, -0.03, 0, 20); caster.posZ - 0.25d + world.rand.nextDouble() / 2, 0, -0.03, 0, 20);
@@ -6,7 +6,7 @@ import electroblob.wizardry.constants.SpellType;
import electroblob.wizardry.constants.Tier; import electroblob.wizardry.constants.Tier;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@@ -32,7 +32,7 @@ public class GreaterHeal extends Spell {
double dy = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F double dy = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F
+ world.rand.nextFloat()); + world.rand.nextFloat());
double dz = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F); double dz = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, dx, dy, dz, 0, 0.1F, 0, Wizardry.proxy.spawnParticle(Type.SPARKLE, world, dx, dy, dz, 0, 0.1F, 0,
48 + world.rand.nextInt(12), 1.0f, 1.0f, 0.3f); 48 + world.rand.nextInt(12), 1.0f, 1.0f, 0.3f);
} }
} }
@@ -54,7 +54,7 @@ public class GreaterHeal extends Spell {
double dx = (double)((float)caster.posX + world.rand.nextFloat() * 2 - 1.0F); double dx = (double)((float)caster.posX + world.rand.nextFloat() * 2 - 1.0F);
double dy = (double)((float)caster.posY + caster.getEyeHeight() - 0.5F + world.rand.nextFloat()); double dy = (double)((float)caster.posY + caster.getEyeHeight() - 0.5F + world.rand.nextFloat());
double dz = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F); double dz = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, dx, dy, dz, 0, 0.1F, 0, Wizardry.proxy.spawnParticle(Type.SPARKLE, world, dx, dy, dz, 0, 0.1F, 0,
48 + world.rand.nextInt(12), 1.0f, 1.0f, 0.3f); 48 + world.rand.nextInt(12), 1.0f, 1.0f, 0.3f);
} }
} }
@@ -10,7 +10,7 @@ import electroblob.wizardry.entity.living.ISummonedCreature;
import electroblob.wizardry.registry.WizardryItems; import electroblob.wizardry.registry.WizardryItems;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@@ -48,7 +48,7 @@ public class GroupHeal extends Spell {
double d1 = (double)((float)WizardryUtilities.getPlayerEyesPos((EntityPlayer)target) double d1 = (double)((float)WizardryUtilities.getPlayerEyesPos((EntityPlayer)target)
- 0.5F + world.rand.nextFloat()); - 0.5F + world.rand.nextFloat());
double d2 = (double)((float)target.posZ + world.rand.nextFloat() * 2 - 1.0F); double d2 = (double)((float)target.posZ + world.rand.nextFloat() * 2 - 1.0F);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, d0, d1, d2, 0, 0.1F, Wizardry.proxy.spawnParticle(Type.SPARKLE, world, d0, d1, d2, 0, 0.1F,
0, 48 + world.rand.nextInt(12), 1.0f, 1.0f, 0.3f); 0, 48 + world.rand.nextInt(12), 1.0f, 1.0f, 0.3f);
} }
} }
@@ -77,7 +77,7 @@ public class GroupHeal extends Spell {
double d1 = (double)((float)WizardryUtilities.getPlayerEyesPos((EntityPlayer)target) double d1 = (double)((float)WizardryUtilities.getPlayerEyesPos((EntityPlayer)target)
- 0.5F + world.rand.nextFloat()); - 0.5F + world.rand.nextFloat());
double d2 = (double)((float)target.posZ + world.rand.nextFloat() * 2 - 1.0F); double d2 = (double)((float)target.posZ + world.rand.nextFloat() * 2 - 1.0F);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, d0, d1, d2, 0, 0.1F, Wizardry.proxy.spawnParticle(Type.SPARKLE, world, d0, d1, d2, 0, 0.1F,
0, 48 + world.rand.nextInt(12), 1.0f, 1.0f, 0.3f); 0, 48 + world.rand.nextInt(12), 1.0f, 1.0f, 0.3f);
} }
} }
@@ -6,7 +6,7 @@ import electroblob.wizardry.constants.SpellType;
import electroblob.wizardry.constants.Tier; import electroblob.wizardry.constants.Tier;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@@ -31,12 +31,11 @@ public class Heal extends Spell {
if(world.isRemote){ if(world.isRemote){
for(int i = 0; i < 10; i++){ for(int i = 0; i < 10; i++){
double d0 = (double)((float)caster.posX + world.rand.nextFloat() * 2 - 1.0F); double d0 = (double)((float)caster.posX + world.rand.nextFloat() * 2 - 1.0F);
// Apparently the client side spawns the particles 1 block higher than it should... hence the - // Apparently the client side spawns the particles 1 block higher than it should... hence the -0.5F.
// 0.5F.
double d1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F double d1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F
+ world.rand.nextFloat()); + world.rand.nextFloat());
double d2 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F); double d2 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, d0, d1, d2, 0, 0.1F, 0, Wizardry.proxy.spawnParticle(Type.SPARKLE, world, d0, d1, d2, 0, 0.1F, 0,
48 + world.rand.nextInt(12), 1.0f, 1.0f, 0.3f); 48 + world.rand.nextInt(12), 1.0f, 1.0f, 0.3f);
} }
} }
@@ -59,7 +58,7 @@ public class Heal extends Spell {
double dx = (double)((float)caster.posX + world.rand.nextFloat() * 2 - 1.0F); double dx = (double)((float)caster.posX + world.rand.nextFloat() * 2 - 1.0F);
double dy = (double)((float)caster.posY + caster.getEyeHeight() - 0.5F + world.rand.nextFloat()); double dy = (double)((float)caster.posY + caster.getEyeHeight() - 0.5F + world.rand.nextFloat());
double dz = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F); double dz = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, dx, dy, dz, 0, 0.1F, 0, Wizardry.proxy.spawnParticle(Type.SPARKLE, world, dx, dy, dz, 0, 0.1F, 0,
48 + world.rand.nextInt(12), 1.0f, 1.0f, 0.3f); 48 + world.rand.nextInt(12), 1.0f, 1.0f, 0.3f);
} }
} }
@@ -7,7 +7,7 @@ import electroblob.wizardry.constants.Tier;
import electroblob.wizardry.registry.WizardryItems; import electroblob.wizardry.registry.WizardryItems;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@@ -41,7 +41,7 @@ public class HealAlly extends Spell {
double d1 = (double)((float)target.getEntityBoundingBox().minY + target.height - 0.5f double d1 = (double)((float)target.getEntityBoundingBox().minY + target.height - 0.5f
+ world.rand.nextFloat()); + world.rand.nextFloat());
double d2 = (double)((float)target.posZ + world.rand.nextFloat() * 2 - 1.0F); double d2 = (double)((float)target.posZ + world.rand.nextFloat() * 2 - 1.0F);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, d0, d1, d2, 0, 0.1F, 0, Wizardry.proxy.spawnParticle(Type.SPARKLE, world, d0, d1, d2, 0, 0.1F, 0,
48 + world.rand.nextInt(12), 1.0f, 1.0f, 0.3f); 48 + world.rand.nextInt(12), 1.0f, 1.0f, 0.3f);
} }
} }
@@ -10,7 +10,7 @@ import electroblob.wizardry.registry.WizardryItems;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.tileentity.TileEntityStatue; import electroblob.wizardry.tileentity.TileEntityStatue;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.monster.EntityBlaze; import net.minecraft.entity.monster.EntityBlaze;
@@ -115,9 +115,9 @@ public class IceStatue extends Spell {
+ world.rand.nextFloat() / 5 - 0.1f; + world.rand.nextFloat() / 5 - 0.1f;
double z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f; double z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, 0.0d, 0.0d, 0.0d, Wizardry.proxy.spawnParticle(Type.SPARKLE, world, x1, y1, z1, 0.0d, 0.0d, 0.0d,
12 + world.rand.nextInt(8), brightness, brightness + 0.1f, 1.0f); 12 + world.rand.nextInt(8), brightness, brightness + 0.1f, 1.0f);
Wizardry.proxy.spawnParticle(WizardryParticleType.SNOW, world, x1, y1, z1, 0.0d, -0.02d, 0.0d, Wizardry.proxy.spawnParticle(Type.SNOW, world, x1, y1, z1, 0.0d, -0.02d, 0.0d,
20 + world.rand.nextInt(10)); 20 + world.rand.nextInt(10));
} }
@@ -10,7 +10,7 @@ import electroblob.wizardry.registry.WizardryEnchantments;
import electroblob.wizardry.registry.WizardryItems; import electroblob.wizardry.registry.WizardryItems;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.enchantment.EnchantmentHelper; import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
@@ -69,7 +69,7 @@ public class ImbueWeapon extends Spell {
double y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F double y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F
+ world.rand.nextFloat()); + world.rand.nextFloat());
double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F); double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0, Wizardry.proxy.spawnParticle(Type.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0,
48 + world.rand.nextInt(12), 0.9f, 0.7f, 1.0f); 48 + world.rand.nextInt(12), 0.9f, 0.7f, 1.0f);
} }
} }
@@ -9,7 +9,7 @@ import electroblob.wizardry.constants.Tier;
import electroblob.wizardry.registry.WizardryItems; import electroblob.wizardry.registry.WizardryItems;
import electroblob.wizardry.registry.WizardryPotions; import electroblob.wizardry.registry.WizardryPotions;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityCreature; import net.minecraft.entity.EntityCreature;
@@ -62,7 +62,7 @@ public class Intimidate extends Spell {
}else{ }else{
for(int i = 0; i < 30; i++){ for(int i = 0; i < 30; i++){
Wizardry.proxy.spawnParticle(WizardryParticleType.DARK_MAGIC, world, Wizardry.proxy.spawnParticle(Type.DARK_MAGIC, world,
caster.posX - 1 + world.rand.nextDouble() * 2, caster.posX - 1 + world.rand.nextDouble() * 2,
caster.getEntityBoundingBox().minY + 1.5 + world.rand.nextDouble() * 0.5, caster.getEntityBoundingBox().minY + 1.5 + world.rand.nextDouble() * 0.5,
caster.posZ - 1 + world.rand.nextDouble() * 2, 0, 0, 0, 0, 0.9f, 0.1f, 0.0f); caster.posZ - 1 + world.rand.nextDouble() * 2, 0, 0, 0, 0, 0.9f, 0.1f, 0.0f);
@@ -9,7 +9,7 @@ import electroblob.wizardry.constants.Tier;
import electroblob.wizardry.registry.WizardryItems; import electroblob.wizardry.registry.WizardryItems;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.MobEffects; import net.minecraft.init.MobEffects;
@@ -44,7 +44,7 @@ public class InvigoratingPresence extends Spell {
for(int i = 0; i < 50 * modifiers.get(WizardryItems.blast_upgrade); i++){ for(int i = 0; i < 50 * modifiers.get(WizardryItems.blast_upgrade); i++){
double radius = (1 + world.rand.nextDouble() * 4) * modifiers.get(WizardryItems.blast_upgrade); double radius = (1 + world.rand.nextDouble() * 4) * modifiers.get(WizardryItems.blast_upgrade);
double angle = world.rand.nextDouble() * Math.PI * 2; double angle = world.rand.nextDouble() * Math.PI * 2;
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, Wizardry.proxy.spawnParticle(Type.SPARKLE, world,
caster.posX + radius * Math.cos(angle), caster.getEntityBoundingBox().minY, caster.posX + radius * Math.cos(angle), caster.getEntityBoundingBox().minY,
caster.posZ + radius * Math.sin(angle), 0, 0.03, 0, 50, 1, 0.2f, 0.2f); caster.posZ + radius * Math.sin(angle), 0, 0.03, 0, 50, 1, 0.2f, 0.2f);
@@ -7,7 +7,7 @@ import electroblob.wizardry.constants.Tier;
import electroblob.wizardry.registry.WizardryItems; import electroblob.wizardry.registry.WizardryItems;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@@ -35,7 +35,7 @@ public class Invisibility extends Spell {
double x1 = (double)((float)caster.posX + world.rand.nextFloat() * 2 - 1.0F); double x1 = (double)((float)caster.posX + world.rand.nextFloat() * 2 - 1.0F);
double y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F + world.rand.nextFloat()); double y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F + world.rand.nextFloat());
double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F); double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0, Wizardry.proxy.spawnParticle(Type.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0,
48 + world.rand.nextInt(12), 0.7f, 1.0f, 1.0f); 48 + world.rand.nextInt(12), 0.7f, 1.0f, 1.0f);
} }
} }
@@ -58,7 +58,7 @@ public class Invisibility extends Spell {
double x1 = (double)((float)caster.posX + world.rand.nextFloat() * 2 - 1.0F); double x1 = (double)((float)caster.posX + world.rand.nextFloat() * 2 - 1.0F);
double y1 = (double)((float)caster.posY + caster.getEyeHeight() - 0.5F + world.rand.nextFloat()); double y1 = (double)((float)caster.posY + caster.getEyeHeight() - 0.5F + world.rand.nextFloat());
double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F); double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0, Wizardry.proxy.spawnParticle(Type.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0,
48 + world.rand.nextInt(12), 0.7f, 1.0f, 1.0f); 48 + world.rand.nextInt(12), 0.7f, 1.0f, 1.0f);
} }
} }
@@ -7,7 +7,7 @@ import electroblob.wizardry.constants.Element;
import electroblob.wizardry.constants.SpellType; import electroblob.wizardry.constants.SpellType;
import electroblob.wizardry.constants.Tier; import electroblob.wizardry.constants.Tier;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.SoundEvents; import net.minecraft.init.SoundEvents;
@@ -54,7 +54,7 @@ public class InvokeWeather extends Spell {
double y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F double y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F
+ world.rand.nextFloat()); + world.rand.nextFloat());
double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F); double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0, Wizardry.proxy.spawnParticle(Type.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0,
48 + world.rand.nextInt(12), 0.5f, 0.7f, 1.0f); 48 + world.rand.nextInt(12), 0.5f, 0.7f, 1.0f);
} }
} }
@@ -7,7 +7,7 @@ import electroblob.wizardry.constants.Tier;
import electroblob.wizardry.registry.WizardryItems; import electroblob.wizardry.registry.WizardryItems;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@@ -35,7 +35,7 @@ public class Ironflesh extends Spell {
double x1 = (double)((float)caster.posX + world.rand.nextFloat() * 2 - 1.0F); double x1 = (double)((float)caster.posX + world.rand.nextFloat() * 2 - 1.0F);
double y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F + world.rand.nextFloat()); double y1 = (double)((float)WizardryUtilities.getPlayerEyesPos(caster) - 0.5F + world.rand.nextFloat());
double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F); double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0, Wizardry.proxy.spawnParticle(Type.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0,
48 + world.rand.nextInt(12), 0.4f, 0.5f, 0.6f); 48 + world.rand.nextInt(12), 0.4f, 0.5f, 0.6f);
} }
} }
@@ -59,7 +59,7 @@ public class Ironflesh extends Spell {
double x1 = (double)((float)caster.posX + world.rand.nextFloat() * 2 - 1.0F); double x1 = (double)((float)caster.posX + world.rand.nextFloat() * 2 - 1.0F);
double y1 = (double)((float)caster.posY + caster.getEyeHeight() - 0.5F + world.rand.nextFloat()); double y1 = (double)((float)caster.posY + caster.getEyeHeight() - 0.5F + world.rand.nextFloat());
double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F); double z1 = (double)((float)caster.posZ + world.rand.nextFloat() * 2 - 1.0F);
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0, Wizardry.proxy.spawnParticle(Type.SPARKLE, world, x1, y1, z1, 0, 0.1F, 0,
48 + world.rand.nextInt(12), 0.4f, 0.5f, 0.6f); 48 + world.rand.nextInt(12), 0.4f, 0.5f, 0.6f);
} }
} }
@@ -6,7 +6,7 @@ import electroblob.wizardry.constants.SpellType;
import electroblob.wizardry.constants.Tier; import electroblob.wizardry.constants.Tier;
import electroblob.wizardry.registry.WizardrySounds; import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumAction; import net.minecraft.item.EnumAction;
@@ -27,7 +27,7 @@ public class Levitation extends Spell {
caster.motionY = caster.motionY < 0.5d ? caster.motionY + 0.1d : caster.motionY; caster.motionY = caster.motionY < 0.5d ? caster.motionY + 0.1d : caster.motionY;
if(world.isRemote){ if(world.isRemote){
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, Wizardry.proxy.spawnParticle(Type.SPARKLE, world,
caster.posX - 0.25d + world.rand.nextDouble() / 2, caster.posX - 0.25d + world.rand.nextDouble() / 2,
WizardryUtilities.getPlayerEyesPos(caster) - 1.5f, WizardryUtilities.getPlayerEyesPos(caster) - 1.5f,
caster.posZ - 0.25d + world.rand.nextDouble() / 2, 0, -0.1F, 0, 15, 0.5f, 1.0f, 0.7f); caster.posZ - 0.25d + world.rand.nextDouble() / 2, 0, -0.1F, 0, 15, 0.5f, 1.0f, 0.7f);
@@ -9,7 +9,7 @@ import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.MagicDamage; import electroblob.wizardry.util.MagicDamage;
import electroblob.wizardry.util.MagicDamage.DamageType; import electroblob.wizardry.util.MagicDamage.DamageType;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@@ -54,10 +54,10 @@ public class LifeDrain extends Spell {
double z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f; double z1 = caster.posZ + look.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
// world.spawnParticle("mobSpell", x1, y1, z1, -1*look.xCoord, -1*look.yCoord, -1*look.zCoord); // world.spawnParticle("mobSpell", x1, y1, z1, -1*look.xCoord, -1*look.yCoord, -1*look.zCoord);
if(i % 5 == 0){ if(i % 5 == 0){
Wizardry.proxy.spawnParticle(WizardryParticleType.DARK_MAGIC, world, x1, y1, z1, 0.0d, 0.0d, 0.0d, Wizardry.proxy.spawnParticle(Type.DARK_MAGIC, world, x1, y1, z1, 0.0d, 0.0d, 0.0d,
0, 0.1f, 0.0f, 0.0f); 0, 0.1f, 0.0f, 0.0f);
} }
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, -0.05 * look.x * i, Wizardry.proxy.spawnParticle(Type.SPARKLE, world, x1, y1, z1, -0.05 * look.x * i,
-0.05 * look.y * i, -0.05 * look.z * i, 8 + world.rand.nextInt(6), 0.5f, 0.0f, 0.0f); -0.05 * look.y * i, -0.05 * look.z * i, 8 + world.rand.nextInt(6), 0.5f, 0.0f, 0.0f);
} }
} }
@@ -92,10 +92,10 @@ public class LifeDrain extends Spell {
double z1 = caster.posZ + vec.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f; double z1 = caster.posZ + vec.z * i / 2 + world.rand.nextFloat() / 5 - 0.1f;
// world.spawnParticle("mobSpell", x1, y1, z1, -1*look.xCoord, -1*look.yCoord, -1*look.zCoord); // world.spawnParticle("mobSpell", x1, y1, z1, -1*look.xCoord, -1*look.yCoord, -1*look.zCoord);
if(i % 5 == 0){ if(i % 5 == 0){
Wizardry.proxy.spawnParticle(WizardryParticleType.DARK_MAGIC, world, x1, y1, z1, 0.0d, 0.0d, 0.0d, Wizardry.proxy.spawnParticle(Type.DARK_MAGIC, world, x1, y1, z1, 0.0d, 0.0d, 0.0d,
0, 0.1f, 0.0f, 0.0f); 0, 0.1f, 0.0f, 0.0f);
} }
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, x1, y1, z1, -0.05 * vec.x * i, Wizardry.proxy.spawnParticle(Type.SPARKLE, world, x1, y1, z1, -0.05 * vec.x * i,
-0.05 * vec.y * i, -0.05 * vec.z * i, 8 + world.rand.nextInt(6), 0.5f, 0.0f, 0.0f); -0.05 * vec.y * i, -0.05 * vec.z * i, 8 + world.rand.nextInt(6), 0.5f, 0.0f, 0.0f);
} }
} }
@@ -10,7 +10,7 @@ import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.MagicDamage; import electroblob.wizardry.util.MagicDamage;
import electroblob.wizardry.util.MagicDamage.DamageType; import electroblob.wizardry.util.MagicDamage.DamageType;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving; import net.minecraft.entity.EntityLiving;
@@ -63,7 +63,7 @@ public class LightningRay extends Spell {
}else{ }else{
for(int i = 0; i < 5; i++){ for(int i = 0; i < 5; i++){
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world, Wizardry.proxy.spawnParticle(Type.SPARK, world,
target.posX + world.rand.nextFloat() - 0.5, target.posX + world.rand.nextFloat() - 0.5,
target.getEntityBoundingBox().minY + target.height / 2 + world.rand.nextFloat() * 2 - 1, target.getEntityBoundingBox().minY + target.height / 2 + world.rand.nextFloat() * 2 - 1,
target.posZ + world.rand.nextFloat() - 0.5, 0, 0, 0, 3); target.posZ + world.rand.nextFloat() - 0.5, 0, 0, 0, 3);
@@ -132,7 +132,7 @@ public class LightningRay extends Spell {
}else{ }else{
for(int i = 0; i < 5; i++){ for(int i = 0; i < 5; i++){
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world, Wizardry.proxy.spawnParticle(Type.SPARK, world,
target.posX + world.rand.nextFloat() - 0.5, target.posX + world.rand.nextFloat() - 0.5,
target.getEntityBoundingBox().minY + target.height / 2 + world.rand.nextFloat() * 2 - 1, target.getEntityBoundingBox().minY + target.height / 2 + world.rand.nextFloat() * 2 - 1,
target.posZ + world.rand.nextFloat() - 0.5, 0, 0, 0, 3); target.posZ + world.rand.nextFloat() - 0.5, 0, 0, 0, 3);
@@ -12,7 +12,7 @@ import electroblob.wizardry.registry.WizardrySounds;
import electroblob.wizardry.util.MagicDamage; import electroblob.wizardry.util.MagicDamage;
import electroblob.wizardry.util.MagicDamage.DamageType; import electroblob.wizardry.util.MagicDamage.DamageType;
import electroblob.wizardry.util.SpellModifiers; import electroblob.wizardry.util.SpellModifiers;
import electroblob.wizardry.util.WizardryParticleType; import electroblob.wizardry.util.ParticleBuilder.Type;
import electroblob.wizardry.util.WizardryUtilities; import electroblob.wizardry.util.WizardryUtilities;
import net.minecraft.entity.Entity; import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.EntityLivingBase;
@@ -71,7 +71,7 @@ public class LightningWeb extends Spell {
} }
}else{ }else{
for(int i = 0; i < 5; i++){ for(int i = 0; i < 5; i++){
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world, Wizardry.proxy.spawnParticle(Type.SPARK, world,
target.posX + world.rand.nextFloat() - 0.5, target.posX + world.rand.nextFloat() - 0.5,
target.getEntityBoundingBox().minY + target.height / 2 + world.rand.nextFloat() * 2 - 1, target.getEntityBoundingBox().minY + target.height / 2 + world.rand.nextFloat() * 2 - 1,
target.posZ + world.rand.nextFloat() - 0.5, 0, 0, 0, 3); target.posZ + world.rand.nextFloat() - 0.5, 0, 0, 0, 3);
@@ -121,7 +121,7 @@ public class LightningWeb extends Spell {
} }
}else{ }else{
for(int i = 0; i < 5; i++){ for(int i = 0; i < 5; i++){
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world, Wizardry.proxy.spawnParticle(Type.SPARK, world,
secondaryTarget.posX + world.rand.nextFloat() - 0.5, secondaryTarget.posX + world.rand.nextFloat() - 0.5,
secondaryTarget.getEntityBoundingBox().minY + secondaryTarget.height / 2 secondaryTarget.getEntityBoundingBox().minY + secondaryTarget.height / 2
+ world.rand.nextFloat() * 2 - 1, + world.rand.nextFloat() * 2 - 1,
@@ -173,7 +173,7 @@ public class LightningWeb extends Spell {
} }
}else{ }else{
for(int i = 0; i < 5; i++){ for(int i = 0; i < 5; i++){
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world, Wizardry.proxy.spawnParticle(Type.SPARK, world,
tertiaryTarget.posX + world.rand.nextFloat() - 0.5, tertiaryTarget.posX + world.rand.nextFloat() - 0.5,
tertiaryTarget.getEntityBoundingBox().minY + tertiaryTarget.height / 2 tertiaryTarget.getEntityBoundingBox().minY + tertiaryTarget.height / 2
+ world.rand.nextFloat() * 2 - 1, + world.rand.nextFloat() * 2 - 1,

Some files were not shown because too many files have changed in this diff Show More