mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-18 03:15:07 +00:00
Make sparkle particles match 1.7 more closely (it's still a bit off >_>)
This commit is contained in:
3 files changed
+26
-26
No files matched your search
@@ -444,9 +444,10 @@ public class ClientProxy implements IProxy {
|
||||
return;
|
||||
|
||||
FXSparkle sparkle = new FXSparkle(Minecraft.getMinecraft().world, x, y, z, size, r, g, b, m);
|
||||
sparkle.fake = sparkle.noClip = fake;
|
||||
sparkle.fake = fake;
|
||||
sparkle.setCanCollide(!fake);
|
||||
if(noclipEnabled)
|
||||
sparkle.noClip = true;
|
||||
sparkle.setCanCollide(false);
|
||||
if(corruptSparkle)
|
||||
sparkle.corrupt = true;
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(sparkle);
|
||||
|
||||
@@ -46,8 +46,6 @@ public class FXSparkle extends Particle {
|
||||
private float f4;
|
||||
private float f5;
|
||||
|
||||
public boolean noClip = false;
|
||||
|
||||
public FXSparkle(World world, double x, double y, double z, float size, float red, float green, float blue, int m) {
|
||||
super(world, x, y, z, 0.0D, 0.0D, 0.0D);
|
||||
|
||||
@@ -60,7 +58,6 @@ public class FXSparkle extends Particle {
|
||||
particleScale *= size;
|
||||
particleMaxAge = 3 * m;
|
||||
multiplier = m;
|
||||
noClip = false;
|
||||
setSize(0.01F, 0.01F);
|
||||
prevPosX = posX;
|
||||
prevPosY = posY;
|
||||
@@ -115,6 +112,10 @@ public class FXSparkle extends Particle {
|
||||
|
||||
}
|
||||
|
||||
public void setCanCollide(boolean canCollide) {
|
||||
this.canCollide = canCollide;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderParticle(VertexBuffer worldRendererIn, Entity entity, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
this.f = f;
|
||||
@@ -140,12 +141,10 @@ public class FXSparkle extends Particle {
|
||||
|
||||
motionY -= 0.04D * particleGravity;
|
||||
|
||||
if (!noClip && !fake)
|
||||
if (canCollide && !fake)
|
||||
wiggleAround(posX, (getBoundingBox().minY + getBoundingBox().maxY) / 2.0D, posZ);
|
||||
|
||||
posX += motionX;
|
||||
posY += motionY;
|
||||
posZ += motionZ;
|
||||
this.move(motionX, motionY, motionZ);
|
||||
|
||||
if (slowdown) {
|
||||
motionX *= 0.908000001907348633D;
|
||||
@@ -192,7 +191,6 @@ public class FXSparkle extends Particle {
|
||||
enumfacing = EnumFacing.EAST;
|
||||
}
|
||||
|
||||
|
||||
if (!world.isBlockFullCube(blockpos.north()) && d2 < d3)
|
||||
{
|
||||
d3 = d2;
|
||||
@@ -211,23 +209,23 @@ public class FXSparkle extends Particle {
|
||||
enumfacing = EnumFacing.UP;
|
||||
}
|
||||
|
||||
float f = rand.nextFloat() * 0.05F + 0.01F; // Botania - made multiplier and add both smaller
|
||||
float f = rand.nextFloat() * 0.05F + 0.025F; // Botania - made multiplier and add both smaller
|
||||
float f1 = enumfacing.getAxisDirection().getOffset();
|
||||
float secondary = (rand.nextFloat() - rand.nextFloat()) * 0.1F; // Botania - Make and use a secondary movement variable below
|
||||
|
||||
if (enumfacing.getAxis() == EnumFacing.Axis.X)
|
||||
{
|
||||
motionX += f1 * f;
|
||||
motionX = f1 * f;
|
||||
motionY = motionZ = secondary;
|
||||
}
|
||||
else if (enumfacing.getAxis() == EnumFacing.Axis.Y)
|
||||
{
|
||||
motionY += f1 * f;
|
||||
motionY = f1 * f;
|
||||
motionX = motionZ = secondary;
|
||||
}
|
||||
else if (enumfacing.getAxis() == EnumFacing.Axis.Z)
|
||||
{
|
||||
motionZ += f1 * f;
|
||||
motionZ = f1 * f;
|
||||
motionX = motionY = secondary;
|
||||
}
|
||||
|
||||
|
||||
@@ -140,22 +140,23 @@ public class FXWisp extends Particle {
|
||||
else queuedDepthIgnoringRenders.add(this);
|
||||
}
|
||||
|
||||
// [VanillaCopy] of super, without drag when onGround is true
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
prevPosX = posX;
|
||||
prevPosY = posY;
|
||||
prevPosZ = posZ;
|
||||
this.prevPosX = this.posX;
|
||||
this.prevPosY = this.posY;
|
||||
this.prevPosZ = this.posZ;
|
||||
|
||||
if (particleAge++ >= particleMaxAge)
|
||||
setExpired();
|
||||
if (this.particleAge++ >= this.particleMaxAge)
|
||||
{
|
||||
this.setExpired();
|
||||
}
|
||||
|
||||
motionY -= 0.04D * particleGravity;
|
||||
posX += motionX;
|
||||
posY += motionY;
|
||||
posZ += motionZ;
|
||||
motionX *= 0.98000001907348633D;
|
||||
motionY *= 0.98000001907348633D;
|
||||
motionZ *= 0.98000001907348633D;
|
||||
this.motionY -= 0.04D * (double)this.particleGravity;
|
||||
this.move(this.motionX, this.motionY, this.motionZ);
|
||||
this.motionX *= 0.9800000190734863D;
|
||||
this.motionY *= 0.9800000190734863D;
|
||||
this.motionZ *= 0.9800000190734863D;
|
||||
}
|
||||
|
||||
public void setGravity(float value) {
|
||||
|
||||
Reference in new issue
Block a user