mirror of
https://github.com/GTNewHorizons/Botania.git
synced 2026-11-17 10:55:17 +00:00
Spark mana particles no longer collide, closes #3033
This commit is contained in:
1 parent
1eb2885d6e
commit
bb8563cd7a
4 files changed
+23
-13
No files matched your search
@@ -37,7 +37,7 @@ public class FXWisp extends Particle {
|
||||
private final int moteHalfLife;
|
||||
|
||||
public FXWisp(World world, double d, double d1, double d2, double xSpeed, double ySpeed, double zSpeed,
|
||||
float size, float red, float green, float blue, boolean depthTest, float maxAgeMul) {
|
||||
float size, float red, float green, float blue, boolean depthTest, float maxAgeMul, boolean noClip) {
|
||||
super(world, d, d1, d2, 0, 0, 0);
|
||||
// super applies wiggle to motion so set it here instead
|
||||
motionX = xSpeed;
|
||||
@@ -58,6 +58,7 @@ public class FXWisp extends Particle {
|
||||
prevPosX = posX;
|
||||
prevPosY = posY;
|
||||
prevPosZ = posZ;
|
||||
this.canCollide = !noClip;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -110,12 +111,6 @@ public class FXWisp extends Particle {
|
||||
particleGravity = value;
|
||||
}
|
||||
|
||||
public void setSpeed(float mx, float my, float mz) {
|
||||
motionX = mx;
|
||||
motionY = my;
|
||||
motionZ = mz;
|
||||
}
|
||||
|
||||
private static void beginRenderCommon(BufferBuilder bufferBuilder, TextureManager textureManager) {
|
||||
GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
|
||||
GlStateManager.depthMask(false);
|
||||
|
||||
@@ -14,6 +14,7 @@ public class WispParticleData implements IParticleData {
|
||||
public final float r, g, b;
|
||||
public final float maxAgeMul;
|
||||
public final boolean depthTest;
|
||||
public final boolean noClip;
|
||||
|
||||
public static WispParticleData wisp(float size, float r, float g, float b) {
|
||||
return wisp(size, r, g, b, 1);
|
||||
@@ -28,18 +29,26 @@ public class WispParticleData implements IParticleData {
|
||||
}
|
||||
|
||||
public static WispParticleData wisp(float size, float r, float g, float b, float maxAgeMul, boolean depthTest) {
|
||||
return new WispParticleData(size, r, g, b, maxAgeMul, depthTest);
|
||||
return new WispParticleData(size, r, g, b, maxAgeMul, depthTest, false);
|
||||
}
|
||||
|
||||
private WispParticleData(float size, float r, float g, float b, float maxAgeMul, boolean depthTest) {
|
||||
private WispParticleData(float size, float r, float g, float b, float maxAgeMul, boolean depthTest, boolean noClip) {
|
||||
this.size = size;
|
||||
this.r = r;
|
||||
this.g = g;
|
||||
this.b = b;
|
||||
this.maxAgeMul = maxAgeMul;
|
||||
this.depthTest = depthTest;
|
||||
this.noClip = noClip;
|
||||
}
|
||||
|
||||
public WispParticleData withNoClip(boolean v) {
|
||||
if (noClip == v) {
|
||||
return this;
|
||||
} else {
|
||||
return new WispParticleData(size, r, g, b, maxAgeMul, depthTest, v);
|
||||
}
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@Override
|
||||
@@ -55,6 +64,7 @@ public class WispParticleData implements IParticleData {
|
||||
buf.writeFloat(b);
|
||||
buf.writeFloat(maxAgeMul);
|
||||
buf.writeBoolean(depthTest);
|
||||
buf.writeBoolean(noClip);
|
||||
}
|
||||
|
||||
@Nonnull
|
||||
@@ -83,12 +93,17 @@ public class WispParticleData implements IParticleData {
|
||||
reader.expect(' ');
|
||||
depth = reader.readBoolean();
|
||||
}
|
||||
return new WispParticleData(size, r, g, b, mam, depth);
|
||||
boolean noClip = false;
|
||||
if (reader.canRead()) {
|
||||
reader.expect(' ');
|
||||
depth = reader.readBoolean();
|
||||
}
|
||||
return new WispParticleData(size, r, g, b, mam, depth, noClip);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WispParticleData read(@Nonnull ParticleType<WispParticleData> type, PacketBuffer buf) {
|
||||
return new WispParticleData(buf.readFloat(), buf.readFloat(), buf.readFloat(), buf.readFloat(), buf.readFloat(), buf.readBoolean());
|
||||
return new WispParticleData(buf.readFloat(), buf.readFloat(), buf.readFloat(), buf.readFloat(), buf.readFloat(), buf.readBoolean(), buf.readBoolean());
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -13,7 +13,7 @@ public class WispParticleType extends ParticleType<WispParticleData> {
|
||||
public static class Factory implements IParticleFactory<WispParticleData> {
|
||||
@Override
|
||||
public Particle makeParticle(WispParticleData data, World world, double x, double y, double z, double mx, double my, double mz) {
|
||||
return new FXWisp(world, x, y, z, mx, my, mz, data.size, data.r, data.g, data.b, data.depthTest, data.maxAgeMul);
|
||||
return new FXWisp(world, x, y, z, mx, my, mz, data.size, data.r, data.g, data.b, data.depthTest, data.maxAgeMul, data.noClip);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -160,7 +160,7 @@ public class PacketBotaniaEffect {
|
||||
float b = 0.4F + 0.3F * (float) Math.random();
|
||||
float size = 0.125F + 0.125F * (float) Math.random();
|
||||
|
||||
WispParticleData data = WispParticleData.wisp(size, r, g, b);
|
||||
WispParticleData data = WispParticleData.wisp(size, r, g, b).withNoClip(true);
|
||||
world.addParticle(data, thisVec.x, thisVec.y, thisVec.z, (float) motion.x, (float) motion.y, (float) motion.z);
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user