more particle improvements

This commit is contained in:
Sen 2025-07-10 18:24:08 +02:00
parent 28d6850668
commit d95a3f8b11
Signed by: sen
GPG key ID: 3AC50A6F47D1B722
58 changed files with 266 additions and 444 deletions

View file

@ -1846,44 +1846,15 @@ public class ClientPlayer implements IClientPlayer
{ {
NetHandler.checkThread(packetIn, this, this.gm, this.world); NetHandler.checkThread(packetIn, this, this.gm, this.world);
if (packetIn.getParticleCount() == 0)
{
double d0 = (double)(packetIn.getParticleSpeed() * packetIn.getXOffset());
double d2 = (double)(packetIn.getParticleSpeed() * packetIn.getYOffset());
double d4 = (double)(packetIn.getParticleSpeed() * packetIn.getZOffset());
try try
{ {
this.world.spawnParticle(packetIn.getParticleType(), packetIn.getXCoordinate(), packetIn.getYCoordinate(), packetIn.getZCoordinate(), d0, d2, d4, packetIn.getParticleArg()); this.world.spawnParticle(packetIn.getParticleType(), packetIn.getXCoordinate(), packetIn.getYCoordinate(), packetIn.getZCoordinate(), packetIn.getParticleArg());
} }
catch (Throwable var17) catch (Throwable var17)
{ {
Log.RENDER.warn("Konnte Partikel-Effekt " + packetIn.getParticleType() + " nicht erzeugen"); Log.RENDER.warn("Konnte Partikel-Effekt " + packetIn.getParticleType() + " nicht erzeugen");
} }
} }
else
{
for (int i = 0; i < packetIn.getParticleCount(); ++i)
{
double d1 = this.rand.gaussian() * (double)packetIn.getXOffset();
double d3 = this.rand.gaussian() * (double)packetIn.getYOffset();
double d5 = this.rand.gaussian() * (double)packetIn.getZOffset();
double d6 = this.rand.gaussian() * (double)packetIn.getParticleSpeed();
double d7 = this.rand.gaussian() * (double)packetIn.getParticleSpeed();
double d8 = this.rand.gaussian() * (double)packetIn.getParticleSpeed();
try
{
this.world.spawnParticle(packetIn.getParticleType(), packetIn.getXCoordinate() + d1, packetIn.getYCoordinate() + d3, packetIn.getZCoordinate() + d5, d6, d7, d8, packetIn.getParticleArg());
}
catch (Throwable var16)
{
Log.RENDER.warn("Konnte Partikel-Effekt " + packetIn.getParticleType() + " nicht erzeugen");
return;
}
}
}
}
public void handleSkin(SPacketSkin packetIn) { public void handleSkin(SPacketSkin packetIn) {
NetHandler.checkThread(packetIn, this, this.gm, this.world); NetHandler.checkThread(packetIn, this, this.gm, this.world);

View file

@ -29,18 +29,13 @@ import common.world.State;
import common.world.World; import common.world.World;
public class EffectRenderer { public class EffectRenderer {
private abstract class Effect { private interface Effect {
protected int age; boolean onUpdate();
protected int lifetime; void render(RenderBuffer rb, float partial, float rotX, float rotZ, float rotYZ, float rotXY, float rotXZ);
int getLayer();
public abstract boolean onUpdate();
public abstract void render(RenderBuffer rb, float partial, float rotX, float rotZ, float rotYZ, float rotXY, float rotXZ);
public abstract int getLayer();
} }
private abstract class Moveable extends Effect { private abstract class Moveable implements Effect {
protected double prevX; protected double prevX;
protected double prevY; protected double prevY;
protected double prevZ; protected double prevZ;
@ -51,6 +46,8 @@ public class EffectRenderer {
protected double motionY; protected double motionY;
protected double motionZ; protected double motionZ;
protected int age;
protected int lifetime;
protected float gravity; protected float gravity;
protected Moveable(double posXIn, double posYIn, double posZIn) { protected Moveable(double posXIn, double posYIn, double posZIn) {
@ -104,25 +101,25 @@ public class EffectRenderer {
public final void render(RenderBuffer rb, float partial, float rotX, float rotZ, float rotYZ, float rotXY, float rotXZ) { public final void render(RenderBuffer rb, float partial, float rotX, float rotZ, float rotYZ, float rotXY, float rotXZ) {
this.setScale(partial); this.setScale(partial);
float f = (float)this.textureU / 8.0F; float u1 = (float)this.textureU / 8.0F;
float f1 = f + 1.0f / 8.0f; float u2 = u1 + 1.0f / 8.0f;
float f2 = (float)this.textureV / 4.0F; float v1 = (float)this.textureV / 4.0F;
float f3 = f2 + 1.0f / 4.0f; float v2 = v1 + 1.0f / 4.0f;
float f4 = 0.1F * this.scale; float scale = 0.1F * this.scale;
float f5 = (float)(this.prevX + (this.posX - this.prevX) * (double)partial - interpPosX); float x = (float)(this.prevX + (this.posX - this.prevX) * (double)partial - interpPosX);
float f6 = (float)(this.prevY + (this.posY - this.prevY) * (double)partial - interpPosY); float y = (float)(this.prevY + (this.posY - this.prevY) * (double)partial - interpPosY);
float f7 = (float)(this.prevZ + (this.posZ - this.prevZ) * (double)partial - interpPosZ); float z = (float)(this.prevZ + (this.posZ - this.prevZ) * (double)partial - interpPosZ);
int i = this.getBrightness(partial); int light = this.getBrightness(partial);
int j = i >> 16 & 65535; int sky = light >> 16 & 65535;
int k = i & 65535; int block = light & 65535;
rb.pos((double)(f5 - rotX * f4 - rotXY * f4), (double)(f6 - rotZ * f4), (double)(f7 - rotYZ * f4 - rotXZ * f4)) rb.pos((double)(x - rotX * scale - rotXY * scale), (double)(y - rotZ * scale), (double)(z - rotYZ * scale - rotXZ * scale))
.tex((double)f1, (double)f3).color(this.red, this.green, this.blue, 1.0f).lightmap(j, k).endVertex(); .tex((double)u2, (double)v2).color(this.red, this.green, this.blue, 1.0f).lightmap(sky, block).endVertex();
rb.pos((double)(f5 - rotX * f4 + rotXY * f4), (double)(f6 + rotZ * f4), (double)(f7 - rotYZ * f4 + rotXZ * f4)) rb.pos((double)(x - rotX * scale + rotXY * scale), (double)(y + rotZ * scale), (double)(z - rotYZ * scale + rotXZ * scale))
.tex((double)f1, (double)f2).color(this.red, this.green, this.blue, 1.0f).lightmap(j, k).endVertex(); .tex((double)u2, (double)v1).color(this.red, this.green, this.blue, 1.0f).lightmap(sky, block).endVertex();
rb.pos((double)(f5 + rotX * f4 + rotXY * f4), (double)(f6 + rotZ * f4), (double)(f7 + rotYZ * f4 + rotXZ * f4)).tex((double)f, (double)f2) rb.pos((double)(x + rotX * scale + rotXY * scale), (double)(y + rotZ * scale), (double)(z + rotYZ * scale + rotXZ * scale)).tex((double)u1, (double)v1)
.color(this.red, this.green, this.blue, 1.0f).lightmap(j, k).endVertex(); .color(this.red, this.green, this.blue, 1.0f).lightmap(sky, block).endVertex();
rb.pos((double)(f5 + rotX * f4 - rotXY * f4), (double)(f6 - rotZ * f4), (double)(f7 + rotYZ * f4 - rotXZ * f4)).tex((double)f, (double)f3) rb.pos((double)(x + rotX * scale - rotXY * scale), (double)(y - rotZ * scale), (double)(z + rotYZ * scale - rotXZ * scale)).tex((double)u1, (double)v2)
.color(this.red, this.green, this.blue, 1.0f).lightmap(j, k).endVertex(); .color(this.red, this.green, this.blue, 1.0f).lightmap(sky, block).endVertex();
} }
public final int getLayer() { public final int getLayer() {
@ -138,9 +135,9 @@ public class EffectRenderer {
private class Aura extends Particle { private class Aura extends Particle {
private final boolean fullBright; private final boolean fullBright;
protected Aura(double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double speedIn, boolean fullBright, protected Aura(double xCoordIn, double yCoordIn, double zCoordIn, boolean fullBright,
int texture) { int texture) {
super(xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, speedIn); super(xCoordIn, yCoordIn, zCoordIn, 0.0D, 0.0D, 0.0D);
float f = texture != 0 ? 1.0f : rng.floatv() * 0.1F + 0.2F; float f = texture != 0 ? 1.0f : rng.floatv() * 0.1F + 0.2F;
this.red = f; this.red = f;
this.green = f; this.green = f;
@ -177,14 +174,14 @@ public class EffectRenderer {
private class Crit extends Particle { private class Crit extends Particle {
private final float baseScale; private final float baseScale;
protected Crit(double xCoordIn, double yCoordIn, double zCoordIn, double p_i46285_8_, double p_i46285_10_, double p_i46285_12_) { protected Crit(double xCoordIn, double yCoordIn, double zCoordIn) {
super(xCoordIn, yCoordIn, zCoordIn, 0.0D, 0.0D, 0.0D); super(xCoordIn, yCoordIn, zCoordIn, 0.0D, 0.0D, 0.0D);
this.motionX *= 0.10000000149011612D; this.motionX *= 0.10000000149011612D;
this.motionY *= 0.10000000149011612D; this.motionY *= 0.10000000149011612D;
this.motionZ *= 0.10000000149011612D; this.motionZ *= 0.10000000149011612D;
this.motionX += p_i46285_8_ * 0.4D; this.motionX += (double)(rng.floatv() * 2.0F - 1.0F) * 0.4D;
this.motionY += p_i46285_10_ * 0.4D; this.motionY += ((double)(rng.floatv() * 2.0F - 1.0F) + 0.2) * 0.4D;
this.motionZ += p_i46285_12_ * 0.4D; this.motionZ += (double)(rng.floatv() * 2.0F - 1.0F) * 0.4D;
this.blue = (float)(Math.random() * 0.30000001192092896D + 0.6000000238418579D); this.blue = (float)(Math.random() * 0.30000001192092896D + 0.6000000238418579D);
this.red = this.blue * 0.3f; this.red = this.blue * 0.3f;
this.green = this.blue * 0.8f; this.green = this.blue * 0.8f;
@ -235,16 +232,10 @@ public class EffectRenderer {
this.lifetime = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); this.lifetime = (int)(8.0D / (Math.random() * 0.8D + 0.2D));
} }
protected Downfall(double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn) { protected Downfall(double xCoordIn, double yCoordIn, double zCoordIn) {
this(xCoordIn, yCoordIn, zCoordIn, 0); this(xCoordIn, yCoordIn, zCoordIn, 0);
this.gravity = 0.04F; this.gravity = 0.04F;
this.setUV(1 + rng.zrange(3), 1); this.setUV(1 + rng.zrange(3), 1);
if(ySpeedIn == 0.0D && (xSpeedIn != 0.0D || zSpeedIn != 0.0D)) {
this.motionX = xSpeedIn;
this.motionY = ySpeedIn + 0.1D;
this.motionZ = zSpeedIn;
}
} }
public boolean onUpdate() { public boolean onUpdate() {
@ -290,15 +281,15 @@ public class EffectRenderer {
private class Dust extends Particle { private class Dust extends Particle {
private final float baseScale; private final float baseScale;
protected Dust(double xCoordIn, double yCoordIn, double zCoordIn, float red, float green, float blue) { protected Dust(double xCoordIn, double yCoordIn, double zCoordIn, int color) {
super(xCoordIn, yCoordIn, zCoordIn, 0.0D, 0.0D, 0.0D); super(xCoordIn, yCoordIn, zCoordIn, 0.0D, 0.0D, 0.0D);
this.motionX *= 0.10000000149011612D; this.motionX *= 0.10000000149011612D;
this.motionY *= 0.10000000149011612D; this.motionY *= 0.10000000149011612D;
this.motionZ *= 0.10000000149011612D; this.motionZ *= 0.10000000149011612D;
float f = (float)Math.random() * 0.4F + 0.6F; float f = (float)Math.random() * 0.4F + 0.6F;
this.red = ((float)(Math.random() * 0.20000000298023224D) + 0.8F) * red * f; this.red = ((float)(Math.random() * 0.20000000298023224D) + 0.8F) * ((float)((color >> 16) & 0xff) / 255.0f) * f;
this.green = ((float)(Math.random() * 0.20000000298023224D) + 0.8F) * green * f; this.green = ((float)(Math.random() * 0.20000000298023224D) + 0.8F) * ((float)((color >> 8) & 0xff) / 255.0f) * f;
this.blue = ((float)(Math.random() * 0.20000000298023224D) + 0.8F) * blue * f; this.blue = ((float)(Math.random() * 0.20000000298023224D) + 0.8F) * ((float)(color & 0xff) / 255.0f) * f;
this.scale *= 0.75F; this.scale *= 0.75F;
this.baseScale = this.scale; this.baseScale = this.scale;
this.lifetime = (int)(8.0D / (Math.random() * 0.8D + 0.2D)); this.lifetime = (int)(8.0D / (Math.random() * 0.8D + 0.2D));
@ -335,11 +326,11 @@ public class EffectRenderer {
} }
private class Explosion extends Particle { private class Explosion extends Particle {
protected Explosion(double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn) { protected Explosion(double xCoordIn, double yCoordIn, double zCoordIn) {
super(xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); super(xCoordIn, yCoordIn, zCoordIn, 0.0D, 0.0D, 0.0D);
this.motionX = xSpeedIn + (Math.random() * 2.0D - 1.0D) * 0.05000000074505806D; this.motionX = (Math.random() * 2.0D - 1.0D) * 0.05000000074505806D;
this.motionY = ySpeedIn + (Math.random() * 2.0D - 1.0D) * 0.05000000074505806D; this.motionY = (Math.random() * 2.0D - 1.0D) * 0.05000000074505806D;
this.motionZ = zSpeedIn + (Math.random() * 2.0D - 1.0D) * 0.05000000074505806D; this.motionZ = (Math.random() * 2.0D - 1.0D) * 0.05000000074505806D;
this.red = this.green = this.blue = rng.floatv() * 0.3F + 0.7F; this.red = this.green = this.blue = rng.floatv() * 0.3F + 0.7F;
this.scale = rng.floatv() * rng.floatv() * 6.0F + 1.0F; this.scale = rng.floatv() * rng.floatv() * 6.0F + 1.0F;
this.lifetime = (int)(16.0D / ((double)rng.floatv() * 0.8D + 0.2D)) + 2; this.lifetime = (int)(16.0D / ((double)rng.floatv() * 0.8D + 0.2D)) + 2;
@ -367,11 +358,11 @@ public class EffectRenderer {
private class Flame extends Particle { private class Flame extends Particle {
private final float baseScale; private final float baseScale;
protected Flame(double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn) { protected Flame(double xCoordIn, double yCoordIn, double zCoordIn) {
super(xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); super(xCoordIn, yCoordIn, zCoordIn, 0.0D, 0.0D, 0.0D);
this.motionX = this.motionX * 0.009999999776482582D + xSpeedIn; this.motionX = this.motionX * 0.009999999776482582D;
this.motionY = this.motionY * 0.009999999776482582D + ySpeedIn; this.motionY = this.motionY * 0.009999999776482582D;
this.motionZ = this.motionZ * 0.009999999776482582D + zSpeedIn; this.motionZ = this.motionZ * 0.009999999776482582D;
this.posX += (double)((rng.floatv() - rng.floatv()) * 0.05F); this.posX += (double)((rng.floatv() - rng.floatv()) * 0.05F);
this.posY += (double)((rng.floatv() - rng.floatv()) * 0.05F); this.posY += (double)((rng.floatv() - rng.floatv()) * 0.05F);
this.posZ += (double)((rng.floatv() - rng.floatv()) * 0.05F); this.posZ += (double)((rng.floatv() - rng.floatv()) * 0.05F);
@ -504,7 +495,7 @@ public class EffectRenderer {
float f = (float)this.age / (float)this.lifetime; float f = (float)this.age / (float)this.lifetime;
if(rng.floatv() > f) { if(rng.floatv() > f) {
world.spawnParticle(ParticleType.SMOKE, this.posX, this.posY, this.posZ, this.motionX, this.motionY, this.motionZ); world.spawnParticle(ParticleType.SMOKE, this.posX, this.posY, this.posZ);
} }
this.motionY -= 0.03D; this.motionY -= 0.03D;
@ -522,11 +513,11 @@ public class EffectRenderer {
private final double baseY; private final double baseY;
private final double baseZ; private final double baseZ;
protected Teleport(double xCoordIn, double yCoordIn, double zCoordIn, double xSpeedIn, double ySpeedIn, double zSpeedIn) { protected Teleport(double xCoordIn, double yCoordIn, double zCoordIn) {
super(xCoordIn, yCoordIn, zCoordIn, xSpeedIn, ySpeedIn, zSpeedIn); super(xCoordIn, yCoordIn, zCoordIn, 0.0, 0.0, 0.0);
this.motionX = xSpeedIn; this.motionX = (rng.floatv() - 0.5F) * 0.2F;
this.motionY = ySpeedIn; this.motionY = (rng.floatv() - 0.5F) * 0.2F;
this.motionZ = zSpeedIn; this.motionZ = (rng.floatv() - 0.5F) * 0.2F;
this.baseX = this.posX = xCoordIn; this.baseX = this.posX = xCoordIn;
this.baseY = this.posY = yCoordIn; this.baseY = this.posY = yCoordIn;
this.baseZ = this.posZ = zCoordIn; this.baseZ = this.posZ = zCoordIn;
@ -585,14 +576,11 @@ public class EffectRenderer {
private class Smoke extends Particle { private class Smoke extends Particle {
private final float baseScale; private final float baseScale;
protected Smoke(double xCoordIn, double yCoordIn, double zCoordIn, double p_i46348_8_, double p_i46348_10_, double p_i46348_12_) { protected Smoke(double xCoordIn, double yCoordIn, double zCoordIn) {
super(xCoordIn, yCoordIn, zCoordIn, 0.0D, 0.0D, 0.0D); super(xCoordIn, yCoordIn, zCoordIn, 0.0D, 0.0D, 0.0D);
this.motionX *= 0.10000000149011612D; this.motionX *= 0.10000000149011612D;
this.motionY *= 0.10000000149011612D; this.motionY *= 0.10000000149011612D;
this.motionZ *= 0.10000000149011612D; this.motionZ *= 0.10000000149011612D;
this.motionX += p_i46348_8_;
this.motionY += p_i46348_10_;
this.motionZ += p_i46348_12_;
this.red = this.green = this.blue = (float)(Math.random() * 0.30000001192092896D); this.red = this.green = this.blue = (float)(Math.random() * 0.30000001192092896D);
this.scale *= 0.75F; this.scale *= 0.75F;
this.baseScale = this.scale; this.baseScale = this.scale;
@ -633,11 +621,11 @@ public class EffectRenderer {
private class Spell extends Particle { private class Spell extends Particle {
private final boolean effect; private final boolean effect;
protected Spell(double xCoordIn, double yCoordIn, double zCoordIn, double p_i1229_8_, double p_i1229_10_, double p_i1229_12_, ItemPotion potion) { protected Spell(double xCoordIn, double yCoordIn, double zCoordIn, ItemPotion potion) {
this(xCoordIn, yCoordIn, zCoordIn, p_i1229_8_, p_i1229_10_, p_i1229_12_, potion, rng.doublev() * 4.0D, rng.doublev() * Math.PI * 2.0D); this(xCoordIn, yCoordIn, zCoordIn, potion, rng.doublev() * 4.0D, rng.doublev() * Math.PI * 2.0D);
} }
private Spell(double xCoordIn, double yCoordIn, double zCoordIn, double p_i1229_8_, double p_i1229_10_, double p_i1229_12_, ItemPotion potion, private Spell(double xCoordIn, double yCoordIn, double zCoordIn, ItemPotion potion,
double d22, double d23) { double d22, double d23) {
super(xCoordIn + Math.cos(d23) * d22 * 0.1, yCoordIn + 0.3, zCoordIn + Math.sin(d23) * d22 * 0.1, 0.5 - rng.doublev(), super(xCoordIn + Math.cos(d23) * d22 * 0.1, yCoordIn + 0.3, zCoordIn + Math.sin(d23) * d22 * 0.1, 0.5 - rng.doublev(),
0.01 + rng.doublev() * 0.5, 0.5 - rng.doublev()); 0.01 + rng.doublev() * 0.5, 0.5 - rng.doublev());
@ -712,16 +700,16 @@ public class EffectRenderer {
protected float green; protected float green;
protected float blue; protected float blue;
private Icon(double x, double y, double z, double xSpeed, double ySpeed, double zSpeed, float size, TextureAtlasSprite icon) { private Icon(double x, double y, double z, float size, TextureAtlasSprite icon) {
super(x, y, z, xSpeed, ySpeed, zSpeed); super(x, y, z, 0.0, 0.0, 0.0);
this.size = (rng.floatv() * 0.5F + 0.5F) * size * 0.1f; this.size = (rng.floatv() * 0.5F + 0.5F) * size * 0.1f;
this.icon = icon; this.icon = icon;
this.offsetX = rng.floatv() * 3.0F; this.offsetX = rng.floatv() * 3.0F;
this.offsetY = rng.floatv() * 3.0F; this.offsetY = rng.floatv() * 3.0F;
} }
protected Icon(double x, double y, double z, double xSpeed, double ySpeed, double zSpeed, State state, BlockPos pos, boolean hit) { protected Icon(double x, double y, double z, State state, BlockPos pos, boolean hit) {
this(x, y, z, xSpeed, ySpeed, zSpeed, hit ? 0.6f : 1.0f, Client.CLIENT.getBlockRendererDispatcher().getModelManager().getTexture(state)); this(x, y, z, hit ? 0.6f : 1.0f, Client.CLIENT.getBlockRendererDispatcher().getModelManager().getTexture(state));
this.gravity = 1.0F; this.gravity = 1.0F;
this.red = this.green = this.blue = 0.6F; this.red = this.green = this.blue = 0.6F;
if(hit) { if(hit) {
@ -738,16 +726,13 @@ public class EffectRenderer {
this.blue *= (float)(color & 255) / 255.0F; this.blue *= (float)(color & 255) / 255.0F;
} }
protected Icon(double x, double y, double z, double xSpeed, double ySpeed, double zSpeed, Item item) { protected Icon(double x, double y, double z, Item item) {
this(x, y, z, 0.0D, 0.0D, 0.0D, 1.0f, Client.CLIENT.getRenderItem().getItemModelMesher().getParticleIcon(item)); this(x, y, z, 1.0f, Client.CLIENT.getRenderItem().getItemModelMesher().getParticleIcon(item));
this.red = this.green = this.blue = 1.0F; this.red = this.green = this.blue = 1.0F;
this.gravity = 1.0F; this.gravity = 1.0F;
this.motionX *= 0.10000000149011612D; this.motionX *= 0.10000000149011612D;
this.motionY *= 0.10000000149011612D; this.motionY *= 0.10000000149011612D;
this.motionZ *= 0.10000000149011612D; this.motionZ *= 0.10000000149011612D;
this.motionX += xSpeed;
this.motionY += ySpeed;
this.motionZ += zSpeed;
} }
public final int getLayer() { public final int getLayer() {
@ -791,12 +776,14 @@ public class EffectRenderer {
} }
} }
private class Textured extends Effect { private class Textured implements Effect {
private static final VertexFormat VERTEX_FORMAT = (new VertexFormat()).addElement(DefaultVertexFormats.POSITION_3F) private static final VertexFormat VERTEX_FORMAT = (new VertexFormat()).addElement(DefaultVertexFormats.POSITION_3F)
.addElement(DefaultVertexFormats.TEX_2F).addElement(DefaultVertexFormats.COLOR_4UB).addElement(DefaultVertexFormats.TEX_2S) .addElement(DefaultVertexFormats.TEX_2F).addElement(DefaultVertexFormats.COLOR_4UB).addElement(DefaultVertexFormats.TEX_2S)
.addElement(DefaultVertexFormats.NORMAL_3B).addElement(DefaultVertexFormats.PADDING_1B); .addElement(DefaultVertexFormats.NORMAL_3B).addElement(DefaultVertexFormats.PADDING_1B);
private final String texture; private final String texture;
private final int texWidth;
private final int texHeight;
private final float scale; private final float scale;
private final float brightness; private final float brightness;
private final double posX; private final double posX;
@ -807,45 +794,46 @@ public class EffectRenderer {
private int lifetime; private int lifetime;
private TextureManager manager; private TextureManager manager;
protected Textured(TextureManager manager, double x, double y, double z, double scale, String texture) { protected Textured(TextureManager manager, double x, double y, double z, float scale, String texture, int width, int height) {
this.manager = manager; this.manager = manager;
this.lifetime = 6 + rng.zrange(4); this.lifetime = 6 + rng.zrange(4);
this.brightness = rng.floatv() * 0.6F + 0.4F; this.brightness = rng.floatv() * 0.6F + 0.4F;
this.scale = (float)scale; this.scale = scale;
this.texture = texture; this.texture = "textures/world/" + texture + ".png";
this.texWidth = width;
this.texHeight = height;
this.posX = x; this.posX = x;
this.posY = y; this.posY = y;
this.posZ = z; this.posZ = z;
} }
public final void render(RenderBuffer rb, float partial, float rotX, float rotZ, float rotYZ, float rotXY, float rotXZ) { public final void render(RenderBuffer rb, float partial, float rotX, float rotZ, float rotYZ, float rotXY, float rotXZ) {
int i = (int)(((float)this.age + partial) * 15.0F / (float)this.lifetime); int idx = (int)(((float)this.age + partial) * (float)(this.texWidth * this.texHeight - 1) / (float)this.lifetime);
if(idx < this.texWidth * this.texHeight) {
if(i <= 15) {
this.manager.bindTexture(this.texture); this.manager.bindTexture(this.texture);
float f = (float)(i % 4) / 4.0F; float u1 = (float)(idx % this.texWidth) / (float)this.texWidth;
float f1 = f + 0.24975F; float u2 = u1 + 1.0f / (float)this.texWidth;
float f2 = (float)(i / 4) / 4.0F; float v1 = (float)(idx / this.texWidth) / (float)this.texHeight;
float f3 = f2 + 0.24975F; float v2 = v1 + 1.0f / (float)this.texHeight;
float f4 = 2.0F * (1.0F - this.scale * 0.5F); float scale = 2.0F * (1.0F - this.scale * 0.5F);
float f5 = (float)(this.posX - interpPosX); float x = (float)(this.posX - interpPosX);
float f6 = (float)(this.posY - interpPosY); float y = (float)(this.posY - interpPosY);
float f7 = (float)(this.posZ - interpPosZ); float z = (float)(this.posZ - interpPosZ);
GlState.color(1.0F, 1.0F, 1.0F, 1.0F); GlState.color(1.0F, 1.0F, 1.0F, 1.0F);
GlState.disableLighting(); GlState.disableLighting();
ItemRenderer.disableStandardItemLighting(); ItemRenderer.disableStandardItemLighting();
rb.begin(GL11.GL_QUADS, VERTEX_FORMAT); rb.begin(GL11.GL_QUADS, VERTEX_FORMAT);
rb.pos((double)(f5 - rotX * f4 - rotXY * f4), (double)(f6 - rotZ * f4), (double)(f7 - rotYZ * f4 - rotXZ * f4)) rb.pos((double)(x - rotX * scale - rotXY * scale), (double)(y - rotZ * scale), (double)(z - rotYZ * scale - rotXZ * scale))
.tex((double)f1, (double)f3).color(this.brightness, this.brightness, this.brightness, 1.0F).lightmap(0, 240) .tex((double)u2, (double)v2).color(this.brightness, this.brightness, this.brightness, 1.0F).lightmap(0, 240)
.normal(0.0F, 1.0F, 0.0F).endVertex(); .normal(0.0F, 1.0F, 0.0F).endVertex();
rb.pos((double)(f5 - rotX * f4 + rotXY * f4), (double)(f6 + rotZ * f4), (double)(f7 - rotYZ * f4 + rotXZ * f4)) rb.pos((double)(x - rotX * scale + rotXY * scale), (double)(y + rotZ * scale), (double)(z - rotYZ * scale + rotXZ * scale))
.tex((double)f1, (double)f2).color(this.brightness, this.brightness, this.brightness, 1.0F).lightmap(0, 240) .tex((double)u2, (double)v1).color(this.brightness, this.brightness, this.brightness, 1.0F).lightmap(0, 240)
.normal(0.0F, 1.0F, 0.0F).endVertex(); .normal(0.0F, 1.0F, 0.0F).endVertex();
rb.pos((double)(f5 + rotX * f4 + rotXY * f4), (double)(f6 + rotZ * f4), (double)(f7 + rotYZ * f4 + rotXZ * f4)) rb.pos((double)(x + rotX * scale + rotXY * scale), (double)(y + rotZ * scale), (double)(z + rotYZ * scale + rotXZ * scale))
.tex((double)f, (double)f2).color(this.brightness, this.brightness, this.brightness, 1.0F).lightmap(0, 240) .tex((double)u1, (double)v1).color(this.brightness, this.brightness, this.brightness, 1.0F).lightmap(0, 240)
.normal(0.0F, 1.0F, 0.0F).endVertex(); .normal(0.0F, 1.0F, 0.0F).endVertex();
rb.pos((double)(f5 + rotX * f4 - rotXY * f4), (double)(f6 - rotZ * f4), (double)(f7 + rotYZ * f4 - rotXZ * f4)) rb.pos((double)(x + rotX * scale - rotXY * scale), (double)(y - rotZ * scale), (double)(z + rotYZ * scale - rotXZ * scale))
.tex((double)f, (double)f3).color(this.brightness, this.brightness, this.brightness, 1.0F).lightmap(0, 240) .tex((double)u1, (double)v2).color(this.brightness, this.brightness, this.brightness, 1.0F).lightmap(0, 240)
.normal(0.0F, 1.0F, 0.0F).endVertex(); .normal(0.0F, 1.0F, 0.0F).endVertex();
Tessellator.draw(); Tessellator.draw();
GlState.enableLighting(); GlState.enableLighting();
@ -863,8 +851,11 @@ public class EffectRenderer {
} }
} }
private abstract class Spawner extends Effect { private abstract class Spawner implements Effect {
private final int amount; protected final int amount;
protected final int lifetime;
protected int age;
protected Spawner(int amount, int lifetime) { protected Spawner(int amount, int lifetime) {
this.amount = amount; this.amount = amount;
@ -906,7 +897,7 @@ public class EffectRenderer {
if(x * x + y * y + z * z <= 1.0D) if(x * x + y * y + z * z <= 1.0D)
world.spawnParticle(ParticleType.CRIT, this.entity.posX + x * (double)this.entity.width / 4.0D, world.spawnParticle(ParticleType.CRIT, this.entity.posX + x * (double)this.entity.width / 4.0D,
this.entity.getEntityBoundingBox().minY + (double)(this.entity.height / 2.0F) + y * (double)this.entity.height / 4.0D, this.entity.getEntityBoundingBox().minY + (double)(this.entity.height / 2.0F) + y * (double)this.entity.height / 4.0D,
this.entity.posZ + z * (double)this.entity.width / 4.0D, x, y + 0.2D, z); this.entity.posZ + z * (double)this.entity.width / 4.0D);
} }
} }
@ -926,12 +917,12 @@ public class EffectRenderer {
double x = this.posX + (rng.doublev() - rng.doublev()) * 4.0D; double x = this.posX + (rng.doublev() - rng.doublev()) * 4.0D;
double y = this.posY + (rng.doublev() - rng.doublev()) * 4.0D; double y = this.posY + (rng.doublev() - rng.doublev()) * 4.0D;
double z = this.posZ + (rng.doublev() - rng.doublev()) * 4.0D; double z = this.posZ + (rng.doublev() - rng.doublev()) * 4.0D;
world.spawnParticle(ParticleType.EXPLOSION_LARGE, x, y, z, (double)((float)this.age / (float)this.lifetime), 0.0D, 0.0D); world.spawnParticle(ParticleType.EXPLOSION_LARGE, x, y, z, (int)(100.0f * (float)this.age / (float)this.lifetime));
} }
} }
private interface Creator { private interface Creator {
Effect create(double x, double y, double z, double xSpeed, double ySpeed, double zSpeed, int data); Effect create(double x, double y, double z, int data);
} }
private static final String TEXTURE = "textures/world/particles.png"; private static final String TEXTURE = "textures/world/particles.png";
@ -960,33 +951,32 @@ public class EffectRenderer {
} }
private void registerEffects() { private void registerEffects() {
this.register(ParticleType.EXPLOSION_NORMAL, (x, y, z, xSpeed, ySpeed, zSpeed, data) -> new Explosion(x, y, z, xSpeed, ySpeed, zSpeed)); this.register(ParticleType.EXPLOSION_NORMAL, (x, y, z, u) -> new Explosion(x, y, z));
this.register(ParticleType.SPLASH, (x, y, z, xSpeed, ySpeed, zSpeed, data) -> new Downfall(x, y, z, xSpeed, ySpeed, zSpeed)); this.register(ParticleType.SPLASH, (x, y, z, u) -> new Downfall(x, y, z));
this.register(ParticleType.WATER_DROP, (x, y, z, xSpeed, ySpeed, zSpeed, data) -> new Downfall(x, y, z, 0)); this.register(ParticleType.WATER_DROP, (x, y, z, u) -> new Downfall(x, y, z, 0));
this.register(ParticleType.DEPTH, (x, y, z, xSpeed, ySpeed, zSpeed, data) -> new Aura(x, y, z, xSpeed, ySpeed, zSpeed, true, 0)); this.register(ParticleType.DEPTH, (x, y, z, u) -> new Aura(x, y, z, true, 0));
this.register(ParticleType.CRIT, (x, y, z, xSpeed, ySpeed, zSpeed, data) -> new Crit(x, y, z, xSpeed, ySpeed, zSpeed)); this.register(ParticleType.CRIT, (x, y, z, u) -> new Crit(x, y, z));
this.register(ParticleType.SMOKE, (x, y, z, xSpeed, ySpeed, zSpeed, data) -> new Smoke(x, y, z, xSpeed, ySpeed, zSpeed)); this.register(ParticleType.SMOKE, (x, y, z, u) -> new Smoke(x, y, z));
this.register(ParticleType.POTION, (x, y, z, xSpeed, ySpeed, zSpeed, data) -> new Spell(x, y, z, xSpeed, ySpeed, zSpeed, this.register(ParticleType.POTION, (x, y, z, id) -> new Spell(x, y, z, ItemPotion.getPotionItem(id)));
ItemPotion.getPotionItem(data))); this.register(ParticleType.GROW, (x, y, z, u) -> new Aura(x, y, z, false, 1));
this.register(ParticleType.GROW, (x, y, z, xSpeed, ySpeed, zSpeed, data) -> new Aura(x, y, z, xSpeed, ySpeed, zSpeed, false, 1)); this.register(ParticleType.SPORE, (x, y, z, u) -> new Aura(x, y, z, false, 0));
this.register(ParticleType.SPORE, (x, y, z, xSpeed, ySpeed, zSpeed, data) -> new Aura(x, y, z, xSpeed, ySpeed, zSpeed, false, 0)); this.register(ParticleType.TELEPORT, (x, y, z, u) -> new Teleport(x, y, z));
this.register(ParticleType.TELEPORT, (x, y, z, xSpeed, ySpeed, zSpeed, data) -> new Teleport(x, y, z, xSpeed, ySpeed, zSpeed)); this.register(ParticleType.FLAME, (x, y, z, u) -> new Flame(x, y, z));
this.register(ParticleType.FLAME, (x, y, z, xSpeed, ySpeed, zSpeed, data) -> new Flame(x, y, z, xSpeed, ySpeed, zSpeed)); this.register(ParticleType.LAVA, (x, y, z, u) -> new LavaPop(x, y, z));
this.register(ParticleType.LAVA, (x, y, z, xSpeed, ySpeed, zSpeed, data) -> new LavaPop(x, y, z)); this.register(ParticleType.DUST, (x, y, z, color) -> new Dust(x, y, z, color));
this.register(ParticleType.DUST, (x, y, z, xSpeed, ySpeed, zSpeed, data) -> new Dust(x, y, z, (float)xSpeed, (float)ySpeed, (float)zSpeed)); this.register(ParticleType.HEART, (x, y, z, u) -> new Heart(x, y, z));
this.register(ParticleType.HEART, (x, y, z, xSpeed, ySpeed, zSpeed, data) -> new Heart(x, y, z)); this.register(ParticleType.ITEM_CRACK, (x, y, z, id) -> {
this.register(ParticleType.ITEM_CRACK, (x, y, z, xSpeed, ySpeed, zSpeed, data) -> { Item item = ItemRegistry.byId(id);
Item item = ItemRegistry.byId(data); return item == null ? null : new Icon(x, y, z, item);
return item == null ? null : new Icon(x, y, z, xSpeed, ySpeed, zSpeed, item);
}); });
this.register(ParticleType.BLOCK_CRACK, (x, y, z, xSpeed, ySpeed, zSpeed, data) -> { this.register(ParticleType.BLOCK_CRACK, (x, y, z, id) -> {
State state = BlockRegistry.byId(data); State state = BlockRegistry.byId(id);
return state == null ? null : new Icon(x, y, z, xSpeed, ySpeed, zSpeed, state, null, false); return state == null ? null : new Icon(x, y, z, state, null, false);
}); });
this.register(ParticleType.EXPLOSION_HUGE, (x, y, z, xSpeed, ySpeed, zSpeed, data) -> new ExplosionSpawner(x, y, z)); this.register(ParticleType.EXPLOSION_HUGE, (x, y, z, u) -> new ExplosionSpawner(x, y, z));
this.register(ParticleType.EXPLOSION_LARGE, this.register(ParticleType.EXPLOSION_LARGE,
(x, y, z, xSpeed, ySpeed, zSpeed, data) -> new Textured(this.manager, x, y, z, xSpeed, "textures/entity/explosion.png")); (x, y, z, scale) -> new Textured(this.manager, x, y, z, (float)scale / 100.0f, "explosion", 4, 4));
this.register(ParticleType.HAIL_CORN, (x, y, z, xSpeed, ySpeed, zSpeed, data) -> new Downfall(x, y, z, 1)); this.register(ParticleType.HAIL_CORN, (x, y, z, u) -> new Downfall(x, y, z, 1));
} }
public void setWorld(World world) { public void setWorld(World world) {
@ -1079,10 +1069,10 @@ public class EffectRenderer {
this.layers[i].add(effect); this.layers[i].add(effect);
} }
public void spawnParticle(ParticleType type, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed, int data) { public void spawnParticle(ParticleType type, double x, double y, double z, int data) {
Creator creator = this.types.get(type); Creator creator = this.types.get(type);
if(creator != null) { if(creator != null) {
Effect effect = creator.create(x, y, z, xSpeed, ySpeed, zSpeed, data); Effect effect = creator.create(x, y, z, data);
if(effect != null) if(effect != null)
this.add(effect); this.add(effect);
} }
@ -1099,8 +1089,7 @@ public class EffectRenderer {
double d0 = (double)pos.getX() + ((double)j + 0.5D) / (double)i; double d0 = (double)pos.getX() + ((double)j + 0.5D) / (double)i;
double d1 = (double)pos.getY() + ((double)k + 0.5D) / (double)i; double d1 = (double)pos.getY() + ((double)k + 0.5D) / (double)i;
double d2 = (double)pos.getZ() + ((double)l + 0.5D) / (double)i; double d2 = (double)pos.getZ() + ((double)l + 0.5D) / (double)i;
this.add(new Icon(d0, d1, d2, d0 - (double)pos.getX() - 0.5D, d1 - (double)pos.getY() - 0.5D, d2 - (double)pos.getZ() - 0.5D, this.add(new Icon(d0, d1, d2, state, pos, false));
state, pos, false));
} }
} }
} }
@ -1147,7 +1136,7 @@ public class EffectRenderer {
d0 = (double)i + block.getBlockBoundsMaxX() + (double)f; d0 = (double)i + block.getBlockBoundsMaxX() + (double)f;
} }
this.add(new Icon(d0, d1, d2, 0.0D, 0.0D, 0.0D, iblockstate, pos, true)); this.add(new Icon(d0, d1, d2, iblockstate, pos, true));
} }
} }

View file

@ -1133,7 +1133,7 @@ public class EntityRenderer {
} }
} }
if(temp < 194.0f || this.random.chance(8)) if(temp < 194.0f || this.random.chance(8))
this.gm.world.spawnParticle(temp >= 194.0f && this.random.chance(20) ? ParticleType.LAVA : ParticleType.SMOKE, (double)blockpos1.getX() + d3, (double)((float)blockpos1.getY() + 0.1F) - block.getBlockBoundsMinY(), (double)blockpos1.getZ() + d4, 0.0D, 0.0D, 0.0D); this.gm.world.spawnParticle(temp >= 194.0f && this.random.chance(20) ? ParticleType.LAVA : ParticleType.SMOKE, (double)blockpos1.getX() + d3, (double)((float)blockpos1.getY() + 0.1F) - block.getBlockBoundsMinY(), (double)blockpos1.getZ() + d4);
} }
else if (block != Blocks.air) else if (block != Blocks.air)
{ {
@ -1147,7 +1147,7 @@ public class EntityRenderer {
d2 = (double)blockpos2.getZ() + d4; d2 = (double)blockpos2.getZ() + d4;
} }
this.gm.world.spawnParticle(temp <= 5.0f ? ParticleType.HAIL_CORN : ParticleType.WATER_DROP, (double)blockpos2.getX() + d3, (double)((float)blockpos2.getY() + 0.1F) + block.getBlockBoundsMaxY(), (double)blockpos2.getZ() + d4, 0.0D, 0.0D, 0.0D); this.gm.world.spawnParticle(temp <= 5.0f ? ParticleType.HAIL_CORN : ParticleType.WATER_DROP, (double)blockpos2.getX() + d3, (double)((float)blockpos2.getY() + 0.1F) + block.getBlockBoundsMaxY(), (double)blockpos2.getZ() + d4);
} }
} }
} }

View file

@ -297,7 +297,7 @@ public class WorldClient extends AWorldClient
float x = ((float)posX) + (rand.floatv() - rand.floatv() - 0.5f) * 32.0f; float x = ((float)posX) + (rand.floatv() - rand.floatv() - 0.5f) * 32.0f;
float y = -64.0f + rand.floatv() * 65.0f; // * 68.0f; float y = -64.0f + rand.floatv() * 65.0f; // * 68.0f;
float z = ((float)posZ) + (rand.floatv() - rand.floatv() - 0.5f) * 32.0f; float z = ((float)posZ) + (rand.floatv() - rand.floatv() - 0.5f) * 32.0f;
this.spawnParticle(ParticleType.DEPTH, (double)x, (double)y, (double)z, 0.0D, 0.0D, 0.0D); this.spawnParticle(ParticleType.DEPTH, (double)x, (double)y, (double)z);
} }
// } // }
} }
@ -414,15 +414,14 @@ public class WorldClient extends AWorldClient
// zOffset, data); // zOffset, data);
// } // }
public void spawnParticle(ParticleType particle, double xCoord, double yCoord, double zCoord, double xOffset, double yOffset, public void spawnParticle(ParticleType particle, double xCoord, double yCoord, double zCoord, int data) {
double zOffset, int data) {
if (this.gm.getRenderViewEntity() != null) if (this.gm.getRenderViewEntity() != null)
{ {
double d0 = this.gm.getRenderViewEntity().posX - xCoord; double d0 = this.gm.getRenderViewEntity().posX - xCoord;
double d1 = this.gm.getRenderViewEntity().posY - yCoord; double d1 = this.gm.getRenderViewEntity().posY - yCoord;
double d2 = this.gm.getRenderViewEntity().posZ - zCoord; double d2 = this.gm.getRenderViewEntity().posZ - zCoord;
if(particle.isUnlimited() || d0 * d0 + d1 * d1 + d2 * d2 <= 256.0D) if(particle.isUnlimited() || d0 * d0 + d1 * d1 + d2 * d2 <= 256.0D)
this.gm.effectRenderer.spawnParticle(particle, xCoord, yCoord, zCoord, xOffset, yOffset, zOffset, data); this.gm.effectRenderer.spawnParticle(particle, xCoord, yCoord, zCoord, data);
} }
} }
@ -574,6 +573,14 @@ public class WorldClient extends AWorldClient
case 1025: case 1025:
MutableBlockPos pos = new MutableBlockPos(blockPosIn.getX(), blockPosIn.getY(), blockPosIn.getZ()); MutableBlockPos pos = new MutableBlockPos(blockPosIn.getX(), blockPosIn.getY(), blockPosIn.getZ());
for(int z = 0; z < 1000; z++) {
this.spawnParticle(ParticleType.EXPLOSION_HUGE,
(double)pos.getX() + this.rand.gaussian() * 128.0, (double)pos.getY() + this.rand.gaussian() * 2.0, (double)pos.getZ() + this.rand.gaussian() * 128.0);
}
for(int z = 0; z < 1000; z++) {
this.spawnParticle(ParticleType.EXPLOSION_NORMAL,
(double)pos.getX() + this.rand.gaussian() * 128.0, (double)pos.getY() + this.rand.gaussian() * 2.0, (double)pos.getZ() + this.rand.gaussian() * 128.0, 100);
}
for(int z = 0; z < 30; z++) { for(int z = 0; z < 30; z++) {
this.playSoundAtPos(pos.set(blockPosIn.getX() + this.rand.range(-128, 128), this.playSoundAtPos(pos.set(blockPosIn.getX() + this.rand.range(-128, 128),
blockPosIn.getY() + this.rand.range(-4, 4), blockPosIn.getZ() + this.rand.range(-128, 128)), blockPosIn.getY() + this.rand.range(-4, 4), blockPosIn.getZ() + this.rand.range(-128, 128)),
@ -594,10 +601,7 @@ public class WorldClient extends AWorldClient
double d21 = d15 + (double)l * 0.01D + (this.rand.doublev() - 0.5D) * (double)i * 0.5D; double d21 = d15 + (double)l * 0.01D + (this.rand.doublev() - 0.5D) * (double)i * 0.5D;
double d4 = d17 + (this.rand.doublev() - 0.5D) * 0.5D; double d4 = d17 + (this.rand.doublev() - 0.5D) * 0.5D;
double d6 = d19 + (double)i * 0.01D + (this.rand.doublev() - 0.5D) * (double)l * 0.5D; double d6 = d19 + (double)i * 0.01D + (this.rand.doublev() - 0.5D) * (double)l * 0.5D;
double d8 = (double)l * d20 + this.rand.gaussian() * 0.01D; this.spawnParticle(ParticleType.SMOKE, d21, d4, d6);
double d10 = -0.03D + this.rand.gaussian() * 0.01D;
double d12 = (double)i * d20 + this.rand.gaussian() * 0.01D;
this.spawnParticle(ParticleType.SMOKE, d21, d4, d6, d8, d10, d12);
} }
return; return;
@ -620,12 +624,12 @@ public class WorldClient extends AWorldClient
for (int i1 = 0; i1 < 8; ++i1) for (int i1 = 0; i1 < 8; ++i1)
{ {
this.spawnParticle(ParticleType.ITEM_CRACK, d13, d14, d16, this.rand.gaussian() * 0.15D, this.rand.doublev() * 0.2D, this.rand.gaussian() * 0.15D, ItemRegistry.getId(Items.water_bottle)); this.spawnParticle(ParticleType.ITEM_CRACK, d13, d14, d16, ItemRegistry.getId(Items.water_bottle));
} }
for (int l1 = 0; l1 < 100; ++l1) for (int l1 = 0; l1 < 100; ++l1)
{ {
this.spawnParticle(ParticleType.POTION, d13, d14, d16, 0.0, 0.0, 0.0, data); this.spawnParticle(ParticleType.POTION, d13, d14, d16, data);
} }
this.playSoundAtPos(blockPosIn, SoundEvent.GLASS, 1.0F); this.playSoundAtPos(blockPosIn, SoundEvent.GLASS, 1.0F);

View file

Before

Width:  |  Height:  |  Size: 2 KiB

After

Width:  |  Height:  |  Size: 2 KiB

Before After
Before After

View file

@ -149,13 +149,10 @@ public class EntityAIMate extends EntityAIBase
for (int i = 0; i < 7; ++i) for (int i = 0; i < 7; ++i)
{ {
double d0 = random.gaussian() * 0.02D;
double d1 = random.gaussian() * 0.02D;
double d2 = random.gaussian() * 0.02D;
double d3 = random.doublev() * (double)this.theAnimal.width * 2.0D - (double)this.theAnimal.width; double d3 = random.doublev() * (double)this.theAnimal.width * 2.0D - (double)this.theAnimal.width;
double d4 = 0.5D + random.doublev() * (double)this.theAnimal.height; double d4 = 0.5D + random.doublev() * (double)this.theAnimal.height;
double d5 = random.doublev() * (double)this.theAnimal.width * 2.0D - (double)this.theAnimal.width; double d5 = random.doublev() * (double)this.theAnimal.width * 2.0D - (double)this.theAnimal.width;
this.theWorld.spawnParticle(ParticleType.HEART, this.theAnimal.posX + d3, this.theAnimal.posY + d4, this.theAnimal.posZ + d5, d0, d1, d2); this.theWorld.spawnParticle(ParticleType.HEART, this.theAnimal.posX + d3, this.theAnimal.posY + d4, this.theAnimal.posZ + d5);
} }
if (entityplayer != null && Vars.breedingXP) // FIX xp if (entityplayer != null && Vars.breedingXP) // FIX xp

View file

@ -156,13 +156,10 @@ public class BlockDragonEgg extends Block
for (int j = 0; j < 128; ++j) for (int j = 0; j < 128; ++j)
{ {
double d0 = worldIn.rand.doublev(); double d0 = worldIn.rand.doublev();
float f = (worldIn.rand.floatv() - 0.5F) * 0.2F;
float f1 = (worldIn.rand.floatv() - 0.5F) * 0.2F;
float f2 = (worldIn.rand.floatv() - 0.5F) * 0.2F;
double d1 = (double)blockpos.getX() + (double)(pos.getX() - blockpos.getX()) * d0 + (worldIn.rand.doublev() - 0.5D) * 1.0D + 0.5D; double d1 = (double)blockpos.getX() + (double)(pos.getX() - blockpos.getX()) * d0 + (worldIn.rand.doublev() - 0.5D) * 1.0D + 0.5D;
double d2 = (double)blockpos.getY() + (double)(pos.getY() - blockpos.getY()) * d0 + worldIn.rand.doublev() * 1.0D - 0.5D; double d2 = (double)blockpos.getY() + (double)(pos.getY() - blockpos.getY()) * d0 + worldIn.rand.doublev() * 1.0D - 0.5D;
double d3 = (double)blockpos.getZ() + (double)(pos.getZ() - blockpos.getZ()) * d0 + (worldIn.rand.doublev() - 0.5D) * 1.0D + 0.5D; double d3 = (double)blockpos.getZ() + (double)(pos.getZ() - blockpos.getZ()) * d0 + (worldIn.rand.doublev() - 0.5D) * 1.0D + 0.5D;
worldIn.spawnParticle(ParticleType.TELEPORT, d1, d2, d3, (double)f, (double)f1, (double)f2); worldIn.spawnParticle(ParticleType.TELEPORT, d1, d2, d3);
} }
} }
else else

View file

@ -96,10 +96,7 @@ public class BlockFloorPortal extends Block
double d0 = (double)((float)pos.getX() + rand.floatv()); double d0 = (double)((float)pos.getX() + rand.floatv());
double d1 = (double)((float)pos.getY() + 0.8F); double d1 = (double)((float)pos.getY() + 0.8F);
double d2 = (double)((float)pos.getZ() + rand.floatv()); double d2 = (double)((float)pos.getZ() + rand.floatv());
double d3 = 0.0D; worldIn.spawnParticle(ParticleType.SMOKE, d0, d1, d2);
double d4 = 0.0D;
double d5 = 0.0D;
worldIn.spawnParticle(ParticleType.SMOKE, d0, d1, d2, d3, d4, d5);
} }
public Item getItem(World worldIn, BlockPos pos) public Item getItem(World worldIn, BlockPos pos)

View file

@ -224,23 +224,18 @@ public class BlockPortal extends Block
double d0 = (double)((float)pos.getX() + rand.floatv()); double d0 = (double)((float)pos.getX() + rand.floatv());
double d1 = (double)((float)pos.getY() + rand.floatv()); double d1 = (double)((float)pos.getY() + rand.floatv());
double d2 = (double)((float)pos.getZ() + rand.floatv()); double d2 = (double)((float)pos.getZ() + rand.floatv());
double d3 = ((double)rand.floatv() - 0.5D) * 0.5D;
double d4 = ((double)rand.floatv() - 0.5D) * 0.5D;
double d5 = ((double)rand.floatv() - 0.5D) * 0.5D;
int j = rand.zrange(2) * 2 - 1; int j = rand.zrange(2) * 2 - 1;
if (worldIn.getState(pos.west()).getBlock() != this && worldIn.getState(pos.east()).getBlock() != this) if (worldIn.getState(pos.west()).getBlock() != this && worldIn.getState(pos.east()).getBlock() != this)
{ {
d0 = (double)pos.getX() + 0.5D + 0.25D * (double)j; d0 = (double)pos.getX() + 0.5D + 0.25D * (double)j;
d3 = (double)(rand.floatv() * 2.0F * (float)j);
} }
else else
{ {
d2 = (double)pos.getZ() + 0.5D + 0.25D * (double)j; d2 = (double)pos.getZ() + 0.5D + 0.25D * (double)j;
d5 = (double)(rand.floatv() * 2.0F * (float)j);
} }
worldIn.spawnParticle(ParticleType.TELEPORT, d0, d1, d2, d3, d4, d5); worldIn.spawnParticle(ParticleType.TELEPORT, d0, d1, d2);
} }
} }

View file

@ -75,7 +75,7 @@ public class BlockMycelium extends Block
if (rand.chance(10)) if (rand.chance(10))
{ {
worldIn.spawnParticle(ParticleType.SPORE, (double)((float)pos.getX() + rand.floatv()), (double)((float)pos.getY() + 1.1F), (double)((float)pos.getZ() + rand.floatv()), 0.0D, 0.0D, 0.0D); worldIn.spawnParticle(ParticleType.SPORE, (double)((float)pos.getX() + rand.floatv()), (double)((float)pos.getY() + 1.1F), (double)((float)pos.getZ() + rand.floatv()));
} }
} }

View file

@ -270,7 +270,7 @@ public abstract class BlockLiquid extends Block
double d8 = d0 + (double)rand.floatv(); double d8 = d0 + (double)rand.floatv();
double d4 = d1 + this.maxY; double d4 = d1 + this.maxY;
double d6 = d2 + (double)rand.floatv(); double d6 = d2 + (double)rand.floatv();
worldIn.spawnParticle(ParticleType.LAVA, d8, d4, d6, 0.0D, 0.0D, 0.0D); worldIn.spawnParticle(ParticleType.LAVA, d8, d4, d6);
worldIn.playSound(d8, d4, d6, SoundEvent.LAVA_POP, 0.2F + rand.floatv() * 0.2F); worldIn.playSound(d8, d4, d6, SoundEvent.LAVA_POP, 0.2F + rand.floatv() * 0.2F);
} }
@ -349,7 +349,7 @@ public abstract class BlockLiquid extends Block
for (int i = 0; i < 8; ++i) for (int i = 0; i < 8; ++i)
{ {
worldIn.spawnParticle(ParticleType.SMOKE, d0 + Math.random(), d1 + 1.2D, d2 + Math.random(), 0.0D, 0.0D, 0.0D); worldIn.spawnParticle(ParticleType.SMOKE, d0 + Math.random(), d1 + 1.2D, d2 + Math.random());
} }
} }

View file

@ -17,7 +17,7 @@ public class BlockBedrock extends Block {
{ {
if(/* worldIn.canShowVoidParticles() && */ pos.getY() <= 5 && rand.chance(8)) { if(/* worldIn.canShowVoidParticles() && */ pos.getY() <= 5 && rand.chance(8)) {
worldIn.spawnParticle(ParticleType.DEPTH, (double)pos.getX() + rand.floatv(), (double)(pos.getY()+1) + (rand.floatv() * 0.5f), worldIn.spawnParticle(ParticleType.DEPTH, (double)pos.getX() + rand.floatv(), (double)(pos.getY()+1) + (rand.floatv() * 0.5f),
(double)pos.getZ() + rand.floatv(), 0.0D, 0.0D, 0.0D); (double)pos.getZ() + rand.floatv());
} }
} }
} }

View file

@ -364,7 +364,7 @@ public class BlockFire extends Block
double d3 = (double)pos.getX() + rand.doublev() * 0.10000000149011612D; double d3 = (double)pos.getX() + rand.doublev() * 0.10000000149011612D;
double d8 = (double)pos.getY() + rand.doublev(); double d8 = (double)pos.getY() + rand.doublev();
double d13 = (double)pos.getZ() + rand.doublev(); double d13 = (double)pos.getZ() + rand.doublev();
worldIn.spawnParticle(ParticleType.SMOKE, d3, d8, d13, 0.0D, 0.0D, 0.0D); worldIn.spawnParticle(ParticleType.SMOKE, d3, d8, d13);
} }
} }
@ -375,7 +375,7 @@ public class BlockFire extends Block
double d4 = (double)(pos.getX() + 1) - rand.doublev() * 0.10000000149011612D; double d4 = (double)(pos.getX() + 1) - rand.doublev() * 0.10000000149011612D;
double d9 = (double)pos.getY() + rand.doublev(); double d9 = (double)pos.getY() + rand.doublev();
double d14 = (double)pos.getZ() + rand.doublev(); double d14 = (double)pos.getZ() + rand.doublev();
worldIn.spawnParticle(ParticleType.SMOKE, d4, d9, d14, 0.0D, 0.0D, 0.0D); worldIn.spawnParticle(ParticleType.SMOKE, d4, d9, d14);
} }
} }
@ -386,7 +386,7 @@ public class BlockFire extends Block
double d5 = (double)pos.getX() + rand.doublev(); double d5 = (double)pos.getX() + rand.doublev();
double d10 = (double)pos.getY() + rand.doublev(); double d10 = (double)pos.getY() + rand.doublev();
double d15 = (double)pos.getZ() + rand.doublev() * 0.10000000149011612D; double d15 = (double)pos.getZ() + rand.doublev() * 0.10000000149011612D;
worldIn.spawnParticle(ParticleType.SMOKE, d5, d10, d15, 0.0D, 0.0D, 0.0D); worldIn.spawnParticle(ParticleType.SMOKE, d5, d10, d15);
} }
} }
@ -397,7 +397,7 @@ public class BlockFire extends Block
double d6 = (double)pos.getX() + rand.doublev(); double d6 = (double)pos.getX() + rand.doublev();
double d11 = (double)pos.getY() + rand.doublev(); double d11 = (double)pos.getY() + rand.doublev();
double d16 = (double)(pos.getZ() + 1) - rand.doublev() * 0.10000000149011612D; double d16 = (double)(pos.getZ() + 1) - rand.doublev() * 0.10000000149011612D;
worldIn.spawnParticle(ParticleType.SMOKE, d6, d11, d16, 0.0D, 0.0D, 0.0D); worldIn.spawnParticle(ParticleType.SMOKE, d6, d11, d16);
} }
} }
@ -408,7 +408,7 @@ public class BlockFire extends Block
double d7 = (double)pos.getX() + rand.doublev(); double d7 = (double)pos.getX() + rand.doublev();
double d12 = (double)(pos.getY() + 1) - rand.doublev() * 0.10000000149011612D; double d12 = (double)(pos.getY() + 1) - rand.doublev() * 0.10000000149011612D;
double d17 = (double)pos.getZ() + rand.doublev(); double d17 = (double)pos.getZ() + rand.doublev();
worldIn.spawnParticle(ParticleType.SMOKE, d7, d12, d17, 0.0D, 0.0D, 0.0D); worldIn.spawnParticle(ParticleType.SMOKE, d7, d12, d17);
} }
} }
} }
@ -419,7 +419,7 @@ public class BlockFire extends Block
double d0 = (double)pos.getX() + rand.doublev(); double d0 = (double)pos.getX() + rand.doublev();
double d1 = (double)pos.getY() + rand.doublev() * 0.5D + 0.5D; double d1 = (double)pos.getY() + rand.doublev() * 0.5D + 0.5D;
double d2 = (double)pos.getZ() + rand.doublev(); double d2 = (double)pos.getZ() + rand.doublev();
worldIn.spawnParticle(ParticleType.SMOKE, d0, d1, d2, 0.0D, 0.0D, 0.0D); worldIn.spawnParticle(ParticleType.SMOKE, d0, d1, d2);
} }
} }
} }

View file

@ -171,7 +171,7 @@ public class BlockRedstoneOre extends Block
if (d1 < (double)pos.getX() || d1 > (double)(pos.getX() + 1) || d2 < 0.0D || d2 > (double)(pos.getY() + 1) || d3 < (double)pos.getZ() || d3 > (double)(pos.getZ() + 1)) if (d1 < (double)pos.getX() || d1 > (double)(pos.getX() + 1) || d2 < 0.0D || d2 > (double)(pos.getY() + 1) || d3 < (double)pos.getZ() || d3 > (double)(pos.getZ() + 1))
{ {
worldIn.spawnParticle(ParticleType.DUST, d1, d2, d3, 1.0D, 0.0D, 0.0D); worldIn.spawnParticle(ParticleType.DUST, d1, d2, d3, 0xff0000);
} }
} }
} }

View file

@ -458,7 +458,7 @@ public class BlockBrewingStand extends BlockContainer
double d0 = (double)((float)pos.getX() + 0.4F + rand.floatv() * 0.2F); double d0 = (double)((float)pos.getX() + 0.4F + rand.floatv() * 0.2F);
double d1 = (double)((float)pos.getY() + 0.7F + rand.floatv() * 0.3F); double d1 = (double)((float)pos.getY() + 0.7F + rand.floatv() * 0.3F);
double d2 = (double)((float)pos.getZ() + 0.4F + rand.floatv() * 0.2F); double d2 = (double)((float)pos.getZ() + 0.4F + rand.floatv() * 0.2F);
worldIn.spawnParticle(ParticleType.SMOKE, d0, d1, d2, 0.0D, 0.0D, 0.0D); worldIn.spawnParticle(ParticleType.SMOKE, d0, d1, d2);
} }
public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state) public void onBlockRemoved(AWorldServer worldIn, BlockPos pos, State state)

View file

@ -98,23 +98,23 @@ public class BlockFurnace extends BlockContainer implements Rotatable
switch (enumfacing) switch (enumfacing)
{ {
case WEST: case WEST:
worldIn.spawnParticle(ParticleType.SMOKE, d0 - d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D); worldIn.spawnParticle(ParticleType.SMOKE, d0 - d3, d1, d2 + d4);
worldIn.spawnParticle(ParticleType.FLAME, d0 - d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D); worldIn.spawnParticle(ParticleType.FLAME, d0 - d3, d1, d2 + d4);
break; break;
case EAST: case EAST:
worldIn.spawnParticle(ParticleType.SMOKE, d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D); worldIn.spawnParticle(ParticleType.SMOKE, d0 + d3, d1, d2 + d4);
worldIn.spawnParticle(ParticleType.FLAME, d0 + d3, d1, d2 + d4, 0.0D, 0.0D, 0.0D); worldIn.spawnParticle(ParticleType.FLAME, d0 + d3, d1, d2 + d4);
break; break;
case NORTH: case NORTH:
worldIn.spawnParticle(ParticleType.SMOKE, d0 + d4, d1, d2 - d3, 0.0D, 0.0D, 0.0D); worldIn.spawnParticle(ParticleType.SMOKE, d0 + d4, d1, d2 - d3);
worldIn.spawnParticle(ParticleType.FLAME, d0 + d4, d1, d2 - d3, 0.0D, 0.0D, 0.0D); worldIn.spawnParticle(ParticleType.FLAME, d0 + d4, d1, d2 - d3);
break; break;
case SOUTH: case SOUTH:
worldIn.spawnParticle(ParticleType.SMOKE, d0 + d4, d1, d2 + d3, 0.0D, 0.0D, 0.0D); worldIn.spawnParticle(ParticleType.SMOKE, d0 + d4, d1, d2 + d3);
worldIn.spawnParticle(ParticleType.FLAME, d0 + d4, d1, d2 + d3, 0.0D, 0.0D, 0.0D); worldIn.spawnParticle(ParticleType.FLAME, d0 + d4, d1, d2 + d3);
} }
} }
} }

View file

@ -126,7 +126,7 @@ public class BlockRedstoneRepeater extends BlockRedstoneDiode
f = f / 16.0F; f = f / 16.0F;
double d3 = (double)(f * (float)enumfacing.getFrontOffsetX()); double d3 = (double)(f * (float)enumfacing.getFrontOffsetX());
double d4 = (double)(f * (float)enumfacing.getFrontOffsetZ()); double d4 = (double)(f * (float)enumfacing.getFrontOffsetZ());
worldIn.spawnParticle(ParticleType.DUST, d0 + d3, d1, d2 + d4, 1.0D, 0.0D, 0.0D); worldIn.spawnParticle(ParticleType.DUST, d0 + d3, d1, d2 + d4, 0xff0000);
} }
} }

View file

@ -140,7 +140,7 @@ public class BlockRedstoneTorch extends BlockTorch
double d0 = (double)pos.getX() + rand.doublev() * 0.6D + 0.2D; double d0 = (double)pos.getX() + rand.doublev() * 0.6D + 0.2D;
double d1 = (double)pos.getY() + rand.doublev() * 0.6D + 0.2D; double d1 = (double)pos.getY() + rand.doublev() * 0.6D + 0.2D;
double d2 = (double)pos.getZ() + rand.doublev() * 0.6D + 0.2D; double d2 = (double)pos.getZ() + rand.doublev() * 0.6D + 0.2D;
worldIn.spawnParticle(ParticleType.SMOKE, d0, d1, d2, 0.0D, 0.0D, 0.0D); worldIn.spawnParticle(ParticleType.SMOKE, d0, d1, d2);
} }
worldIn.scheduleUpdate(pos, worldIn.getState(pos).getBlock(), 160); worldIn.scheduleUpdate(pos, worldIn.getState(pos).getBlock(), 160);
@ -206,7 +206,7 @@ public class BlockRedstoneTorch extends BlockTorch
d2 += 0.27D * (double)enumfacing1.getFrontOffsetZ(); d2 += 0.27D * (double)enumfacing1.getFrontOffsetZ();
} }
worldIn.spawnParticle(ParticleType.DUST, d0, d1, d2, 1.0D, 0.0D, 0.0D); worldIn.spawnParticle(ParticleType.DUST, d0, d1, d2, 0xff0000);
} }
} }

View file

@ -785,11 +785,7 @@ public class BlockRedstoneWire extends Block
double d0 = (double)pos.getX() + 0.5D + ((double)rand.floatv() - 0.5D) * 0.2D; double d0 = (double)pos.getX() + 0.5D + ((double)rand.floatv() - 0.5D) * 0.2D;
double d1 = (double)((float)pos.getY() + 0.0625F); double d1 = (double)((float)pos.getY() + 0.0625F);
double d2 = (double)pos.getZ() + 0.5D + ((double)rand.floatv() - 0.5D) * 0.2D; double d2 = (double)pos.getZ() + 0.5D + ((double)rand.floatv() - 0.5D) * 0.2D;
float f = (float)i / 15.0F; worldIn.spawnParticle(ParticleType.DUST, d0, d1, d2, this.colorMultiplier(i));
float f1 = f * 0.6F + 0.4F;
float f2 = Math.max(0.0F, f * f * 0.7F - 0.5F);
float f3 = Math.max(0.0F, f * f * 0.6F - 0.7F);
worldIn.spawnParticle(ParticleType.DUST, d0, d1, d2, (double)f1, (double)f2, (double)f3);
} }
} }

View file

@ -229,13 +229,13 @@ public class BlockTorch extends Block implements DirectionalUp
if (enumfacing.getAxis().isHorizontal()) if (enumfacing.getAxis().isHorizontal())
{ {
Facing enumfacing1 = enumfacing.getOpposite(); Facing enumfacing1 = enumfacing.getOpposite();
worldIn.spawnParticle(ParticleType.SMOKE, d0 + d4 * (double)enumfacing1.getFrontOffsetX(), d1 + d3, d2 + d4 * (double)enumfacing1.getFrontOffsetZ(), 0.0D, 0.0D, 0.0D); worldIn.spawnParticle(ParticleType.SMOKE, d0 + d4 * (double)enumfacing1.getFrontOffsetX(), d1 + d3, d2 + d4 * (double)enumfacing1.getFrontOffsetZ());
worldIn.spawnParticle(ParticleType.FLAME, d0 + d4 * (double)enumfacing1.getFrontOffsetX(), d1 + d3, d2 + d4 * (double)enumfacing1.getFrontOffsetZ(), 0.0D, 0.0D, 0.0D); worldIn.spawnParticle(ParticleType.FLAME, d0 + d4 * (double)enumfacing1.getFrontOffsetX(), d1 + d3, d2 + d4 * (double)enumfacing1.getFrontOffsetZ());
} }
else else
{ {
worldIn.spawnParticle(ParticleType.SMOKE, d0, d1, d2, 0.0D, 0.0D, 0.0D); worldIn.spawnParticle(ParticleType.SMOKE, d0, d1, d2);
worldIn.spawnParticle(ParticleType.FLAME, d0, d1, d2, 0.0D, 0.0D, 0.0D); worldIn.spawnParticle(ParticleType.FLAME, d0, d1, d2);
} }
} }

View file

@ -124,10 +124,7 @@ public class BlockWarpChest extends Block implements Rotatable
double d0 = (double)pos.getX() + 0.5D + 0.25D * (double)j; double d0 = (double)pos.getX() + 0.5D + 0.25D * (double)j;
double d1 = (double)((float)pos.getY() + rand.floatv()); double d1 = (double)((float)pos.getY() + rand.floatv());
double d2 = (double)pos.getZ() + 0.5D + 0.25D * (double)k; double d2 = (double)pos.getZ() + 0.5D + 0.25D * (double)k;
double d3 = (double)(rand.floatv() * (float)j); worldIn.spawnParticle(ParticleType.TELEPORT, d0, d1, d2);
double d4 = ((double)rand.floatv() - 0.5D) * 0.125D;
double d5 = (double)(rand.floatv() * (float)k);
worldIn.spawnParticle(ParticleType.TELEPORT, d0, d1, d2, d3, d4, d5);
} }
} }

View file

@ -1006,7 +1006,7 @@ public abstract class Entity
{ {
float f2 = (this.rand.floatv() * 2.0F - 1.0F) * this.width; float f2 = (this.rand.floatv() * 2.0F - 1.0F) * this.width;
float f3 = (this.rand.floatv() * 2.0F - 1.0F) * this.width; float f3 = (this.rand.floatv() * 2.0F - 1.0F) * this.width;
this.worldObj.spawnParticle(ParticleType.SPLASH, this.posX + (double)f2, (double)(f1 + 1.0F), this.posZ + (double)f3, this.motionX, this.motionY - (double)(this.rand.floatv() * 0.2F), this.motionZ); this.worldObj.spawnParticle(ParticleType.SPLASH, this.posX + (double)f2, (double)(f1 + 1.0F), this.posZ + (double)f3);
} }
if(this.worldObj.getState(new BlockPos(this.posX, this.posY, this.posZ)).getBlock().getMaterial() == Material.WATER) { if(this.worldObj.getState(new BlockPos(this.posX, this.posY, this.posZ)).getBlock().getMaterial() == Material.WATER) {
@ -1014,7 +1014,7 @@ public abstract class Entity
{ {
float f4 = (this.rand.floatv() * 2.0F - 1.0F) * this.width; float f4 = (this.rand.floatv() * 2.0F - 1.0F) * this.width;
float f5 = (this.rand.floatv() * 2.0F - 1.0F) * this.width; float f5 = (this.rand.floatv() * 2.0F - 1.0F) * this.width;
this.worldObj.spawnParticle(ParticleType.SPLASH, this.posX + (double)f4, (double)(f1 + 1.0F), this.posZ + (double)f5, this.motionX, this.motionY, this.motionZ); this.worldObj.spawnParticle(ParticleType.SPLASH, this.posX + (double)f4, (double)(f1 + 1.0F), this.posZ + (double)f5);
} }
} }
} }
@ -1041,7 +1041,7 @@ public abstract class Entity
if (block.getRenderType() != -1) if (block.getRenderType() != -1)
{ {
this.worldObj.spawnParticle(ParticleType.BLOCK_CRACK, this.posX + ((double)this.rand.floatv() - 0.5D) * (double)this.width, this.getEntityBoundingBox().minY + 0.1D, this.posZ + ((double)this.rand.floatv() - 0.5D) * (double)this.width, -this.motionX * 4.0D, 1.5D, -this.motionZ * 4.0D, BlockRegistry.getId(iblockstate)); this.worldObj.spawnParticle(ParticleType.BLOCK_CRACK, this.posX + ((double)this.rand.floatv() - 0.5D) * (double)this.width, this.getEntityBoundingBox().minY + 0.1D, this.posZ + ((double)this.rand.floatv() - 0.5D) * (double)this.width, BlockRegistry.getId(iblockstate));
} }
} }

View file

@ -121,7 +121,7 @@ public class EntityDragon extends EntityLiving implements IEntityMultiPart
float f11 = (this.rand.floatv() - 0.5F) * 8.0F; float f11 = (this.rand.floatv() - 0.5F) * 8.0F;
float f13 = (this.rand.floatv() - 0.5F) * 4.0F; float f13 = (this.rand.floatv() - 0.5F) * 4.0F;
float f14 = (this.rand.floatv() - 0.5F) * 8.0F; float f14 = (this.rand.floatv() - 0.5F) * 8.0F;
this.worldObj.spawnParticle(ParticleType.EXPLOSION_LARGE, this.posX + (double)f11, this.posY + 2.0D + (double)f13, this.posZ + (double)f14, 0.0D, 0.0D, 0.0D); this.worldObj.spawnParticle(ParticleType.EXPLOSION_LARGE, this.posX + (double)f11, this.posY + 2.0D + (double)f13, this.posZ + (double)f14, 100);
} }
else else
{ {

View file

@ -1716,10 +1716,7 @@ public class EntityHorse extends EntityAnimal implements IInvBasic
for (int i = 0; i < 7; ++i) for (int i = 0; i < 7; ++i)
{ {
double d0 = this.rand.gaussian() * 0.02D; this.worldObj.spawnParticle(enumparticletypes, this.posX + (double)(this.rand.floatv() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.floatv() * this.height), this.posZ + (double)(this.rand.floatv() * this.width * 2.0F) - (double)this.width);
double d1 = this.rand.gaussian() * 0.02D;
double d2 = this.rand.gaussian() * 0.02D;
this.worldObj.spawnParticle(enumparticletypes, this.posX + (double)(this.rand.floatv() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.floatv() * this.height), this.posZ + (double)(this.rand.floatv() * this.width * 2.0F) - (double)this.width, d0, d1, d2);
} }
} }

View file

@ -46,7 +46,7 @@ public class EntityMooshroom extends EntityCow
if (itemstack != null && itemstack.getItem() instanceof ItemShears && !this.isChild()) if (itemstack != null && itemstack.getItem() instanceof ItemShears && !this.isChild())
{ {
this.setDead(); this.setDead();
this.worldObj.spawnParticle(ParticleType.EXPLOSION_LARGE, this.posX, this.posY + (double)(this.height / 2.0F), this.posZ, 0.0D, 0.0D, 0.0D); this.worldObj.spawnParticle(ParticleType.EXPLOSION_LARGE, this.posX, this.posY + (double)(this.height / 2.0F), this.posZ, 100);
if (!this.worldObj.client) if (!this.worldObj.client)
{ {

View file

@ -36,7 +36,6 @@ import common.potion.StatusEffect;
import common.tags.TagObject; import common.tags.TagObject;
import common.util.BlockPos; import common.util.BlockPos;
import common.util.ExtMath; import common.util.ExtMath;
import common.util.ParticleType;
import common.util.Vec3; import common.util.Vec3;
import common.vars.Vars; import common.vars.Vars;
import common.world.State; import common.world.State;
@ -330,7 +329,7 @@ public class EntityRabbit extends EntityAnimal {
} }
protected void consumeBlock(BlockPos pos, State state) { protected void consumeBlock(BlockPos pos, State state) {
this.worldObj.setEntityState(this, (byte)19); this.worldObj.playAuxSFX(2001, pos, BlockRegistry.getId(state));
this.foodCooldown = this.rand.excl(10, this.isChild() ? 20 : 50); this.foodCooldown = this.rand.excl(10, this.isChild() ? 20 : 50);
if(this.isChild()) if(this.isChild())
this.grow(this.rand.range(250, 350)); this.grow(this.rand.range(250, 350));
@ -353,13 +352,6 @@ public class EntityRabbit extends EntityAnimal {
this.jumpRotFactor = 10; this.jumpRotFactor = 10;
this.jumpRotTimer = 0; this.jumpRotTimer = 0;
} }
else if(id == 19) {
this.worldObj.spawnParticle(ParticleType.BLOCK_CRACK,
this.posX + (double)(this.rand.floatv() * this.width * 2.0F) - (double)this.width,
this.posY + 0.5D + (double)(this.rand.floatv() * this.height),
this.posZ + (double)(this.rand.floatv() * this.width * 2.0F) - (double)this.width, 0.0D, 0.0D, 0.0D,
BlockRegistry.getId(this.worldObj.getState(this.getPosition())));
}
else { else {
super.handleStatusUpdate(id); super.handleStatusUpdate(id);
} }

View file

@ -249,7 +249,7 @@ public class EntityWolf extends EntityTameable
{ {
float f1 = (this.rand.floatv() * 2.0F - 1.0F) * this.width * 0.5F; float f1 = (this.rand.floatv() * 2.0F - 1.0F) * this.width * 0.5F;
float f2 = (this.rand.floatv() * 2.0F - 1.0F) * this.width * 0.5F; float f2 = (this.rand.floatv() * 2.0F - 1.0F) * this.width * 0.5F;
this.worldObj.spawnParticle(ParticleType.SPLASH, this.posX + (double)f1, (double)(f + 0.8F), this.posZ + (double)f2, this.motionX, this.motionY, this.motionZ); this.worldObj.spawnParticle(ParticleType.SPLASH, this.posX + (double)f1, (double)(f + 0.8F), this.posZ + (double)f2);
} }
} }
} }

View file

@ -279,13 +279,13 @@ public class EntityBoat extends Entity
{ {
double d7 = this.posX - d2 * d5 * 0.8D + d4 * d6; double d7 = this.posX - d2 * d5 * 0.8D + d4 * d6;
double d8 = this.posZ - d4 * d5 * 0.8D - d2 * d6; double d8 = this.posZ - d4 * d5 * 0.8D - d2 * d6;
this.worldObj.spawnParticle(ParticleType.SPLASH, d7, this.posY - 0.125D, d8, this.motionX, this.motionY, this.motionZ); this.worldObj.spawnParticle(ParticleType.SPLASH, d7, this.posY - 0.125D, d8);
} }
else else
{ {
double d24 = this.posX + d2 + d4 * d5 * 0.7D; double d24 = this.posX + d2 + d4 * d5 * 0.7D;
double d25 = this.posZ + d4 - d2 * d5 * 0.7D; double d25 = this.posZ + d4 - d2 * d5 * 0.7D;
this.worldObj.spawnParticle(ParticleType.SPLASH, d24, this.posY - 0.125D, d25, this.motionX, this.motionY, this.motionZ); this.worldObj.spawnParticle(ParticleType.SPLASH, d24, this.posY - 0.125D, d25);
} }
} }
} }

View file

@ -66,11 +66,10 @@ public class EntityItem extends Entity
public void fall(float distance, float damageMultiplier) public void fall(float distance, float damageMultiplier)
{ {
if(!this.worldObj.client && Vars.itemFallDamage && distance >= 1.0f && this.getEntityItem().getItem().isFragile()) { if(!this.worldObj.client && Vars.itemFallDamage && distance >= 1.0f && this.getEntityItem().getItem().isFragile()) {
// for(int z = 0; z < 8; z++) { for(int z = 0; z < 8; z++) {
((AWorldServer)this.worldObj).spawnParticle(ParticleType.ITEM_CRACK, this.posX, this.posY, this.posZ, ((AWorldServer)this.worldObj).spawnParticles(ParticleType.ITEM_CRACK, this.posX + this.rand.drange(-0.15, 0.15), this.posY + 0.15, this.posZ + this.rand.drange(-0.15, 0.15),
8, this.rand.gaussian() * 0.15D, this.rand.doublev() * 0.2D, this.rand.gaussian() * 0.15D, 0.1f,
ItemRegistry.getId(this.getEntityItem().getItem())); ItemRegistry.getId(this.getEntityItem().getItem()));
// } }
this.worldObj.playAuxSFX(1023, this.getPosition(), 0); this.worldObj.playAuxSFX(1023, this.getPosition(), 0);
this.setDead(); this.setDead();
} }

View file

@ -82,7 +82,7 @@ public class EntityNuke extends Entity
{ {
this.handleWaterMovement(); this.handleWaterMovement();
// if(!this.isInvisible()) { // if(!this.isInvisible()) {
this.worldObj.spawnParticle(ParticleType.FLAME, this.posX, this.posY + 1.1D, this.posZ, 0.0D, 0.0D, 0.0D); this.worldObj.spawnParticle(ParticleType.FLAME, this.posX, this.posY + 1.1D, this.posZ);
// } // }
} }
} }

View file

@ -64,7 +64,7 @@ public class EntityOrb extends EntityThrowable
for (int i = 0; i < 32; ++i) for (int i = 0; i < 32; ++i)
{ {
this.worldObj.spawnParticle(ParticleType.TELEPORT, this.posX, this.posY + this.rand.doublev() * 2.0D, this.posZ, this.rand.gaussian(), 0.0D, this.rand.gaussian()); this.worldObj.spawnParticle(ParticleType.TELEPORT, this.posX - 0.25 + this.rand.doublev() * 0.5, this.posY + this.rand.doublev() * 2.0D, this.posZ - 0.25 + this.rand.doublev() * 0.5);
} }
if (!this.worldObj.client) if (!this.worldObj.client)

View file

@ -96,7 +96,7 @@ public class EntityTnt extends Entity implements IObjectData
else else
{ {
this.handleWaterMovement(); this.handleWaterMovement();
this.worldObj.spawnParticle(ParticleType.SMOKE, this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D); this.worldObj.spawnParticle(ParticleType.SMOKE, this.posX, this.posY + 0.5D, this.posZ);
} }
} }

View file

@ -50,7 +50,7 @@ public class EntityTntCart extends EntityCart
if (this.minecartTNTFuse > 0) if (this.minecartTNTFuse > 0)
{ {
--this.minecartTNTFuse; --this.minecartTNTFuse;
this.worldObj.spawnParticle(ParticleType.SMOKE, this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D); this.worldObj.spawnParticle(ParticleType.SMOKE, this.posX, this.posY + 0.5D, this.posZ);
} }
else if (this.minecartTNTFuse == 0) else if (this.minecartTNTFuse == 0)
{ {

View file

@ -337,14 +337,10 @@ public class EntityXp extends Entity implements IObjectData
this.xpValue = id; this.xpValue = id;
for (int i = 0; i < 2; i++) for (int i = 0; i < 2; i++)
{ {
double d0 = this.rand.gaussian() * 0.02D;
double d1 = this.rand.gaussian() * 0.02D;
double d2 = this.rand.gaussian() * 0.02D;
this.worldObj.spawnParticle(ParticleType.GROW, this.worldObj.spawnParticle(ParticleType.GROW,
this.posX + (double)(this.rand.floatv() * this.width) - (double)this.width * 0.5, this.posX + (double)(this.rand.floatv() * this.width) - (double)this.width * 0.5,
this.posY + (double)(this.rand.floatv() * this.height), this.posY + (double)(this.rand.floatv() * this.height),
this.posZ + (double)(this.rand.floatv() * this.width) - (double)this.width * 0.5, this.posZ + (double)(this.rand.floatv() * this.width) - (double)this.width * 0.5);
d0, d1, d2);
} }
} }

View file

@ -91,7 +91,7 @@ public class EntityDarkMage extends EntityHoveringNPC {
for(int i = 0; i < 2; ++i) { for(int i = 0; i < 2; ++i) {
this.worldObj.spawnParticle(ParticleType.SMOKE, this.posX + (this.rand.doublev() - 0.5D) * (double)this.width, this.worldObj.spawnParticle(ParticleType.SMOKE, this.posX + (this.rand.doublev() - 0.5D) * (double)this.width,
this.posY + this.rand.doublev() * (double)this.height, this.posY + this.rand.doublev() * (double)this.height,
this.posZ + (this.rand.doublev() - 0.5D) * (double)this.width, 0.0D, 0.0D, 0.0D); this.posZ + (this.rand.doublev() - 0.5D) * (double)this.width);
} }
} }
super.onLivingUpdate(); super.onLivingUpdate();

View file

@ -88,14 +88,14 @@ public class EntityGargoyle extends EntityFlyingNPC
for (int l = 0; l < 5; ++l) for (int l = 0; l < 5; ++l)
{ {
this.worldObj.spawnParticle(ParticleType.SMOKE, this.posX + this.rand.gaussian() * 0.30000001192092896D, this.posY + this.height + this.rand.gaussian() * 0.30000001192092896D, this.posZ + this.rand.gaussian() * 0.30000001192092896D, 0.0D, 0.0D, 0.0D); this.worldObj.spawnParticle(ParticleType.SMOKE, this.posX + this.rand.gaussian() * 0.30000001192092896D, this.posY + this.height + this.rand.gaussian() * 0.30000001192092896D, this.posZ + this.rand.gaussian() * 0.30000001192092896D);
} }
if (this.getInvulTime() > 0) if (this.getInvulTime() > 0)
{ {
for (int i1 = 0; i1 < 3; ++i1) for (int i1 = 0; i1 < 3; ++i1)
{ {
this.worldObj.spawnParticle(ParticleType.CRIT, this.posX + this.rand.gaussian() * 1.0D, this.posY + (double)(this.rand.floatv() * 3.3F), this.posZ + this.rand.gaussian() * 1.0D, 0.699999988079071D, 0.699999988079071D, 0.8999999761581421D); this.worldObj.spawnParticle(ParticleType.CRIT, this.posX + this.rand.gaussian() * 1.0D, this.posY + (double)(this.rand.floatv() * 3.3F), this.posZ + this.rand.gaussian() * 1.0D);
} }
} }
} }

View file

@ -610,10 +610,7 @@ public abstract class EntityNPC extends EntityLiving
if (this.inLove == 10) if (this.inLove == 10)
{ {
this.inLove = 0; this.inLove = 0;
double d0 = this.rand.gaussian() * 0.02D; this.worldObj.spawnParticle(ParticleType.HEART, this.posX + (double)(this.rand.floatv() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.floatv() * this.height), this.posZ + (double)(this.rand.floatv() * this.width * 2.0F) - (double)this.width);
double d1 = this.rand.gaussian() * 0.02D;
double d2 = this.rand.gaussian() * 0.02D;
this.worldObj.spawnParticle(ParticleType.HEART, this.posX + (double)(this.rand.floatv() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.floatv() * this.height), this.posZ + (double)(this.rand.floatv() * this.width * 2.0F) - (double)this.width, d0, d1, d2);
} }
} }
else { else {
@ -1234,19 +1231,19 @@ public abstract class EntityNPC extends EntityLiving
} }
else { else {
this.worldObj.playAuxSFX(1013, new BlockPos(ox, oy, oz), 0); this.worldObj.playAuxSFX(1013, new BlockPos(ox, oy, oz), 0);
((AWorldServer)this.worldObj).spawnParticle(ParticleType.TELEPORT, for(int n = 0; n < 8; n++) {
((AWorldServer)this.worldObj).spawnParticles(ParticleType.TELEPORT,
ox + (this.rand.doublev() - 0.5D) * (double)this.width * 2.0D, ox + (this.rand.doublev() - 0.5D) * (double)this.width * 2.0D,
oy + this.rand.doublev() * (double)this.height, oy + this.rand.doublev() * (double)this.height,
oz + (this.rand.doublev() - 0.5D) * (double)this.width * 2.0D, 8, oz + (this.rand.doublev() - 0.5D) * (double)this.width * 2.0D);
(this.rand.floatv() - 0.5F) * 0.2F, (this.rand.floatv() - 0.5F) * 0.2F, (this.rand.floatv() - 0.5F) * 0.2F, }
0.15D, 0);
this.worldObj.playAuxSFX(1005, this.getPosition(), 0); this.worldObj.playAuxSFX(1005, this.getPosition(), 0);
((AWorldServer)this.worldObj).spawnParticle(ParticleType.TELEPORT, for(int n = 0; n < 8; n++) {
((AWorldServer)this.worldObj).spawnParticles(ParticleType.TELEPORT,
this.posX + (this.rand.doublev() - 0.5D) * (double)this.width * 2.0D, this.posX + (this.rand.doublev() - 0.5D) * (double)this.width * 2.0D,
this.posY + this.rand.doublev() * (double)this.height, this.posY + this.rand.doublev() * (double)this.height,
this.posZ + (this.rand.doublev() - 0.5D) * (double)this.width * 2.0D, 8, this.posZ + (this.rand.doublev() - 0.5D) * (double)this.width * 2.0D);
(this.rand.floatv() - 0.5F) * 0.2F, (this.rand.floatv() - 0.5F) * 0.2F, (this.rand.floatv() - 0.5F) * 0.2F, }
0.15D, 0);
return true; return true;
} }
} }

View file

@ -180,7 +180,7 @@ public class EntitySlime extends EntityNPC
World world = this.worldObj; World world = this.worldObj;
double d0 = this.posX + (double)f2; double d0 = this.posX + (double)f2;
double d1 = this.posZ + (double)f3; double d1 = this.posZ + (double)f3;
world.spawnParticle(ParticleType.ITEM_CRACK, d0, this.getEntityBoundingBox().minY, d1, 0.0D, 0.0D, 0.0D, ItemRegistry.getId(Items.slime_ball)); world.spawnParticle(ParticleType.ITEM_CRACK, d0, this.getEntityBoundingBox().minY, d1, ItemRegistry.getId(Items.slime_ball));
} }
// if (!this.isChild()) // if (!this.isChild())

View file

@ -404,7 +404,7 @@ public class EntityArrow extends Entity implements IProjectile, IObjectData
{ {
for (int k = 0; k < 4; ++k) for (int k = 0; k < 4; ++k)
{ {
this.worldObj.spawnParticle(ParticleType.CRIT, this.posX + this.motionX * (double)k / 4.0D, this.posY + this.motionY * (double)k / 4.0D, this.posZ + this.motionZ * (double)k / 4.0D, -this.motionX, -this.motionY + 0.2D, -this.motionZ); this.worldObj.spawnParticle(ParticleType.CRIT, this.posX + this.motionX * (double)k / 4.0D, this.posY + this.motionY * (double)k / 4.0D, this.posZ + this.motionZ * (double)k / 4.0D);
} }
} }
@ -444,7 +444,7 @@ public class EntityArrow extends Entity implements IProjectile, IObjectData
for (int i1 = 0; i1 < 4; ++i1) for (int i1 = 0; i1 < 4; ++i1)
{ {
float f8 = 0.25F; float f8 = 0.25F;
this.worldObj.spawnParticle(ParticleType.SPLASH, this.posX - this.motionX * (double)f8, this.posY - this.motionY * (double)f8, this.posZ - this.motionZ * (double)f8, this.motionX, this.motionY, this.motionZ); this.worldObj.spawnParticle(ParticleType.SPLASH, this.posX - this.motionX * (double)f8, this.posY - this.motionY * (double)f8, this.posZ - this.motionZ * (double)f8);
} }
f4 = 0.6F; f4 = 0.6F;

View file

@ -49,7 +49,7 @@ public class EntityDynamite extends EntityThrowable implements IObjectData
for (int k = 0; k < 8; ++k) for (int k = 0; k < 8; ++k)
{ {
this.worldObj.spawnParticle(ParticleType.ITEM_CRACK, this.posX, this.posY, this.posZ, ((double)this.rand.floatv() - 0.5D) * 0.08D, ((double)this.rand.floatv() - 0.5D) * 0.08D, ((double)this.rand.floatv() - 0.5D) * 0.08D, ItemRegistry.getId(ItemRegistry.byName("dynamite" + (this.explosionSize <= 0 || this.explosionSize >= 8 ? "" : "_" + this.explosionSize)))); this.worldObj.spawnParticle(ParticleType.ITEM_CRACK, this.posX, this.posY, this.posZ, ItemRegistry.getId(ItemRegistry.byName("dynamite" + (this.explosionSize <= 0 || this.explosionSize >= 8 ? "" : "_" + this.explosionSize))));
} }
if (!this.worldObj.client) if (!this.worldObj.client)

View file

@ -60,7 +60,7 @@ public class EntityEgg extends EntityThrowable
for (int k = 0; k < 8; ++k) for (int k = 0; k < 8; ++k)
{ {
this.worldObj.spawnParticle(ParticleType.ITEM_CRACK, this.posX, this.posY, this.posZ, ((double)this.rand.floatv() - 0.5D) * 0.08D, ((double)this.rand.floatv() - 0.5D) * 0.08D, ((double)this.rand.floatv() - 0.5D) * 0.08D, ItemRegistry.getId(Items.egg)); this.worldObj.spawnParticle(ParticleType.ITEM_CRACK, this.posX, this.posY, this.posZ, ItemRegistry.getId(Items.egg));
} }
if (!this.worldObj.client) if (!this.worldObj.client)

View file

@ -417,8 +417,10 @@ public class EntityHook extends Entity implements IObjectData
this.motionY -= 0.20000000298023224D; this.motionY -= 0.20000000298023224D;
this.playSound(SoundEvent.SPLASH, 0.25F); this.playSound(SoundEvent.SPLASH, 0.25F);
float f8 = (float)ExtMath.floord(this.getEntityBoundingBox().minY); float f8 = (float)ExtMath.floord(this.getEntityBoundingBox().minY);
worldserver.spawnParticle(ParticleType.SPLASH, this.posX, (double)(f8 + 1.0F), this.posZ, (int)(1.0F + this.width * 20.0F), (double)this.width, 0.0D, (double)this.width, 0.20000000298023224D, 0); for(int z = 0; z < 5; z++) {
worldserver.spawnParticle(ParticleType.WATER_DROP, this.posX, (double)(f8 + 1.0F), this.posZ, (int)(1.0F + this.width * 20.0F), (double)this.width, 0.0D, (double)this.width, 0.20000000298023224D, 0); worldserver.spawnParticles(ParticleType.SPLASH, this.posX + this.rand.gaussian() * (double)this.width, (double)(f8 + 1.0F), this.posZ + this.rand.gaussian() * (double)this.width);
worldserver.spawnParticles(ParticleType.WATER_DROP, this.posX, (double)(f8 + 1.0F), this.posZ);
}
this.ticksCatchable = this.rand.range(10, 30); this.ticksCatchable = this.rand.range(10, 30);
} }
else else
@ -436,13 +438,13 @@ public class EntityHook extends Entity implements IObjectData
{ {
if (this.rand.floatv() < 0.15F) if (this.rand.floatv() < 0.15F)
{ {
worldserver.spawnParticle(ParticleType.SPLASH, d13, d15 - 0.10000000149011612D, d16, 1, (double)f10, 0.1D, (double)f11, 0.0D, 0); worldserver.spawnParticles(ParticleType.SPLASH, d13, d15 - 0.10000000149011612D, d16);
} }
float f3 = f10 * 0.04F; float f3 = f10 * 0.04F;
float f4 = f11 * 0.04F; float f4 = f11 * 0.04F;
worldserver.spawnParticle(ParticleType.WATER_DROP, d13, d15, d16, 0, (double)f4, 0.01D, (double)(-f3), 1.0D, 0); worldserver.spawnParticles(ParticleType.WATER_DROP, d13, d15, d16);
worldserver.spawnParticle(ParticleType.WATER_DROP, d13, d15, d16, 0, (double)(-f4), 0.01D, (double)f3, 1.0D, 0); worldserver.spawnParticles(ParticleType.WATER_DROP, d13, d15, d16);
} }
} }
} }
@ -475,7 +477,10 @@ public class EntityHook extends Entity implements IObjectData
if (block == Blocks.water || block == Blocks.flowing_water) if (block == Blocks.water || block == Blocks.flowing_water)
{ {
worldserver.spawnParticle(ParticleType.SPLASH, d12, d14, d6, this.rand.range(2, 3), 0.10000000149011612D, 0.0D, 0.10000000149011612D, 0.0D, 0); int amt = this.rand.range(2, 3);
for(int z = 0; z < amt; z++) {
worldserver.spawnParticles(ParticleType.SPLASH, d12 + this.rand.gaussian() * 0.1, d14, d6 + this.rand.gaussian() * 0.1);
}
} }
} }

View file

@ -39,8 +39,7 @@ public class EntityMissile extends EntityBullet {
public void onUpdate() { public void onUpdate() {
super.onUpdate(); super.onUpdate();
if(this.worldObj.client && this.age % 2 < 2) if(this.worldObj.client && this.age % 2 < 2)
this.worldObj.spawnParticle(ParticleType.SMOKE, this.posX, this.posY, this.posZ, this.rand.gaussian() * 0.05D, this.worldObj.spawnParticle(ParticleType.SMOKE, this.posX, this.posY, this.posZ);
this.rand.gaussian() * 0.05D, this.rand.gaussian() * 0.05D);
if(!this.worldObj.client && this.age > this.fuse) if(!this.worldObj.client && this.age > this.fuse)
this.explode(); this.explode();
} }

View file

@ -214,7 +214,7 @@ public abstract class EntityProjectile extends Entity
for (int j = 0; j < 4; ++j) for (int j = 0; j < 4; ++j)
{ {
float f3 = 0.25F; float f3 = 0.25F;
this.worldObj.spawnParticle(ParticleType.SPLASH, this.posX - this.motionX * (double)f3, this.posY - this.motionY * (double)f3, this.posZ - this.motionZ * (double)f3, this.motionX, this.motionY, this.motionZ); this.worldObj.spawnParticle(ParticleType.SPLASH, this.posX - this.motionX * (double)f3, this.posY - this.motionY * (double)f3, this.posZ - this.motionZ * (double)f3);
} }
f2 = 0.8F; f2 = 0.8F;
@ -226,7 +226,7 @@ public abstract class EntityProjectile extends Entity
this.motionX *= (double)f2; this.motionX *= (double)f2;
this.motionY *= (double)f2; this.motionY *= (double)f2;
this.motionZ *= (double)f2; this.motionZ *= (double)f2;
this.worldObj.spawnParticle(ParticleType.SMOKE, this.posX, this.posY + 0.5D, this.posZ, 0.0D, 0.0D, 0.0D); this.worldObj.spawnParticle(ParticleType.SMOKE, this.posX, this.posY + 0.5D, this.posZ);
this.setPosition(this.posX, this.posY, this.posZ); this.setPosition(this.posX, this.posY, this.posZ);
} }
else else

View file

@ -47,7 +47,7 @@ public class EntitySnowball extends EntityThrowable
for (int j = 0; j < 8; ++j) for (int j = 0; j < 8; ++j)
{ {
this.worldObj.spawnParticle(ParticleType.ITEM_CRACK, this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D, ItemRegistry.getId(Items.snowball)); this.worldObj.spawnParticle(ParticleType.ITEM_CRACK, this.posX, this.posY, this.posZ, ItemRegistry.getId(Items.snowball));
} }
if (!this.worldObj.client) if (!this.worldObj.client)

View file

@ -67,10 +67,7 @@ public abstract class EntityAnimal extends EntityLiving
if (this.inLove == 10) if (this.inLove == 10)
{ {
this.inLove = 0; this.inLove = 0;
double d0 = this.rand.gaussian() * 0.02D; this.worldObj.spawnParticle(ParticleType.HEART, this.posX + (double)(this.rand.floatv() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.floatv() * this.height), this.posZ + (double)(this.rand.floatv() * this.width * 2.0F) - (double)this.width);
double d1 = this.rand.gaussian() * 0.02D;
double d2 = this.rand.gaussian() * 0.02D;
this.worldObj.spawnParticle(ParticleType.HEART, this.posX + (double)(this.rand.floatv() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.floatv() * this.height), this.posZ + (double)(this.rand.floatv() * this.width * 2.0F) - (double)this.width, d0, d1, d2);
} }
} }
} }
@ -242,10 +239,7 @@ public abstract class EntityAnimal extends EntityLiving
{ {
for (int i = 0; i < 7; ++i) for (int i = 0; i < 7; ++i)
{ {
double d0 = this.rand.gaussian() * 0.02D; this.worldObj.spawnParticle(ParticleType.HEART, this.posX + (double)(this.rand.floatv() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.floatv() * this.height), this.posZ + (double)(this.rand.floatv() * this.width * 2.0F) - (double)this.width);
double d1 = this.rand.gaussian() * 0.02D;
double d2 = this.rand.gaussian() * 0.02D;
this.worldObj.spawnParticle(ParticleType.HEART, this.posX + (double)(this.rand.floatv() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.floatv() * this.height), this.posZ + (double)(this.rand.floatv() * this.width * 2.0F) - (double)this.width, d0, d1, d2);
} }
} }
else else

View file

@ -220,8 +220,10 @@ public abstract class EntityLiving extends Entity
d0 = 2.5D; d0 = 2.5D;
} }
int i = (int)(150.0D * d0); int i = (int)(15.0D * d0);
((AWorldServer)this.worldObj).spawnParticle(ParticleType.BLOCK_CRACK, this.posX, this.posY, this.posZ, i, 0.0D, 0.0D, 0.0D, 0.15000000596046448D, BlockRegistry.getId(iblockstate)); for(int z = 0; z < i; z++) {
((AWorldServer)this.worldObj).spawnParticles(ParticleType.BLOCK_CRACK, this.posX, this.posY, this.posZ, BlockRegistry.getId(iblockstate));
}
} }
} }
@ -432,10 +434,7 @@ public abstract class EntityLiving extends Entity
for (int k = 0; k < 20; ++k) for (int k = 0; k < 20; ++k)
{ {
double d2 = this.rand.gaussian() * 0.02D; this.worldObj.spawnParticle(ParticleType.EXPLOSION_NORMAL, this.posX + (double)(this.rand.floatv() * this.width * 2.0F) - (double)this.width, this.posY + (double)(this.rand.floatv() * this.height), this.posZ + (double)(this.rand.floatv() * this.width * 2.0F) - (double)this.width);
double d0 = this.rand.gaussian() * 0.02D;
double d1 = this.rand.gaussian() * 0.02D;
this.worldObj.spawnParticle(ParticleType.EXPLOSION_NORMAL, this.posX + (double)(this.rand.floatv() * this.width * 2.0F) - (double)this.width, this.posY + (double)(this.rand.floatv() * this.height), this.posZ + (double)(this.rand.floatv() * this.width * 2.0F) - (double)this.width, d2, d0, d1);
} }
} }
} }
@ -970,7 +969,7 @@ public abstract class EntityLiving extends Entity
vec31 = vec31.rotatePitch(-this.rotPitch * (float)Math.PI / 180.0F); vec31 = vec31.rotatePitch(-this.rotPitch * (float)Math.PI / 180.0F);
vec31 = vec31.rotateYaw(-this.rotYaw * (float)Math.PI / 180.0F); vec31 = vec31.rotateYaw(-this.rotYaw * (float)Math.PI / 180.0F);
vec31 = vec31.addVector(this.posX, this.posY + (double)this.getEyeHeight(), this.posZ); vec31 = vec31.addVector(this.posX, this.posY + (double)this.getEyeHeight(), this.posZ);
this.worldObj.spawnParticle(ParticleType.ITEM_CRACK, vec31.xCoord, vec31.yCoord, vec31.zCoord, vec3.xCoord, vec3.yCoord + 0.05D, vec3.zCoord, ItemRegistry.getId(stack.getItem())); this.worldObj.spawnParticle(ParticleType.ITEM_CRACK, vec31.xCoord, vec31.yCoord, vec31.zCoord, ItemRegistry.getId(stack.getItem()));
} }
} }
@ -1972,7 +1971,7 @@ public abstract class EntityLiving extends Entity
{ {
if (this.particleTimer % 4 == 0) if (this.particleTimer % 4 == 0)
{ {
this.worldObj.spawnParticle(ParticleType.GROW, this.posX + (double)(this.rand.floatv() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.floatv() * this.height), this.posZ + (double)(this.rand.floatv() * this.width * 2.0F) - (double)this.width, 0.0D, 0.0D, 0.0D); this.worldObj.spawnParticle(ParticleType.GROW, this.posX + (double)(this.rand.floatv() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.floatv() * this.height), this.posZ + (double)(this.rand.floatv() * this.width * 2.0F) - (double)this.width);
} }
--this.particleTimer; --this.particleTimer;
@ -2480,7 +2479,7 @@ public abstract class EntityLiving extends Entity
this.worldObj.spawnParticle(ParticleType.EXPLOSION_NORMAL, this.worldObj.spawnParticle(ParticleType.EXPLOSION_NORMAL,
this.posX + (double)(this.rand.floatv() * this.width * 2.0F) - (double)this.width - d0 * d3, this.posX + (double)(this.rand.floatv() * this.width * 2.0F) - (double)this.width - d0 * d3,
this.posY + (double)(this.rand.floatv() * this.height) - d1 * d3, this.posY + (double)(this.rand.floatv() * this.height) - d1 * d3,
this.posZ + (double)(this.rand.floatv() * this.width * 2.0F) - (double)this.width - d2 * d3, d0, d1, d2); this.posZ + (double)(this.rand.floatv() * this.width * 2.0F) - (double)this.width - d2 * d3);
} }
} }
else { else {
@ -3034,10 +3033,7 @@ public abstract class EntityLiving extends Entity
{ {
for (int i = 0; i < 5; ++i) for (int i = 0; i < 5; ++i)
{ {
double d0 = this.rand.gaussian() * 0.02D; this.worldObj.spawnParticle(particleType, this.posX + (double)(this.rand.floatv() * this.width * 2.0F) - (double)this.width, this.posY + 1.0D + (double)(this.rand.floatv() * this.height), this.posZ + (double)(this.rand.floatv() * this.width * 2.0F) - (double)this.width);
double d1 = this.rand.gaussian() * 0.02D;
double d2 = this.rand.gaussian() * 0.02D;
this.worldObj.spawnParticle(particleType, this.posX + (double)(this.rand.floatv() * this.width * 2.0F) - (double)this.width, this.posY + 1.0D + (double)(this.rand.floatv() * this.height), this.posZ + (double)(this.rand.floatv() * this.width * 2.0F) - (double)this.width, d0, d1, d2);
} }
} }

View file

@ -74,10 +74,7 @@ public abstract class EntityTameable extends EntityAnimal implements IEntityOwna
for (int i = 0; i < 7; ++i) for (int i = 0; i < 7; ++i)
{ {
double d0 = this.rand.gaussian() * 0.02D; this.worldObj.spawnParticle(enumparticletypes, this.posX + (double)(this.rand.floatv() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.floatv() * this.height), this.posZ + (double)(this.rand.floatv() * this.width * 2.0F) - (double)this.width);
double d1 = this.rand.gaussian() * 0.02D;
double d2 = this.rand.gaussian() * 0.02D;
this.worldObj.spawnParticle(enumparticletypes, this.posX + (double)(this.rand.floatv() * this.width * 2.0F) - (double)this.width, this.posY + 0.5D + (double)(this.rand.floatv() * this.height), this.posZ + (double)(this.rand.floatv() * this.width * 2.0F) - (double)this.width, d0, d1, d2);
} }
} }

View file

@ -274,7 +274,7 @@ public abstract class EntityThrowable extends Entity implements IProjectile
for (int i = 0; i < 4; ++i) for (int i = 0; i < 4; ++i)
{ {
float f4 = 0.25F; float f4 = 0.25F;
this.worldObj.spawnParticle(ParticleType.SPLASH, this.posX - this.motionX * (double)f4, this.posY - this.motionY * (double)f4, this.posZ - this.motionZ * (double)f4, this.motionX, this.motionY, this.motionZ); this.worldObj.spawnParticle(ParticleType.SPLASH, this.posX - this.motionX * (double)f4, this.posY - this.motionY * (double)f4, this.posZ - this.motionZ * (double)f4);
} }
f2 = 0.8F; f2 = 0.8F;

View file

@ -176,10 +176,7 @@ public class ItemDye extends Item {
for (int i = 0; i < amount; ++i) for (int i = 0; i < amount; ++i)
{ {
double d0 = worldIn.rand.gaussian() * 0.02D; worldIn.spawnParticle(ParticleType.GROW, (double)((float)pos.getX() + worldIn.rand.floatv()), (double)pos.getY() + (double)worldIn.rand.floatv() * block.getBlockBoundsMaxY(), (double)((float)pos.getZ() + worldIn.rand.floatv()));
double d1 = worldIn.rand.gaussian() * 0.02D;
double d2 = worldIn.rand.gaussian() * 0.02D;
worldIn.spawnParticle(ParticleType.GROW, (double)((float)pos.getX() + worldIn.rand.floatv()), (double)pos.getY() + (double)worldIn.rand.floatv() * block.getBlockBoundsMaxY(), (double)((float)pos.getZ() + worldIn.rand.floatv()), d0, d1, d2);
} }
} }
} }

View file

@ -277,7 +277,7 @@ public class ItemBucket extends Item
for (int l = 0; l < 8; ++l) for (int l = 0; l < 8; ++l)
{ {
worldIn.spawnParticle(ParticleType.SMOKE, (double)i + Math.random(), (double)j + Math.random(), (double)k + Math.random(), 0.0D, 0.0D, 0.0D); worldIn.spawnParticle(ParticleType.SMOKE, (double)i + Math.random(), (double)j + Math.random(), (double)k + Math.random());
} }
} }
else else

View file

@ -66,10 +66,7 @@ public class ItemChargedOrb extends ItemFragile
double d0 = (double)((float)pos.getX() + (5.0F + worldIn.rand.floatv() * 6.0F) / 16.0F); double d0 = (double)((float)pos.getX() + (5.0F + worldIn.rand.floatv() * 6.0F) / 16.0F);
double d1 = (double)((float)pos.getY() + 0.8125F); double d1 = (double)((float)pos.getY() + 0.8125F);
double d2 = (double)((float)pos.getZ() + (5.0F + worldIn.rand.floatv() * 6.0F) / 16.0F); double d2 = (double)((float)pos.getZ() + (5.0F + worldIn.rand.floatv() * 6.0F) / 16.0F);
double d3 = 0.0D; worldIn.spawnParticle(ParticleType.SMOKE, d0, d1, d2);
double d4 = 0.0D;
double d5 = 0.0D;
worldIn.spawnParticle(ParticleType.SMOKE, d0, d1, d2, d3, d4, d5);
} }
Facing enumfacing = (Facing)iblockstate.getValue(BlockPortalFrame.FACING); Facing enumfacing = (Facing)iblockstate.getValue(BlockPortalFrame.FACING);

View file

@ -13,28 +13,18 @@ public class SPacketParticles implements Packet<IClientPlayer>
private float xCoord; private float xCoord;
private float yCoord; private float yCoord;
private float zCoord; private float zCoord;
private float xOffset;
private float yOffset;
private float zOffset;
private float particleSpeed;
private int particleCount;
private int particleArgument; private int particleArgument;
public SPacketParticles() public SPacketParticles()
{ {
} }
public SPacketParticles(ParticleType particleTypeIn, float x, float y, float z, float xOffsetIn, float yOffset, float zOffset, float particleSpeedIn, int particleCountIn, int particleArgumentIn) public SPacketParticles(ParticleType particleTypeIn, float x, float y, float z, int particleArgumentIn)
{ {
this.particleType = particleTypeIn; this.particleType = particleTypeIn;
this.xCoord = x; this.xCoord = x;
this.yCoord = y; this.yCoord = y;
this.zCoord = z; this.zCoord = z;
this.xOffset = xOffsetIn;
this.yOffset = yOffset;
this.zOffset = zOffset;
this.particleSpeed = particleSpeedIn;
this.particleCount = particleCountIn;
this.particleArgument = particleArgumentIn; this.particleArgument = particleArgumentIn;
} }
@ -47,11 +37,6 @@ public class SPacketParticles implements Packet<IClientPlayer>
this.xCoord = buf.readFloat(); this.xCoord = buf.readFloat();
this.yCoord = buf.readFloat(); this.yCoord = buf.readFloat();
this.zCoord = buf.readFloat(); this.zCoord = buf.readFloat();
this.xOffset = buf.readFloat();
this.yOffset = buf.readFloat();
this.zOffset = buf.readFloat();
this.particleSpeed = buf.readFloat();
this.particleCount = buf.readInt();
this.particleArgument = buf.readVarInt(); this.particleArgument = buf.readVarInt();
} }
@ -64,11 +49,6 @@ public class SPacketParticles implements Packet<IClientPlayer>
buf.writeFloat(this.xCoord); buf.writeFloat(this.xCoord);
buf.writeFloat(this.yCoord); buf.writeFloat(this.yCoord);
buf.writeFloat(this.zCoord); buf.writeFloat(this.zCoord);
buf.writeFloat(this.xOffset);
buf.writeFloat(this.yOffset);
buf.writeFloat(this.zOffset);
buf.writeFloat(this.particleSpeed);
buf.writeInt(this.particleCount);
buf.writeVarInt(this.particleArgument); buf.writeVarInt(this.particleArgument);
} }
@ -101,46 +81,6 @@ public class SPacketParticles implements Packet<IClientPlayer>
return (double)this.zCoord; return (double)this.zCoord;
} }
/**
* Gets the x coordinate offset for the particle. The particle may use the offset for particle spread.
*/
public float getXOffset()
{
return this.xOffset;
}
/**
* Gets the y coordinate offset for the particle. The particle may use the offset for particle spread.
*/
public float getYOffset()
{
return this.yOffset;
}
/**
* Gets the z coordinate offset for the particle. The particle may use the offset for particle spread.
*/
public float getZOffset()
{
return this.zOffset;
}
/**
* Gets the speed of the particle animation (used in client side rendering).
*/
public float getParticleSpeed()
{
return this.particleSpeed;
}
/**
* Gets the amount of particles to spawn
*/
public int getParticleCount()
{
return this.particleCount;
}
/** /**
* Gets the particle arguments. Some particles rely on block and/or item ids and sometimes metadata ids to color or * Gets the particle arguments. Some particles rely on block and/or item ids and sometimes metadata ids to color or
* texture the particle. * texture the particle.

View file

@ -31,8 +31,10 @@ public abstract class AWorldServer extends World {
public abstract void resetUpdateEntityTick(); public abstract void resetUpdateEntityTick();
public abstract void strikeLightning(double x, double y, double z, int color, int damage, boolean fire, EntityLiving summoner); public abstract void strikeLightning(double x, double y, double z, int color, int damage, boolean fire, EntityLiving summoner);
public abstract void resetWeather(); public abstract void resetWeather();
public abstract void spawnParticle(ParticleType particleType, double xCoord, double yCoord, double zCoord, int numberOfParticles, double xOffset, double yOffset, public abstract void spawnParticles(ParticleType particleType, double xCoord, double yCoord, double zCoord, int data);
double zOffset, double particleSpeed, int data); public final void spawnParticles(ParticleType particleType, double xCoord, double yCoord, double zCoord) {
this.spawnParticles(particleType, xCoord, yCoord, zCoord, 0);
}
public abstract long getSeed(); public abstract long getSeed();
public abstract boolean isExterminated(); public abstract boolean isExterminated();
public abstract boolean exterminate(); public abstract boolean exterminate();

View file

@ -202,7 +202,7 @@ public class Explosion
worldObj.setState(blockpos, Blocks.air.getState(), 3); worldObj.setState(blockpos, Blocks.air.getState(), 3);
if(rand.chance(1000)) { if(rand.chance(1000)) {
worldObj.playSound(SoundEvent.EXPLODE, explosionX + x, explosionY + y, explosionZ + z, 4.0F); worldObj.playSound(SoundEvent.EXPLODE, explosionX + x, explosionY + y, explosionZ + z, 4.0F);
((AWorldServer)worldObj).spawnParticle(ParticleType.EXPLOSION_HUGE, explosionX + x, explosionY + y, explosionZ + z, 0, rand.gaussian() * 0.02D, rand.gaussian() * 0.02D, rand.gaussian() * 0.02D, 1.0, 0); ((AWorldServer)worldObj).spawnParticles(ParticleType.EXPLOSION_HUGE, explosionX + x, explosionY + y, explosionZ + z);
} }
} }
cnt++; cnt++;
@ -302,11 +302,11 @@ public class Explosion
if (this.explosionSize >= 2.0F && this.isSmoking) if (this.explosionSize >= 2.0F && this.isSmoking)
{ {
this.worldObj.spawnParticle(ParticleType.EXPLOSION_HUGE, this.explosionX, this.explosionY, this.explosionZ, 1.0D, 0.0D, 0.0D); this.worldObj.spawnParticle(ParticleType.EXPLOSION_HUGE, this.explosionX, this.explosionY, this.explosionZ);
} }
else else
{ {
this.worldObj.spawnParticle(ParticleType.EXPLOSION_LARGE, this.explosionX, this.explosionY, this.explosionZ, 1.0D, 0.0D, 0.0D); this.worldObj.spawnParticle(ParticleType.EXPLOSION_LARGE, this.explosionX, this.explosionY, this.explosionZ, 100);
} }
if (this.isSmoking) if (this.isSmoking)
@ -321,20 +321,8 @@ public class Explosion
double d0 = (double)((float)blockpos.getX() + this.worldObj.rand.floatv()); double d0 = (double)((float)blockpos.getX() + this.worldObj.rand.floatv());
double d1 = (double)((float)blockpos.getY() + this.worldObj.rand.floatv()); double d1 = (double)((float)blockpos.getY() + this.worldObj.rand.floatv());
double d2 = (double)((float)blockpos.getZ() + this.worldObj.rand.floatv()); double d2 = (double)((float)blockpos.getZ() + this.worldObj.rand.floatv());
double d3 = d0 - this.explosionX; this.worldObj.spawnParticle(ParticleType.EXPLOSION_NORMAL, (d0 + this.explosionX * 1.0D) / 2.0D, (d1 + this.explosionY * 1.0D) / 2.0D, (d2 + this.explosionZ * 1.0D) / 2.0D);
double d4 = d1 - this.explosionY; this.worldObj.spawnParticle(ParticleType.SMOKE, d0, d1, d2);
double d5 = d2 - this.explosionZ;
double d6 = (double)ExtMath.sqrtd(d3 * d3 + d4 * d4 + d5 * d5);
d3 = d3 / d6;
d4 = d4 / d6;
d5 = d5 / d6;
double d7 = 0.5D / (d6 / (double)this.explosionSize + 0.1D);
d7 = d7 * (double)(this.worldObj.rand.floatv() * this.worldObj.rand.floatv() + 0.3F);
d3 = d3 * d7;
d4 = d4 * d7;
d5 = d5 * d7;
this.worldObj.spawnParticle(ParticleType.EXPLOSION_NORMAL, (d0 + this.explosionX * 1.0D) / 2.0D, (d1 + this.explosionY * 1.0D) / 2.0D, (d2 + this.explosionZ * 1.0D) / 2.0D, d3, d4, d5);
this.worldObj.spawnParticle(ParticleType.SMOKE, d0, d1, d2, d3, d4, d5);
} }
if (block != Blocks.air) if (block != Blocks.air)

View file

@ -2089,13 +2089,11 @@ public abstract class World implements IWorldAccess {
public void scheduleUpdate(BlockPos pos, Block blockIn, int delay) { public void scheduleUpdate(BlockPos pos, Block blockIn, int delay) {
} }
public void spawnParticle(ParticleType particleType, double xCoord, double yCoord, double zCoord, double xOffset, double yOffset, public void spawnParticle(ParticleType particleType, double xCoord, double yCoord, double zCoord, int data) {
double zOffset, int data) {
} }
public final void spawnParticle(ParticleType particleType, double xCoord, double yCoord, double zCoord, double xOffset, double yOffset, public final void spawnParticle(ParticleType particleType, double xCoord, double yCoord, double zCoord) {
double zOffset) { this.spawnParticle(particleType, xCoord, yCoord, zCoord, 0);
this.spawnParticle(particleType, xCoord, yCoord, zCoord, xOffset, yOffset, zOffset, 0);
} }
// public Difficulty getDifficulty() { // public Difficulty getDifficulty() {

View file

@ -18,16 +18,11 @@ public class CommandEffect extends Command {
this.addPlayerList("player", false, UserPolicy.NON_ADMINS_OR_SELF); this.addPlayerList("player", false, UserPolicy.NON_ADMINS_OR_SELF);
this.addEnum("particle", ParticleType.class, ParticleType.values()); this.addEnum("particle", ParticleType.class, ParticleType.values());
this.addVector("position", true, false); this.addVector("position", true, false);
this.setParamsOptional();
this.addVector("offset", false, false);
this.addDouble("speed", 0.0f, 100.0f, 0.0f);
this.addInt("count", 0, 1000, 0);
} }
public void exec(CommandEnvironment env, Executor exec, List<Player> players, ParticleType type, Vec3 pos, Vec3 offset, double speed, int count) { public void exec(CommandEnvironment env, Executor exec, List<Player> players, ParticleType type, Vec3 pos) {
offset = offset == null ? new Vec3(0.0, 0.0, 0.0) : offset;
for(Player player : players) { for(Player player : players) {
player.sendPacket(new SPacketParticles(type, (float)pos.xCoord, (float)pos.yCoord, (float)pos.zCoord, (float)offset.xCoord, (float)offset.yCoord, (float)offset.zCoord, (float)speed, count, 0)); player.sendPacket(new SPacketParticles(type, (float)pos.xCoord, (float)pos.yCoord, (float)pos.zCoord, 0));
} }
} }
} }

View file

@ -1287,10 +1287,8 @@ public final class WorldServer extends AWorldServer {
// this.resetWeather = false; // this.resetWeather = false;
} }
public void spawnParticle(ParticleType particleType, double xCoord, double yCoord, double zCoord, public void spawnParticles(ParticleType particleType, double xCoord, double yCoord, double zCoord, int data) {
int numberOfParticles, double xOffset, double yOffset, double zOffset, double particleSpeed, int data) { Packet packet = new SPacketParticles(particleType, (float)xCoord, (float)yCoord, (float)zCoord, data);
Packet packet = new SPacketParticles(particleType, (float)xCoord, (float)yCoord, (float)zCoord, (float)xOffset,
(float)yOffset, (float)zOffset, (float)particleSpeed, numberOfParticles, data);
for(int i = 0; i < this.players.size(); ++i) { for(int i = 0; i < this.players.size(); ++i) {
EntityNPC entityplayermp = this.players.get(i); EntityNPC entityplayermp = this.players.get(i);
@ -1689,15 +1687,7 @@ public final class WorldServer extends AWorldServer {
} }
for(EntityNPC player : this.players) { for(EntityNPC player : this.players) {
player.attackEntityFrom(DamageSource.causeExterminatusDamage(null), 5000); player.attackEntityFrom(DamageSource.causeExterminatusDamage(null), 5000);
Packet packet = new SPacketParticles(ParticleType.EXPLOSION_HUGE, Packet packet = new SPacketEffect(1025, new BlockPos(player.posX, (double)this.getSeaLevel() + 4.0, player.posZ), 0);
(float)player.posX, (float)this.getSeaLevel() + 4.0f, (float)player.posZ, (float)128.0,
(float)2.0, (float)128.0, (float)0.15, 1000, 0);
player.connection.sendPacket(packet);
packet = new SPacketParticles(ParticleType.EXPLOSION_NORMAL,
(float)player.posX, (float)this.getSeaLevel() + 4.0f, (float)player.posZ, (float)128.0,
(float)2.0, (float)128.0, (float)0.15, 1000, 0);
player.connection.sendPacket(packet);
packet = new SPacketEffect(1025, new BlockPos(player.posX, (double)this.getSeaLevel() + 4.0, player.posZ), 0);
player.connection.sendPacket(packet); player.connection.sendPacket(packet);
} }
return true; return true;