Moved particles to a single method

This commit is contained in:
Adubbz 2013-05-13 18:20:06 +10:00
parent 3e58ec3e21
commit be17f95ed6
5 changed files with 19 additions and 37 deletions

View file

@ -31,27 +31,17 @@ public class ClientProxy extends CommonProxy {
} }
@Override @Override
public void spawnMud(World world, double x, double y, double z, double xVel, double yVel, double zVel) public void spawnParticle(String string, double x, double y, double z)
{ {
EntityFX entityfx = null; EntityFX entityfx = null;
if (string == "mud")
entityfx = new EntityBreakingFX(mc.theWorld, x, y, z, Items.mudball.get(), mc.renderEngine); entityfx = new EntityBreakingFX(mc.theWorld, x, y, z, Items.mudball.get(), mc.renderEngine);
mc.effectRenderer.addEffect(entityfx); else if (string == "dart")
}
@Override
public void spawnDart(World world, double x, double y, double z, double xVel, double yVel, double zVel)
{
EntityFX entityfx = null;
entityfx = new EntityBreakingFX(mc.theWorld, x, y, z, Items.dart.get(), mc.renderEngine); entityfx = new EntityBreakingFX(mc.theWorld, x, y, z, Items.dart.get(), mc.renderEngine);
mc.effectRenderer.addEffect(entityfx); else if (string == "dandelion")
} entityfx = new EntityDandelionFX(mc.theWorld, x, y, z, 1.0F);
@Override
public void spawnDandelion(World world, double x, double y, double z, double xVel, double yVel, double zVel)
{
EntityDandelionFX entityfx = new EntityDandelionFX(mc.theWorld, x, y, z, 1.0F);
mc.effectRenderer.addEffect(entityfx); mc.effectRenderer.addEffect(entityfx);
} }

View file

@ -1,5 +1,8 @@
package biomesoplenty; package biomesoplenty;
import biomesoplenty.api.Items;
import net.minecraft.client.particle.EntityBreakingFX;
import net.minecraft.client.particle.EntityFX;
import net.minecraft.world.World; import net.minecraft.world.World;
public class CommonProxy { public class CommonProxy {
@ -18,18 +21,7 @@ public class CommonProxy {
return 0; return 0;
} }
public void spawnMud(World world, double x, double y, double z, double xVel, double yVel, double zVel) public void spawnParticle(String string, double x, double y, double z)
{ {
}
public void spawnDart(World world, double x, double y, double z, double xVel, double yVel, double zVel)
{
}
public void spawnDandelion(World world, double x, double y, double z, double xVel, double yVel, double zVel)
{
} }
} }

View file

@ -231,7 +231,7 @@ public class EntityDart extends EntityArrow
for (int p = 0; i < 16; ++i) for (int p = 0; i < 16; ++i)
{ {
BiomesOPlenty.proxy.spawnDandelion(this.worldObj, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); BiomesOPlenty.proxy.spawnParticle("dandelion", this.posX, this.posY, this.posZ);
} }
this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F)); this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F));

View file

@ -43,7 +43,7 @@ public class EntityMudball extends EntityThrowable
for (int i = 0; i < 16; ++i) for (int i = 0; i < 16; ++i)
{ {
BiomesOPlenty.proxy.spawnMud(this.worldObj, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); BiomesOPlenty.proxy.spawnParticle("mud", this.posX, this.posY, this.posZ);
} }
if (!this.worldObj.isRemote) if (!this.worldObj.isRemote)

View file

@ -232,7 +232,7 @@ public class EntityPoisonDart extends EntityArrow
for (int p = 0; i < 16; ++i) for (int p = 0; i < 16; ++i)
{ {
BiomesOPlenty.proxy.spawnDart(this.worldObj, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D); BiomesOPlenty.proxy.spawnParticle("dart", this.posX, this.posY, this.posZ);
} }
this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F)); this.playSound("random.bowhit", 1.0F, 1.2F / (this.rand.nextFloat() * 0.2F + 0.9F));