Skip to content

Commit ccd023f

Browse files
committed
Implement laser particles
1 parent 425b635 commit ccd023f

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package de.ellpeck.nyx.client.particle;
2+
3+
import net.minecraft.client.Minecraft;
4+
import net.minecraft.world.World;
5+
import net.minecraftforge.fml.relauncher.Side;
6+
import net.minecraftforge.fml.relauncher.SideOnly;
7+
8+
@SideOnly(Side.CLIENT)
9+
public class NyxParticleHandler {
10+
public static void spawnLaserParticles(World world, double xCoord, double yCoord, double zCoord, float r, float g, float b) {
11+
Minecraft.getMinecraft().effectRenderer.addEffect(new NyxParticleLaser(world, xCoord, yCoord, zCoord, r, g, b));
12+
}
13+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package de.ellpeck.nyx.client.particle;
2+
3+
import net.minecraft.client.particle.ParticleRedstone;
4+
import net.minecraft.world.World;
5+
import net.minecraftforge.fml.relauncher.Side;
6+
import net.minecraftforge.fml.relauncher.SideOnly;
7+
8+
// Redstone particles except they glow
9+
@SideOnly(Side.CLIENT)
10+
public class NyxParticleLaser extends ParticleRedstone {
11+
public NyxParticleLaser(World world, double x, double y, double z, float red, float green, float blue) {
12+
super(world, x, y, z, 1.0F, red, green, blue);
13+
this.particleRed = red;
14+
this.particleGreen = green;
15+
this.particleBlue = blue;
16+
}
17+
18+
@Override
19+
public int getBrightnessForRender(float partialTick) {
20+
return 15728880;
21+
}
22+
}

0 commit comments

Comments
 (0)