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:
@@ -2,12 +2,12 @@ package electroblob.wizardry.entity.construct;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.registry.WizardryPotions;
|
||||
import electroblob.wizardry.registry.WizardrySounds;
|
||||
import electroblob.wizardry.util.MagicDamage;
|
||||
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 net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
@@ -61,16 +61,23 @@ public class EntityBlizzard extends EntityMagicConstruct {
|
||||
target.addPotionEffect(new PotionEffect(WizardryPotions.frost, 20, 0));
|
||||
}
|
||||
}else{
|
||||
// For some reason this number of particles now causes the game to lag significantly, despite it being fine
|
||||
// in 1.7.10. I thought particles were supposed to be LESS laggy now...
|
||||
for(int i = 1; i < 6; i++){
|
||||
for(int i=1; i<6; i++){
|
||||
|
||||
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,
|
||||
false, rand.nextDouble() * 2.5d + 0.5d);
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.BLIZZARD, world, this.posX,
|
||||
this.posY + rand.nextDouble() * 3, this.posZ, 0, 0, 0, 100, 1.0f, 1.0f, 1.0f, false,
|
||||
rand.nextDouble() * 2.5d + 0.5d);
|
||||
|
||||
ParticleBuilder.create(Type.BLIZZARD)
|
||||
.pos(this.posX, this.posY + rand.nextDouble() * 3, this.posZ)
|
||||
.lifetime(100)
|
||||
.colour(brightness, brightness + 0.1f, 1.0f)
|
||||
.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 electroblob.wizardry.Wizardry;
|
||||
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 net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
@@ -53,12 +53,17 @@ public class EntityDecay extends EntityMagicConstruct {
|
||||
target.addPotionEffect(new PotionEffect(WizardryPotions.decay, LIFETIME, 0));
|
||||
}
|
||||
}
|
||||
|
||||
}else if(this.rand.nextInt(15) == 0){
|
||||
|
||||
double radius = rand.nextDouble() * 0.8;
|
||||
double angle = rand.nextDouble() * Math.PI * 2;
|
||||
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 electroblob.wizardry.Wizardry;
|
||||
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 net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -62,15 +62,18 @@ public class EntityForcefield extends EntityMagicConstruct {
|
||||
}
|
||||
}else{
|
||||
for(int i = 1; i < 40; i++){
|
||||
|
||||
// Generates a spherical pattern of particles
|
||||
float brightness = 0.5f + (rand.nextFloat() * 0.5f);
|
||||
double radius = 3;
|
||||
double yaw = rand.nextDouble() * Math.PI * 2;
|
||||
double pitch = (rand.nextDouble() - 0.5) * Math.PI;
|
||||
// Generates a spherical pattern of particles
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.BRIGHT_DUST, world,
|
||||
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),
|
||||
brightness, brightness, 1.0f);
|
||||
|
||||
ParticleBuilder.create(Type.DUST)
|
||||
.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))
|
||||
.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 electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.registry.WizardryPotions;
|
||||
import electroblob.wizardry.registry.WizardrySounds;
|
||||
import electroblob.wizardry.util.MagicDamage;
|
||||
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 net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
@@ -74,8 +74,10 @@ public class EntityFrostSigil extends EntityMagicConstruct {
|
||||
}else if(this.rand.nextInt(15) == 0){
|
||||
double radius = 0.5 + rand.nextDouble() * 0.3;
|
||||
double angle = rand.nextDouble() * Math.PI * 2;
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SNOW, world, this.posX + radius * Math.cos(angle),
|
||||
this.posY + 0.1, this.posZ + radius * Math.sin(angle), 0, 0, 0, 40 + rand.nextInt(10));
|
||||
ParticleBuilder.create(Type.SNOW)
|
||||
.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.util.MagicDamage;
|
||||
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 net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
@@ -69,8 +70,9 @@ public class EntityHammer extends EntityMagicConstruct {
|
||||
}
|
||||
|
||||
if(this.world.isRemote && this.ticksExisted % 3 == 0){
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world, this.posX - 0.5d + rand.nextDouble(),
|
||||
this.posY + 2 * rand.nextDouble(), this.posZ - 0.5d + rand.nextDouble(), 0, 0, 0, 3);
|
||||
ParticleBuilder.create(Type.SPARK)
|
||||
.pos(this.posX - 0.5d + rand.nextDouble(), this.posY + 2 * rand.nextDouble(), this.posZ - 0.5d + rand.nextDouble())
|
||||
.spawn(world);
|
||||
}
|
||||
|
||||
if(!this.world.isRemote){
|
||||
@@ -109,12 +111,14 @@ public class EntityHammer extends EntityMagicConstruct {
|
||||
target.posY + target.height / 2, target.posZ);
|
||||
world.spawnEntity(arc);
|
||||
}else{
|
||||
for(int j = 0; j < 8; j++){
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world,
|
||||
target.posX + world.rand.nextFloat() - 0.5,
|
||||
target.getEntityBoundingBox().minY + target.height / 2
|
||||
+ world.rand.nextFloat() * 2 - 1,
|
||||
target.posZ + world.rand.nextFloat() - 0.5, 0, 0, 0, 3);
|
||||
// TODO: Move all the arc particle (and sound?) stuff into a method in WizardryUtilities
|
||||
for(int j=0; j<8; j++){
|
||||
ParticleBuilder.create(Type.SPARK)
|
||||
.pos(target.posX + world.rand.nextFloat() - 0.5,
|
||||
target.getEntityBoundingBox().minY + target.height / 2 + world.rand.nextFloat() * 2 - 1,
|
||||
target.posZ + world.rand.nextFloat() - 0.5)
|
||||
.spawn(world);
|
||||
|
||||
world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, target.posX + rand.nextFloat(),
|
||||
target.getEntityBoundingBox().minY + target.height / 2 + rand.nextFloat(),
|
||||
target.posZ + rand.nextFloat(), 0, 0, 0);
|
||||
|
||||
@@ -2,11 +2,11 @@ package electroblob.wizardry.entity.construct;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.registry.WizardrySounds;
|
||||
import electroblob.wizardry.util.MagicDamage;
|
||||
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 net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.util.DamageSource;
|
||||
@@ -69,13 +69,16 @@ public class EntityHealAura extends EntityMagicConstruct {
|
||||
}
|
||||
}
|
||||
}else{
|
||||
for(int i = 1; i < 3; i++){
|
||||
for(int i=1; i<3; i++){
|
||||
float brightness = 0.5f + (rand.nextFloat() * 0.5f);
|
||||
double radius = rand.nextDouble() * 2.0;
|
||||
double angle = rand.nextDouble() * Math.PI * 2;
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, this.posX + radius * Math.cos(angle),
|
||||
this.posY, this.posZ + radius * Math.sin(angle), 0, 0.05f, 0, 48 + this.rand.nextInt(12), 1.0f,
|
||||
1.0f, brightness);
|
||||
ParticleBuilder.create(Type.SPARKLE)
|
||||
.pos(this.posX + radius * Math.cos(angle), this.posY, this.posZ + radius * Math.sin(angle))
|
||||
.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 electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.entity.EntityArc;
|
||||
import electroblob.wizardry.registry.WizardrySounds;
|
||||
import electroblob.wizardry.util.MagicDamage;
|
||||
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 net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.util.DamageSource;
|
||||
@@ -44,8 +44,6 @@ public class EntityLightningSigil extends EntityMagicConstruct {
|
||||
this.setDead();
|
||||
}
|
||||
|
||||
// if(!this.world.isRemote){
|
||||
|
||||
List<EntityLivingBase> targets = WizardryUtilities.getEntitiesWithinRadius(1.0d, this.posX, this.posY,
|
||||
this.posZ, this.world);
|
||||
|
||||
@@ -90,11 +88,11 @@ public class EntityLightningSigil extends EntityMagicConstruct {
|
||||
world.spawnEntity(arc);
|
||||
}else{
|
||||
for(int k = 0; k < 8; k++){
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world,
|
||||
secondaryTarget.posX + world.rand.nextFloat() - 0.5,
|
||||
secondaryTarget.getEntityBoundingBox().minY + secondaryTarget.height / 2
|
||||
+ world.rand.nextFloat() * 2 - 1,
|
||||
secondaryTarget.posZ + world.rand.nextFloat() - 0.5, 0, 0, 0, 3);
|
||||
ParticleBuilder.create(Type.SPARK)
|
||||
.pos(secondaryTarget.posX + world.rand.nextFloat() - 0.5,
|
||||
secondaryTarget.getEntityBoundingBox().minY + secondaryTarget.height / 2 + world.rand.nextFloat() * 2 - 1,
|
||||
secondaryTarget.posZ + world.rand.nextFloat() - 0.5)
|
||||
.spawn(world);
|
||||
world.spawnParticle(EnumParticleTypes.SMOKE_LARGE,
|
||||
secondaryTarget.posX + world.rand.nextFloat() - 0.5,
|
||||
secondaryTarget.getEntityBoundingBox().minY + secondaryTarget.height / 2
|
||||
@@ -116,13 +114,13 @@ public class EntityLightningSigil extends EntityMagicConstruct {
|
||||
}
|
||||
}
|
||||
}
|
||||
// }
|
||||
|
||||
if(this.world.isRemote && this.rand.nextInt(15) == 0){
|
||||
double radius = 0.5 + rand.nextDouble() * 0.3;
|
||||
double angle = rand.nextDouble() * Math.PI * 2;
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world, this.posX + radius * Math.cos(angle),
|
||||
this.posY + 0.1, this.posZ + radius * Math.sin(angle), 0, 0, 0, 3);
|
||||
ParticleBuilder.create(Type.SPARK)
|
||||
.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.util.MagicDamage;
|
||||
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 io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -133,24 +134,22 @@ public class EntityTornado extends EntityMagicConstruct {
|
||||
yPos / 3 + 0.5d, 100, block, pos1);
|
||||
Wizardry.proxy.spawnTornadoParticle(world, this.posX, this.posY + yPos, this.posZ, this.velX, this.velZ,
|
||||
yPos / 3 + 0.5d, 100, block, pos1);
|
||||
|
||||
// Sometimes spawns leaf particles if the block is leaves, or snow particles if the block is snow
|
||||
if(this.rand.nextInt(3) == 0){
|
||||
|
||||
// Sometimes spawns leaf particles if the block is leaves
|
||||
if(block.getMaterial() == Material.LEAVES && this.rand.nextInt(3) == 0){
|
||||
Type type = null;
|
||||
|
||||
if(block.getMaterial() == Material.LEAVES) type = Type.LEAF;
|
||||
if(block.getMaterial() == Material.SNOW || block.getMaterial() == Material.CRAFTED_SNOW)
|
||||
type = Type.SNOW;
|
||||
|
||||
double yPos1 = rand.nextDouble() * 8;
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.LEAF, world,
|
||||
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,
|
||||
40 + rand.nextInt(10));
|
||||
}
|
||||
|
||||
// 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;
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SNOW, world,
|
||||
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,
|
||||
40 + rand.nextInt(10));
|
||||
ParticleBuilder.create(type)
|
||||
.pos(this.posX + (rand.nextDouble() * 2 - 1) * (yPos1 / 3 + 0.5d), this.posY + yPos1,
|
||||
this.posZ + (rand.nextDouble() * 2 - 1) * (yPos1 / 3 + 0.5d))
|
||||
.lifetime(40 + rand.nextInt(10))
|
||||
.spawn(world);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,8 @@ package electroblob.wizardry.entity.living;
|
||||
|
||||
import java.lang.ref.WeakReference;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.util.WizardryParticleType;
|
||||
import electroblob.wizardry.util.ParticleBuilder;
|
||||
import electroblob.wizardry.util.ParticleBuilder.Type;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
@@ -40,10 +40,13 @@ public class EntityDecoy extends EntitySummonedCreature {
|
||||
public void onDespawn(){
|
||||
super.onDespawn();
|
||||
for(int i = 0; i < 20; i++){
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.DUST, world,
|
||||
this.posX + (this.rand.nextDouble() - 0.5) * this.width,
|
||||
this.getEntityBoundingBox().minY + this.rand.nextDouble() * this.height,
|
||||
this.posZ + (this.rand.nextDouble() - 0.5) * this.width, 0, 0, 0, 40, 0.2f, 1.0f, 0.8f);
|
||||
ParticleBuilder.create(Type.DUST)
|
||||
.pos(this.posX + (this.rand.nextDouble() - 0.5) * this.width, this.getEntityBoundingBox().minY
|
||||
+ this.rand.nextDouble() * this.height, this.posZ + (this.rand.nextDouble() - 0.5) * this.width)
|
||||
.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.WizardrySounds;
|
||||
import electroblob.wizardry.spell.Spell;
|
||||
import electroblob.wizardry.util.ParticleBuilder;
|
||||
import electroblob.wizardry.util.SpellModifiers;
|
||||
import electroblob.wizardry.util.WizardryParticleType;
|
||||
import electroblob.wizardry.util.ParticleBuilder.Type;
|
||||
import electroblob.wizardry.util.WizardryUtilities;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
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
|
||||
}else if(healCooldown == -1 && this.deathTime == 0){
|
||||
|
||||
// Heal particles
|
||||
// Heal particles TODO: Change this so it uses the heal spell directly
|
||||
if(world.isRemote){
|
||||
for(int i = 0; i < 10; i++){
|
||||
double d0 = (double)((float)this.posX + rand.nextFloat() * 2 - 1.0F);
|
||||
for(int i=0; i<10; i++){
|
||||
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 -
|
||||
// 0.5F.
|
||||
double d1 = (double)((float)this.posY - 0.5F + rand.nextFloat());
|
||||
double d2 = (double)((float)this.posZ + rand.nextFloat() * 2 - 1.0F);
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, d0, d1, d2, 0, 0.1F, 0,
|
||||
48 + rand.nextInt(12), 1.0f, 1.0f, 0.3f);
|
||||
double y = (double)((float)this.posY - 0.5F + rand.nextFloat());
|
||||
double z = (double)((float)this.posZ + rand.nextFloat() * 2 - 1.0F);
|
||||
ParticleBuilder.create(Type.SPARKLE).pos(x, y, z).vel(0, 0.1F, 0).colour(1, 1, 0.3f).spawn(world);
|
||||
}
|
||||
}else{
|
||||
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);
|
||||
}else{
|
||||
this.setHealCooldown(400);
|
||||
|
||||
@@ -6,7 +6,8 @@ import java.util.UUID;
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.registry.WizardryPotions;
|
||||
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.EntityLivingBase;
|
||||
import net.minecraft.entity.ai.EntityAIAttackMelee;
|
||||
@@ -144,10 +145,12 @@ public class EntityIceGiant extends EntityIronGolem implements ISummonedCreature
|
||||
if(this.world.isRemote){
|
||||
for(int i = 0; i < 30; i++){
|
||||
float brightness = 0.5f + (rand.nextFloat() / 2);
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, this.world,
|
||||
this.posX - 1 + rand.nextDouble() * 2, this.posY + rand.nextDouble() * 3,
|
||||
this.posZ - 1 + rand.nextDouble() * 2, 0, -0.02, 0, 12 + rand.nextInt(8), brightness,
|
||||
brightness + 0.1f, 1.0f);
|
||||
ParticleBuilder.create(Type.SPARKLE)
|
||||
.pos(this.posX - 1 + rand.nextDouble() * 2, this.posY + rand.nextDouble() * 3, this.posZ - 1 + rand.nextDouble() * 2)
|
||||
.vel(0, -0.02, 0)
|
||||
.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();
|
||||
|
||||
if(this.world.isRemote){
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SNOW, this.world, this.posX - 1 + rand.nextDouble() * 2,
|
||||
this.posY + rand.nextDouble() * 3, this.posZ - 1 + rand.nextDouble() * 2, 0, -0.02, 0,
|
||||
40 + rand.nextInt(10));
|
||||
ParticleBuilder.create(Type.SNOW)
|
||||
.pos(this.posX - 1 + rand.nextDouble() * 2, this.posY + rand.nextDouble() * 3, this.posZ - 1 + rand.nextDouble() * 2)
|
||||
.spawn(world);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package electroblob.wizardry.entity.living;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.registry.Spells;
|
||||
import electroblob.wizardry.registry.WizardrySounds;
|
||||
import electroblob.wizardry.util.ParticleBuilder;
|
||||
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.ai.EntityAIBase;
|
||||
import net.minecraft.entity.ai.EntityAILookIdle;
|
||||
@@ -50,9 +50,13 @@ public class EntityIceWraith extends EntityBlazeMinion {
|
||||
if(this.world.isRemote){
|
||||
for(int i = 0; i < 15; i++){
|
||||
float brightness = 0.5f + (rand.nextFloat() / 2);
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, this.posX - 0.5d + rand.nextDouble(),
|
||||
this.posY + this.height / 2 - 0.5d + rand.nextDouble(), this.posZ - 0.5d + rand.nextDouble(), 0,
|
||||
0.05f, 0, 20 + rand.nextInt(10), brightness, brightness + 0.1f, 1.0f);
|
||||
ParticleBuilder.create(Type.SPARKLE)
|
||||
.pos(this.posX - 0.5d + rand.nextDouble(), this.posY + this.height / 2 - 0.5d + rand.nextDouble(),
|
||||
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;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.registry.Spells;
|
||||
import electroblob.wizardry.util.ParticleBuilder;
|
||||
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.ai.EntityAIBase;
|
||||
import net.minecraft.entity.ai.EntityAILookIdle;
|
||||
@@ -44,9 +44,12 @@ public class EntityLightningWraith extends EntityBlazeMinion {
|
||||
if(this.world.isRemote){
|
||||
for(int i = 0; i < 15; i++){
|
||||
float brightness = 0.3f + (rand.nextFloat() / 2);
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, this.posX - 0.5d + rand.nextDouble(),
|
||||
this.posY + this.height / 2 - 0.5d + rand.nextDouble(), this.posZ - 0.5d + rand.nextDouble(), 0,
|
||||
0.05f, 0, 20 + rand.nextInt(10), brightness, brightness + 0.2f, 1.0f);
|
||||
ParticleBuilder.create(Type.SPARKLE)
|
||||
.pos(this.posX - 0.5d + rand.nextDouble(), this.posY + this.height / 2 - 0.5d + rand.nextDouble(), this.posZ - 0.5d + rand.nextDouble())
|
||||
.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
|
||||
// add the sparks, so it's fine to call super here.
|
||||
if(world.isRemote){
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, 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);
|
||||
ParticleBuilder.create(Type.SPARK, this).spawn(world);
|
||||
}
|
||||
super.onLivingUpdate();
|
||||
}
|
||||
|
||||
@@ -3,11 +3,11 @@ package electroblob.wizardry.entity.living;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.registry.Spells;
|
||||
import electroblob.wizardry.spell.Spell;
|
||||
import electroblob.wizardry.util.ParticleBuilder;
|
||||
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.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.EntityAIAttackMelee;
|
||||
@@ -128,9 +128,13 @@ public class EntityShadowWraith extends EntitySummonedCreature implements ISpell
|
||||
if(this.world.isRemote){
|
||||
for(int i = 0; i < 15; i++){
|
||||
float brightness = rand.nextFloat() * 0.4f;
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, this.posX - 0.5d + rand.nextDouble(),
|
||||
this.posY + this.height / 2 - 0.5d + rand.nextDouble(), this.posZ - 0.5d + rand.nextDouble(), 0,
|
||||
0.05f, 0, 20 + rand.nextInt(10), brightness, 0.0f, brightness);
|
||||
ParticleBuilder.create(Type.SPARKLE)
|
||||
.pos(this.posX - 0.5d + rand.nextDouble(), this.posY + this.height / 2 - 0.5d + rand.nextDouble(),
|
||||
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){
|
||||
for(int i = 0; i < 2; i++){
|
||||
|
||||
for(int i=0; i<2; i++){
|
||||
|
||||
world.spawnParticle(EnumParticleTypes.PORTAL,
|
||||
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);
|
||||
|
||||
world.spawnParticle(EnumParticleTypes.SMOKE_LARGE,
|
||||
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);
|
||||
|
||||
float brightness = rand.nextFloat() * 0.2f;
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, 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.05f, 0,
|
||||
20 + rand.nextInt(10), brightness, 0.0f, brightness);
|
||||
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);
|
||||
|
||||
ParticleBuilder.create(Type.SPARKLE, this).vel(0, 0.05, 0).lifetime(20 + rand.nextInt(10))
|
||||
.colour(brightness, 0.0f, brightness).spawn(world);
|
||||
|
||||
ParticleBuilder.create(Type.DARK_MAGIC, this).colour(0.1f, 0.0f, 0.0f).spawn(world);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,8 @@ import java.lang.ref.WeakReference;
|
||||
import java.util.UUID;
|
||||
|
||||
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.EntityLivingBase;
|
||||
import net.minecraft.entity.ai.EntityAIAttackMelee;
|
||||
@@ -119,9 +120,10 @@ public class EntitySilverfishMinion extends EntitySilverfish implements ISummone
|
||||
private void spawnParticleEffect(){
|
||||
if(this.world.isRemote){
|
||||
for(int i = 0; i < 15; i++){
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.DARK_MAGIC, world, this.posX + this.rand.nextFloat(),
|
||||
this.posY + this.rand.nextFloat(), this.posZ + this.rand.nextFloat(), 0.0d, 0.0d, 0.0d, 0, 0.3f,
|
||||
0.3f, 0.3f);
|
||||
ParticleBuilder.create(Type.DARK_MAGIC)
|
||||
.pos(this.posX + this.rand.nextFloat(), this.posY + this.rand.nextFloat(), this.posZ + this.rand.nextFloat())
|
||||
.colour(0.3f, 0.3f, 0.3f)
|
||||
.spawn(world);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,8 @@ import java.lang.ref.WeakReference;
|
||||
import java.util.UUID;
|
||||
|
||||
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.EntityLivingBase;
|
||||
import net.minecraft.entity.IEntityLivingData;
|
||||
@@ -147,9 +148,10 @@ public class EntitySpiderMinion extends EntityCaveSpider implements ISummonedCre
|
||||
private void spawnParticleEffect(){
|
||||
if(this.world.isRemote){
|
||||
for(int i = 0; i < 15; i++){
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.DARK_MAGIC, world, this.posX + this.rand.nextFloat(),
|
||||
this.posY + this.rand.nextFloat(), this.posZ + this.rand.nextFloat(), 0.0d, 0.0d, 0.0d, 0, 0.1f,
|
||||
0.2f, 0.0f);
|
||||
ParticleBuilder.create(Type.DARK_MAGIC)
|
||||
.pos(this.posX + this.rand.nextFloat(), this.posY + this.rand.nextFloat(), this.posZ + this.rand.nextFloat())
|
||||
.colour(0.1f, 0.2f, 0.0f)
|
||||
.spawn(world);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,8 @@ import electroblob.wizardry.WizardData;
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.item.ItemWand;
|
||||
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 net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -85,17 +86,15 @@ public class EntitySpiritHorse extends EntityHorse {
|
||||
if(itemstack.getItem() instanceof ItemWand && this.getOwner() == player && player.isSneaking()){
|
||||
// Prevents accidental double clicking.
|
||||
if(this.ticksExisted > 20){
|
||||
for(int i = 0; i < 15; i++){
|
||||
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.spawnAppearParticles();
|
||||
|
||||
this.setDead();
|
||||
|
||||
if(WizardData.get(player) != null){
|
||||
WizardData.get(player).hasSpiritHorse = false;
|
||||
}
|
||||
|
||||
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.
|
||||
return true;
|
||||
@@ -105,6 +104,15 @@ public class EntitySpiritHorse extends EntityHorse {
|
||||
|
||||
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
|
||||
public void onDeath(DamageSource par1DamageSource){
|
||||
@@ -137,10 +145,10 @@ public class EntitySpiritHorse extends EntityHorse {
|
||||
|
||||
// Adds a dust particle effect
|
||||
if(this.world.isRemote){
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.DUST, 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, 0, 0.8f, 0.8f, 1.0f);
|
||||
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.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.
|
||||
@@ -151,20 +159,17 @@ public class EntitySpiritHorse extends EntityHorse {
|
||||
}
|
||||
|
||||
if(this.idleTimer > 200){
|
||||
|
||||
if(this.world.isRemote){
|
||||
for(int i = 0; i < 15; i++){
|
||||
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.spawnAppearParticles();
|
||||
}
|
||||
|
||||
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.
|
||||
if(this.getOwner() instanceof EntityPlayer && WizardData.get((EntityPlayer)this.getOwner()) != null){
|
||||
WizardData.get((EntityPlayer)this.getOwner()).hasSpiritHorse = false;
|
||||
}
|
||||
|
||||
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.
|
||||
if(this.world.isRemote){
|
||||
for(int i = 0; i < 15; i++){
|
||||
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.spawnAppearParticles();
|
||||
}
|
||||
|
||||
return super.onInitialSpawn(difficulty, data);
|
||||
|
||||
@@ -4,7 +4,8 @@ import electroblob.wizardry.WizardData;
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.item.ItemWand;
|
||||
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.IEntityLivingData;
|
||||
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
|
||||
// in the item.
|
||||
if(this.world.isRemote){
|
||||
for(int i = 0; i < 15; i++){
|
||||
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);
|
||||
}
|
||||
this.spawnAppearParticles();
|
||||
}
|
||||
|
||||
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
|
||||
public void onUpdate(){
|
||||
|
||||
@@ -100,10 +104,10 @@ public class EntitySpiritWolf extends EntityWolf {
|
||||
|
||||
// Adds a dust particle effect
|
||||
if(this.world.isRemote){
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.DUST, 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, 0, 0.8f, 0.8f, 1.0f);
|
||||
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.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()){
|
||||
// Prevents accidental double clicking.
|
||||
if(this.ticksExisted > 20){
|
||||
for(int i = 0; i < 10; i++){
|
||||
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);
|
||||
|
||||
if(this.world.isRemote){
|
||||
this.spawnAppearParticles();
|
||||
}
|
||||
|
||||
this.setDead();
|
||||
|
||||
if(WizardData.get(player) != null){
|
||||
WizardData.get(player).hasSpiritWolf = false;
|
||||
}
|
||||
|
||||
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.
|
||||
|
||||
@@ -3,12 +3,12 @@ package electroblob.wizardry.entity.living;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.registry.Spells;
|
||||
import electroblob.wizardry.registry.WizardrySounds;
|
||||
import electroblob.wizardry.spell.Spell;
|
||||
import electroblob.wizardry.util.ParticleBuilder;
|
||||
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.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.EntityAIAttackMelee;
|
||||
@@ -135,22 +135,23 @@ public class EntityStormElemental extends EntitySummonedCreature implements ISpe
|
||||
|
||||
if(world.isRemote){
|
||||
|
||||
for(int i = 0; i < 2; ++i){
|
||||
for(int i=0; i<2; ++i){
|
||||
|
||||
world.spawnParticle(EnumParticleTypes.SMOKE_LARGE,
|
||||
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);
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, 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, 0, 0);
|
||||
|
||||
ParticleBuilder.create(Type.SPARK, this).spawn(world);
|
||||
}
|
||||
|
||||
for(int i = 0; i < 10; i++){
|
||||
for(int i=0; i<10; i++){
|
||||
|
||||
float brightness = rand.nextFloat() * 0.2f;
|
||||
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.WizardrySounds;
|
||||
import electroblob.wizardry.spell.Spell;
|
||||
import electroblob.wizardry.util.ParticleBuilder;
|
||||
import electroblob.wizardry.util.SpellModifiers;
|
||||
import electroblob.wizardry.util.WandHelper;
|
||||
import electroblob.wizardry.util.WildcardTradeList;
|
||||
import electroblob.wizardry.util.WizardryParticleType;
|
||||
import electroblob.wizardry.util.ParticleBuilder.Type;
|
||||
import electroblob.wizardry.util.WizardryUtilities;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
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
|
||||
}else if(healCooldown == -1 && this.deathTime == 0){
|
||||
|
||||
// Heal particles
|
||||
// Heal particles TODO: Change this so it uses the heal spell directly
|
||||
if(world.isRemote){
|
||||
for(int i = 0; i < 10; i++){
|
||||
double d0 = (double)((float)this.posX + rand.nextFloat() * 2 - 1.0F);
|
||||
for(int i=0; i<10; i++){
|
||||
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 -
|
||||
// 0.5F.
|
||||
double d1 = (double)((float)this.posY - 0.5F + rand.nextFloat());
|
||||
double d2 = (double)((float)this.posZ + rand.nextFloat() * 2 - 1.0F);
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, world, d0, d1, d2, 0, 0.1F, 0,
|
||||
48 + rand.nextInt(12), 1.0f, 1.0f, 0.3f);
|
||||
double y = (double)((float)this.posY - 0.5F + rand.nextFloat());
|
||||
double z = (double)((float)this.posZ + rand.nextFloat() * 2 - 1.0F);
|
||||
ParticleBuilder.create(Type.SPARKLE).pos(x, y, z).vel(0, 0.1F, 0).colour(1, 1, 0.3f).spawn(world);
|
||||
}
|
||||
}else{
|
||||
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);
|
||||
}else{
|
||||
this.setHealCooldown(400);
|
||||
|
||||
@@ -16,7 +16,8 @@ import electroblob.wizardry.util.IElementalDamage;
|
||||
import electroblob.wizardry.util.IndirectMinionDamage;
|
||||
import electroblob.wizardry.util.MagicDamage.DamageType;
|
||||
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 io.netty.buffer.ByteBuf;
|
||||
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)
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.DARK_MAGIC, thisEntity.world, thisEntity.posX,
|
||||
thisEntity.posY + thisEntity.world.rand.nextDouble() * 1.5, thisEntity.posZ, 0.0d, 0.0d, 0.0d, 0,
|
||||
0.1f, 0.0f, 0.0f);
|
||||
ParticleBuilder.create(Type.DARK_MAGIC)
|
||||
.pos(thisEntity.posX, thisEntity.posY + thisEntity.world.rand.nextDouble() * 1.5, thisEntity.posZ)
|
||||
.colour(0.1f, 0.0f, 0.0f)
|
||||
.spawn(thisEntity.world);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package electroblob.wizardry.entity.projectile;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.util.MagicDamage;
|
||||
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.EntityLivingBase;
|
||||
import net.minecraft.init.MobEffects;
|
||||
@@ -13,6 +13,7 @@ import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityDarknessOrb extends EntityMagicProjectile {
|
||||
|
||||
public EntityDarknessOrb(World par1World){
|
||||
super(par1World);
|
||||
}
|
||||
@@ -59,17 +60,13 @@ public class EntityDarknessOrb extends EntityMagicProjectile {
|
||||
super.onUpdate();
|
||||
|
||||
if(world.isRemote){
|
||||
|
||||
float brightness = rand.nextFloat() * 0.2f;
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, 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, 20 + rand.nextInt(10),
|
||||
brightness, 0.0f, brightness);
|
||||
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);
|
||||
|
||||
ParticleBuilder.create(Type.SPARKLE, this).lifetime(20 + rand.nextInt(10))
|
||||
.colour(brightness, 0.0f, brightness).spawn(world);
|
||||
|
||||
ParticleBuilder.create(Type.DARK_MAGIC, this).colour(0.1f, 0.0f, 0.0f).spawn(world);
|
||||
}
|
||||
|
||||
if(this.ticksExisted > 150){
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package electroblob.wizardry.entity.projectile;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
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.EntityLivingBase;
|
||||
import net.minecraft.init.MobEffects;
|
||||
@@ -56,10 +56,8 @@ public class EntityDart extends EntityMagicArrow {
|
||||
|
||||
@Override
|
||||
public void tickInAir(){
|
||||
|
||||
if(this.world.isRemote){
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.LEAF, world, this.posX, this.posY, this.posZ, 0, -0.03, 0,
|
||||
10 + rand.nextInt(5));
|
||||
ParticleBuilder.create(Type.LEAF).pos(this.posX, this.posY, this.posZ).lifetime(10 + rand.nextInt(5));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@ package electroblob.wizardry.entity.projectile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.util.MagicDamage;
|
||||
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 net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -33,10 +33,9 @@ public class EntityFirebomb extends EntityBomb {
|
||||
super(par1World, par2, par4, par6);
|
||||
}
|
||||
|
||||
/**
|
||||
* Called when this EntityThrowable hits a block or entity.
|
||||
*/
|
||||
@Override
|
||||
protected void onImpact(RayTraceResult par1RayTraceResult){
|
||||
|
||||
Entity entityHit = par1RayTraceResult.entityHit;
|
||||
|
||||
if(entityHit != null){
|
||||
@@ -52,21 +51,16 @@ public class EntityFirebomb extends EntityBomb {
|
||||
|
||||
// Particle effect
|
||||
if(world.isRemote){
|
||||
|
||||
this.world.spawnParticle(EnumParticleTypes.EXPLOSION_LARGE, this.posX, this.posY, this.posZ, 0, 0, 0);
|
||||
|
||||
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 +
|
||||
// (this.rand.nextDouble()*4 - 2)*blastMultiplier, 0, 0, 0);
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.MAGIC_FIRE, 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, 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);
|
||||
|
||||
ParticleBuilder.create(Type.MAGIC_FIRE, rand, posX, posY, posZ, 2*blastMultiplier, false)
|
||||
.lifetime(15 + rand.nextInt(5)).scale(2 + rand.nextFloat()).spawn(world);
|
||||
|
||||
ParticleBuilder.create(Type.DARK_MAGIC, rand, posX, posY, posZ, 2*blastMultiplier, false)
|
||||
.colour(1.0f, 0.2f + rand.nextFloat() * 0.4f, 0.0f).spawn(world);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@ package electroblob.wizardry.entity.projectile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.util.MagicDamage;
|
||||
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 net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
@@ -54,11 +54,8 @@ public class EntityForceOrb extends EntityMagicProjectile {
|
||||
if(this.world.isRemote){
|
||||
for(int j = 0; j < 20; j++){
|
||||
float brightness = 0.5f + (rand.nextFloat() / 2);
|
||||
double x = this.posX - 0.25d + (rand.nextDouble() / 2);
|
||||
double y = this.posY - 0.25d + (rand.nextDouble() / 2);
|
||||
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);
|
||||
ParticleBuilder.create(Type.SPARKLE, rand, posX, posY, posZ, 0.25, true).lifetime(6)
|
||||
.colour(brightness, 1.0f, brightness + 0.2f).spawn(world);
|
||||
}
|
||||
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 electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.registry.WizardryPotions;
|
||||
import electroblob.wizardry.registry.WizardrySounds;
|
||||
import electroblob.wizardry.util.MagicDamage;
|
||||
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 net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -60,16 +60,13 @@ public class EntityIceCharge extends EntityBomb {
|
||||
if(world.isRemote){
|
||||
this.world.spawnParticle(EnumParticleTypes.EXPLOSION_LARGE, this.posX, this.posY, this.posZ, 0, 0, 0);
|
||||
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;
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.ICE, 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, 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);
|
||||
ParticleBuilder.create(Type.DARK_MAGIC, rand, this.posX, this.posY, this.posZ, 2 * blastMultiplier, false)
|
||||
.colour(brightness, brightness + 0.1f, 1.0f).spawn(world);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package electroblob.wizardry.entity.projectile;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.registry.WizardryPotions;
|
||||
import electroblob.wizardry.util.MagicDamage;
|
||||
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.EntityLivingBase;
|
||||
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.
|
||||
if(this.world.isRemote){
|
||||
for(int j = 0; j < 10; j++){
|
||||
double x = this.posX - 0.25d + (rand.nextDouble() / 2);
|
||||
double y = this.posY - 0.25d + (rand.nextDouble() / 2);
|
||||
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));
|
||||
ParticleBuilder.create(Type.ICE, this.rand, this.posX, this.posY, this.posZ, 0.5, true)
|
||||
.lifetime(20 + rand.nextInt(10)).spawn(world);
|
||||
}
|
||||
}
|
||||
// Parameters for sound: sound event name, volume, pitch.
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package electroblob.wizardry.entity.projectile;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.registry.WizardryPotions;
|
||||
import electroblob.wizardry.util.MagicDamage;
|
||||
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.EntityLivingBase;
|
||||
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.
|
||||
if(this.world.isRemote){
|
||||
for(int j = 0; j < 10; j++){
|
||||
double x = this.posX - 0.25d + (rand.nextDouble() / 2);
|
||||
double y = this.posY - 0.25d + (rand.nextDouble() / 2);
|
||||
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));
|
||||
ParticleBuilder.create(Type.ICE, this.rand, this.posX, this.posY, this.posZ, 0.5, true)
|
||||
.lifetime(20 + rand.nextInt(10)).spawn(world);
|
||||
}
|
||||
}
|
||||
// Parameters for sound: sound event name, volume, pitch.
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package electroblob.wizardry.entity.projectile;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.registry.WizardrySounds;
|
||||
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.EntityLivingBase;
|
||||
import net.minecraft.world.World;
|
||||
@@ -46,15 +46,10 @@ public class EntityLightningArrow extends EntityMagicArrow {
|
||||
|
||||
if(world.isRemote){
|
||||
for(int j = 0; j < 8; j++){
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world, this.posX + rand.nextFloat() - 0.5,
|
||||
this.posY + this.height / 2 + rand.nextFloat() - 0.5, this.posZ + rand.nextFloat() - 0.5, 0, 0,
|
||||
0, 3);
|
||||
ParticleBuilder.create(Type.SPARK, rand, posX, posY + height / 2, posZ, 1, false).spawn(world);
|
||||
}
|
||||
}
|
||||
/* 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);
|
||||
}
|
||||
|
||||
@@ -66,8 +61,7 @@ public class EntityLightningArrow extends EntityMagicArrow {
|
||||
}
|
||||
|
||||
if(world.isRemote){
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world, this.posX, this.posY, this.posZ, 0, 0, 0,
|
||||
3);
|
||||
ParticleBuilder.create(Type.SPARK).pos(posX, posY, posZ).spawn(world);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,11 +2,11 @@ package electroblob.wizardry.entity.projectile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.registry.WizardrySounds;
|
||||
import electroblob.wizardry.util.MagicDamage;
|
||||
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 net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -14,6 +14,7 @@ import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityLightningDisc extends EntityMagicProjectile {
|
||||
|
||||
public EntityLightningDisc(World par1World){
|
||||
super(par1World);
|
||||
}
|
||||
@@ -38,8 +39,9 @@ public class EntityLightningDisc extends EntityMagicProjectile {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onImpact(RayTraceResult mop){
|
||||
Entity entityHit = mop.entityHit;
|
||||
protected void onImpact(RayTraceResult result){
|
||||
|
||||
Entity entityHit = result.entityHit;
|
||||
|
||||
if(entityHit != null){
|
||||
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));
|
||||
|
||||
if(mop.typeOfHit == RayTraceResult.Type.BLOCK) this.setDead();
|
||||
if(result.typeOfHit == RayTraceResult.Type.BLOCK) this.setDead();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -61,10 +63,9 @@ public class EntityLightningDisc extends EntityMagicProjectile {
|
||||
// Particle effect
|
||||
if(world.isRemote){
|
||||
for(int i = 0; i < 8; i++){
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world, this.posX + rand.nextFloat() * 2 - 1,
|
||||
this.posY, this.posZ + rand.nextFloat() - 0.5, 0, 0, 0, 3);
|
||||
// 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, 0);
|
||||
// TODO: Why are the x and z parameters different?
|
||||
ParticleBuilder.create(Type.SPARK).pos(this.posX + rand.nextFloat() * 2 - 1,
|
||||
this.posY, this.posZ + rand.nextFloat() - 0.5).spawn(world);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package electroblob.wizardry.entity.projectile;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
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.EntityLivingBase;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
@@ -53,16 +53,8 @@ public class EntityMagicMissile extends EntityMagicArrow {
|
||||
}
|
||||
|
||||
if(this.world.isRemote){
|
||||
|
||||
if(this.ticksExisted % 2 == 1){
|
||||
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));
|
||||
}
|
||||
ParticleBuilder.create(Type.SPARKLE).pos(this.posX, this.posY, this.posZ).lifetime(20 + rand.nextInt(10))
|
||||
.colour(0.5f + (rand.nextFloat() / 2), 0.5f + (rand.nextFloat() / 2), 0.5f + (rand.nextFloat() / 2)).spawn(world);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@ package electroblob.wizardry.entity.projectile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.util.MagicDamage;
|
||||
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 net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -54,16 +54,12 @@ public class EntityPoisonBomb extends EntityBomb {
|
||||
// Particle effect
|
||||
if(world.isRemote){
|
||||
for(int i = 0; i < 60 * blastMultiplier; i++){
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARKLE, 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, 35,
|
||||
0.2f + rand.nextFloat() * 0.3f, 0.6f, 0.0f);
|
||||
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,
|
||||
0.2f + rand.nextFloat() * 0.2f, 0.8f, 0.0f);
|
||||
|
||||
ParticleBuilder.create(Type.SPARKLE, rand, posX, posY, posZ, 2*blastMultiplier, false).lifetime(35)
|
||||
.colour(0.2f + rand.nextFloat() * 0.3f, 0.6f, 0.0f).spawn(world);
|
||||
|
||||
ParticleBuilder.create(Type.DARK_MAGIC, rand, posX, posY, posZ, 2*blastMultiplier, false)
|
||||
.colour(0.2f + rand.nextFloat() * 0.2f, 0.8f, 0.0f).spawn(world);
|
||||
}
|
||||
// Spawning this after the other particles fixes the rendering colour bug. It's a bit of a cheat, but it
|
||||
// works pretty well.
|
||||
|
||||
@@ -2,9 +2,9 @@ package electroblob.wizardry.entity.projectile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
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 net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -42,16 +42,15 @@ public class EntitySmokeBomb extends EntityBomb {
|
||||
if(world.isRemote){
|
||||
this.world.spawnParticle(EnumParticleTypes.EXPLOSION_LARGE, this.posX, this.posY, this.posZ, 0, 0, 0);
|
||||
for(int i = 0; i < 60 * blastMultiplier; i++){
|
||||
|
||||
this.world.spawnParticle(EnumParticleTypes.SMOKE_LARGE,
|
||||
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, 0, 0);
|
||||
|
||||
float brightness = rand.nextFloat() * 0.3f;
|
||||
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, brightness);
|
||||
ParticleBuilder.create(Type.DARK_MAGIC, rand, posX, posY, posZ, 2*blastMultiplier, false)
|
||||
.colour(brightness, brightness, brightness).spawn(world);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@ package electroblob.wizardry.entity.projectile;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.registry.WizardrySounds;
|
||||
import electroblob.wizardry.util.MagicDamage;
|
||||
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 net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
@@ -55,9 +55,10 @@ public class EntitySpark extends EntityMagicProjectile {
|
||||
// Particle effect
|
||||
if(world.isRemote){
|
||||
for(int i = 0; i < 8; i++){
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world, this.posX + rand.nextFloat() - 0.5,
|
||||
this.posY + this.height / 2 + rand.nextFloat() - 0.5, this.posZ + rand.nextFloat() - 0.5, 0, 0,
|
||||
0, 3);
|
||||
double x = this.posX + rand.nextDouble() - 0.5;
|
||||
double y = this.posY + this.height / 2 + rand.nextDouble() - 0.5;
|
||||
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 electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.entity.EntityArc;
|
||||
import electroblob.wizardry.registry.WizardrySounds;
|
||||
import electroblob.wizardry.util.MagicDamage;
|
||||
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 io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.entity.Entity;
|
||||
@@ -63,9 +63,10 @@ public class EntitySparkBomb extends EntityBomb {
|
||||
// Particle effect
|
||||
if(world.isRemote){
|
||||
for(int i = 0; i < 8; i++){
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world, this.posX + rand.nextFloat() - 0.5,
|
||||
this.posY + this.height / 2 + rand.nextFloat() - 0.5, this.posZ + rand.nextFloat() - 0.5, 0, 0,
|
||||
0, 3);
|
||||
double x = this.posX + rand.nextDouble() - 0.5;
|
||||
double y = this.posY + this.height / 2 + rand.nextDouble() - 0.5;
|
||||
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,
|
||||
this.posY + this.height / 2 + rand.nextFloat() - 0.5, this.posZ + rand.nextFloat() - 0.5, 0, 0,
|
||||
0);
|
||||
@@ -106,10 +107,10 @@ public class EntitySparkBomb extends EntityBomb {
|
||||
}else{
|
||||
// Particle effect
|
||||
for(int j = 0; j < 8; j++){
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world,
|
||||
target.posX + rand.nextFloat() - 0.5,
|
||||
target.getEntityBoundingBox().minY + target.height * rand.nextFloat(),
|
||||
target.posZ + rand.nextFloat() - 0.5, 0, 0, 0, 3);
|
||||
double x = target.posX + rand.nextFloat() - 0.5;
|
||||
double y = target.getEntityBoundingBox().minY + target.height * rand.nextFloat();
|
||||
double z = target.posZ + rand.nextFloat() - 0.5;
|
||||
ParticleBuilder.create(Type.SPARK).pos(x, y, z).spawn(world);
|
||||
world.spawnParticle(EnumParticleTypes.SMOKE_LARGE, target.posX + rand.nextFloat() - 0.5,
|
||||
target.getEntityBoundingBox().minY + target.height * rand.nextFloat(),
|
||||
target.posZ + rand.nextFloat() - 0.5, 0, 0, 0);
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package electroblob.wizardry.entity.projectile;
|
||||
|
||||
import electroblob.wizardry.Wizardry;
|
||||
import electroblob.wizardry.util.MagicDamage;
|
||||
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.EntityLivingBase;
|
||||
import net.minecraft.init.SoundEvents;
|
||||
@@ -68,9 +68,7 @@ public class EntityThunderbolt extends EntityMagicProjectile {
|
||||
super.onUpdate();
|
||||
|
||||
if(world.isRemote){
|
||||
Wizardry.proxy.spawnParticle(WizardryParticleType.SPARK, world, this.posX + rand.nextFloat() * 0.2 - 0.1,
|
||||
this.posY + this.height / 2 + rand.nextFloat() * 0.2 - 0.1,
|
||||
this.posZ + rand.nextFloat() * 0.2 - 0.1, 0, 0, 0, 3);
|
||||
ParticleBuilder.create(Type.SPARK, rand, posX, posY + height/2, posZ, 0.1, false).spawn(world);
|
||||
for(int i = 0; i < 4; i++){
|
||||
world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, this.posX + rand.nextFloat() * 0.2 - 0.1,
|
||||
this.posY + this.height / 2 + rand.nextFloat() * 0.2 - 0.1,
|
||||
|
||||
Reference in New Issue
Block a user