use of net.minecraft.client.particle.EntityFX in project ArsMagica2 by Mithion.
the class ParticleRenderer method renderStandardParticles.
private void renderStandardParticles(float partialTicks) {
float rotationX = ActiveRenderInfo.rotationX;
float rotationZ = ActiveRenderInfo.rotationZ;
float rotationYZ = ActiveRenderInfo.rotationYZ;
float rotationXY = ActiveRenderInfo.rotationXY;
float rotationXZ = ActiveRenderInfo.rotationXZ;
// save the old gl state
GL11.glPushAttrib(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
// gl states/settings for drawing
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glDepthMask(false);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glAlphaFunc(GL11.GL_GREATER, 0.003921569F);
GL11.glDisable(32826);
// GL11.glRotatef(180F - RenderManager.instance.playerViewY, 0.0F, 1.0F, 0.0F);
// GL11.glRotatef(-RenderManager.instance.playerViewX, 1.0F, 0.0F, 0.0F);
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
for (EntityFX particle : particles) {
tessellator.setBrightness(particle.getBrightnessForRender(partialTicks));
particle.renderParticle(tessellator, partialTicks, rotationX, rotationXZ, rotationZ, rotationYZ, rotationXY);
}
tessellator.draw();
// restore previous gl state
GL11.glPopAttrib();
}
use of net.minecraft.client.particle.EntityFX in project ArsMagica2 by Mithion.
the class ParticleRenderer method renderArcs.
private void renderArcs(float partialTicks) {
float rotationX = ActiveRenderInfo.rotationX;
float rotationZ = ActiveRenderInfo.rotationZ;
float rotationYZ = ActiveRenderInfo.rotationYZ;
float rotationXY = ActiveRenderInfo.rotationXY;
float rotationXZ = ActiveRenderInfo.rotationXZ;
Tessellator tessellator = Tessellator.instance;
GL11.glDepthMask(false);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 1);
// 2884
GL11.glDisable(2884);
for (EntityFX particle : arcs) {
tessellator.setBrightness(15728864);
particle.renderParticle(tessellator, partialTicks, rotationX, rotationXZ, rotationZ, rotationYZ, rotationXY);
}
GL11.glEnable(2884);
GL11.glDisable(3042);
GL11.glDepthMask(true);
}
use of net.minecraft.client.particle.EntityFX in project ArsMagica2 by Mithion.
the class ParticleRenderer method updateParticles.
private void updateParticles() {
Minecraft.getMinecraft().mcProfiler.startSection(name + "-update");
particles.addAll(deferredParticles);
deferredParticles.clear();
radiants.addAll(deferredRadiants);
deferredRadiants.clear();
arcs.addAll(deferredArcs);
deferredArcs.clear();
blocks.addAll(deferredBlocks);
deferredBlocks.clear();
for (Iterator<EntityFX> it = particles.iterator(); it.hasNext(); ) {
EntityFX particle = it.next();
particle.onUpdate();
if (particle.isDead) {
it.remove();
}
}
for (Iterator<EntityFX> it = radiants.iterator(); it.hasNext(); ) {
EntityFX particle = it.next();
particle.onUpdate();
if (particle.isDead) {
it.remove();
}
}
for (Iterator<AMLineArc> it = arcs.iterator(); it.hasNext(); ) {
AMLineArc particle = it.next();
particle.onUpdate();
if (particle.isDead) {
it.remove();
}
}
for (Iterator<EntityFX> it = blocks.iterator(); it.hasNext(); ) {
EntityFX particle = it.next();
particle.onUpdate();
if (particle.isDead) {
it.remove();
}
}
Minecraft.getMinecraft().mcProfiler.endSection();
}
use of net.minecraft.client.particle.EntityFX in project ArsMagica2 by Mithion.
the class ParticleRenderer method renderRadiants.
private void renderRadiants(float partialTicks) {
float rotationX = ActiveRenderInfo.rotationX;
float rotationZ = ActiveRenderInfo.rotationZ;
float rotationYZ = ActiveRenderInfo.rotationYZ;
float rotationXY = ActiveRenderInfo.rotationXY;
float rotationXZ = ActiveRenderInfo.rotationXZ;
// save the old gl state
GL11.glPushAttrib(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
// gl states/settings for drawing
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glShadeModel(GL11.GL_SMOOTH);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE);
GL11.glDisable(GL11.GL_ALPHA_TEST);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glDepthMask(false);
Tessellator tessellator = Tessellator.instance;
for (EntityFX particle : radiants) {
tessellator.setBrightness(particle.getBrightnessForRender(partialTicks));
particle.renderParticle(tessellator, partialTicks, rotationX, rotationXZ, rotationZ, rotationYZ, rotationXY);
}
// restore previous gl state
GL11.glPopAttrib();
GL11.glDepthMask(true);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_BLEND);
GL11.glShadeModel(GL11.GL_FLAT);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL11.GL_ALPHA_TEST);
}
use of net.minecraft.client.particle.EntityFX in project ICBM-Classic by BuiltBrokenModding.
the class ClientProxy method spawnParticle.
@Override
public void spawnParticle(String name, World world, IPos3D position, double motionX, double motionY, double motionZ, float red, float green, float blue, float scale, double distance) {
EntityFX fx = null;
if (name.equals("smoke")) {
fx = new FXSmoke(world, new Pos(position), red, green, blue, scale, distance);
} else if (name.equals("missile_smoke")) {
fx = (new FXSmoke(world, new Pos(position), red, green, blue, scale, distance)).setAge(100);
} else if (name.equals("portal")) {
fx = new FXEnderPortalPartical(world, new Pos(position), red, green, blue, scale, distance);
} else if (name.equals("antimatter")) {
fx = new FXAntimatterPartical(world, new Pos(position), red, green, blue, scale, distance);
} else if (name.equals("digging")) {
fx = new EntityDiggingFX(world, position.x(), position.y(), position.z(), motionX, motionY, motionZ, Block.getBlockById((int) red), 0, (int) green);
fx.multipleParticleScaleBy(blue);
} else if (name.equals("shockwave")) {
//fx = new FXShockWave(world, new Pos(position), red, green, blue, scale, distance);
}
if (fx != null) {
fx.motionX = motionX;
fx.motionY = motionY;
fx.motionZ = motionZ;
FMLClientHandler.instance().getClient().effectRenderer.addEffect(fx);
}
}
Aggregations