Search in sources :

Example 11 with EntityFX

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();
}
Also used : Tessellator(net.minecraft.client.renderer.Tessellator) EntityFX(net.minecraft.client.particle.EntityFX)

Example 12 with EntityFX

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);
}
Also used : Tessellator(net.minecraft.client.renderer.Tessellator) EntityFX(net.minecraft.client.particle.EntityFX)

Example 13 with EntityFX

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();
}
Also used : EntityFX(net.minecraft.client.particle.EntityFX)

Example 14 with EntityFX

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);
}
Also used : Tessellator(net.minecraft.client.renderer.Tessellator) EntityFX(net.minecraft.client.particle.EntityFX)

Example 15 with EntityFX

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);
    }
}
Also used : EntityDiggingFX(net.minecraft.client.particle.EntityDiggingFX) FXAntimatterPartical(icbm.classic.client.fx.FXAntimatterPartical) Pos(com.builtbroken.mc.imp.transform.vector.Pos) EntityFX(net.minecraft.client.particle.EntityFX) FXEnderPortalPartical(com.builtbroken.mc.lib.render.fx.FXEnderPortalPartical) FXSmoke(com.builtbroken.mc.lib.render.fx.FXSmoke)

Aggregations

EntityFX (net.minecraft.client.particle.EntityFX)21 Minecraft (net.minecraft.client.Minecraft)5 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)4 EntityExplodeFX (net.minecraft.client.particle.EntityExplodeFX)3 Tessellator (net.minecraft.client.renderer.Tessellator)3 SideOnly (cpw.mods.fml.relauncher.SideOnly)2 Vector3 (micdoodle8.mods.galacticraft.api.vector.Vector3)2 Block (net.minecraft.block.Block)2 WorldClient (net.minecraft.client.multiplayer.WorldClient)2 Entity (net.minecraft.entity.Entity)2 TileEntity (net.minecraft.tileentity.TileEntity)2 Pos (com.builtbroken.mc.imp.transform.vector.Pos)1 FXEnderPortalPartical (com.builtbroken.mc.lib.render.fx.FXEnderPortalPartical)1 FXSmoke (com.builtbroken.mc.lib.render.fx.FXSmoke)1 BlockHint (com.github.technus.tectech.entity.fx.BlockHint)1 GameProfile (com.mojang.authlib.GameProfile)1 Property (com.mojang.authlib.properties.Property)1 FXAntimatterPartical (icbm.classic.client.fx.FXAntimatterPartical)1 IOException (java.io.IOException)1 Random (java.util.Random)1