@SideOnly(Side.CLIENT)
  @Override
  public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
    if (isActive(world, x, y, z) && shouldDoWorkThisTick(world, x, y, z, 5)) {
      float startX = x + 1.0F;
      float startY = y + 0.85F;
      float startZ = z + 1.0F;
      for (int i = 0; i < 1; i++) {
        float xOffset = -0.2F - rand.nextFloat() * 0.6F;
        float yOffset = -0.1F + rand.nextFloat() * 0.2F;
        float zOffset = -0.2F - rand.nextFloat() * 0.6F;

        EntityFX fx =
            Minecraft.getMinecraft()
                .renderGlobal
                .doSpawnParticle(
                    "spell",
                    startX + xOffset,
                    startY + yOffset,
                    startZ + zOffset,
                    0.0D,
                    0.0D,
                    0.0D);
        if (fx != null) {
          fx.setRBGColorF(0.2f, 0.2f, 0.8f);
          fx.motionY *= 0.5f;
        }
      }
    }
  }
  private void updateEffects() {
    for (int k = 0; k < fxes.length; ++k) {

      for (int j = 0; j < this.fxes[k].size(); ++j) {
        final EntityFX entityfx = this.fxes[k].get(j);

        try {
          if (entityfx != null) {
            entityfx.onUpdate();
          }
        } catch (Throwable throwable) {
          CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Ticking Particle");
          CrashReportCategory crashreportcategory =
              crashreport.makeCategory("Particle being ticked");
          crashreportcategory.addCrashSectionCallable(
              "Particle",
              new Callable() {
                private static final String __OBFID = "CL_00000916";

                public String call() {
                  return entityfx.toString();
                }
              });
          throw new ReportedException(crashreport);
        }

        if (entityfx == null || entityfx.isDead) {
          this.fxes[k].remove(j--);
        }
      }
    }
  }
  private void spawnParticles() {
    double var8 = posX;
    double var10 = posY;
    double var12 = posZ;
    String var14 = "iconcrack_" + Item.potion.itemID;
    Random var7 = rand;
    for (int var15 = 0; var15 < 8; ++var15) {
      worldObj.spawnParticle(
          var14,
          var8,
          var10,
          var12,
          var7.nextGaussian() * 0.15D,
          var7.nextDouble() * 0.2D,
          var7.nextGaussian() * 0.15D);
    }

    float red = 0.3F;
    float green = 1.0F;
    float blue = 0.1F;
    String var19 = "spell";

    for (int var20 = 0; var20 < 100; ++var20) {
      double var39 = var7.nextDouble() * 4.0D;
      double var23 = var7.nextDouble() * Math.PI * 2.0D;
      double var25 = Math.cos(var23) * var39;
      double var27 = 0.01D + var7.nextDouble() * 0.5D;
      double var29 = Math.sin(var23) * var39;
      if (worldObj.isRemote) {
        EntityFX var31 =
            Minecraft.getMinecraft()
                .renderGlobal
                .doSpawnParticle(
                    var19,
                    var8 + var25 * 0.1D,
                    var10 + 0.3D,
                    var12 + var29 * 0.1D,
                    var25,
                    var27,
                    var29);
        if (var31 != null) {
          float var32 = 0.75F + var7.nextFloat() * 0.25F;
          var31.setRBGColorF(red * var32, green * var32, blue * var32);
          var31.multiplyVelocity((float) var39);
        }
      }
    }

    worldObj.playSoundEffect(
        posX + 0.5D,
        posY + 0.5D,
        posZ + 0.5D,
        "random.glass",
        1.0F,
        worldObj.rand.nextFloat() * 0.1F + 0.9F);
  }
  public void renderParticles(Entity entity, float f) {
    float f1 = ActiveRenderInfo.rotationX;
    float f2 = ActiveRenderInfo.rotationZ;
    float f3 = ActiveRenderInfo.rotationYZ;
    float f4 = ActiveRenderInfo.rotationXY;
    float f5 = ActiveRenderInfo.rotationXZ;
    EntityFX.interpPosX = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * (double) f;
    EntityFX.interpPosY = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * (double) f;
    EntityFX.interpPosZ = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * (double) f;

    for (int k = 0; k < fxes.length; ++k) {
      if (!this.fxes[k].isEmpty()) {
        GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
        GL11.glDepthMask(false);
        GL11.glEnable(GL11.GL_BLEND);
        switch (k) {
          case 0:
            GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE);
            renderer.bindTexture(additiveTextureSheet);
            break;
        }

        GL11.glAlphaFunc(GL11.GL_GREATER, 0.003921569F);
        Tessellator tessellator = Tessellator.instance;
        tessellator.startDrawingQuads();

        for (int j = 0; j < this.fxes[k].size(); ++j) {
          final EntityFX entityfx = this.fxes[k].get(j);
          if (entityfx == null) continue;
          tessellator.setBrightness(entityfx.getBrightnessForRender(f));

          try {
            entityfx.renderParticle(tessellator, f, f1, f5, f2, f3, f4);
          } catch (Throwable throwable) {
            CrashReport crashreport = CrashReport.makeCrashReport(throwable, "Rendering Particle");
            CrashReportCategory crashreportcategory =
                crashreport.makeCategory("Particle being rendered");
            crashreportcategory.addCrashSectionCallable("Particle", entityfx::toString);
            throw new ReportedException(crashreport);
          }
        }

        tessellator.draw();
        GL11.glDisable(GL11.GL_BLEND);
        GL11.glDepthMask(true);
        GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
      }
    }
  }
    @SideOnly(Side.CLIENT)
    private void activeParticles() {
      CrystalElement e = CrystalElement.elements[ticks / 8 % 16];
      double vx = ReikaRandomHelper.getRandomPlusMinus(0, 0.03125);
      double vz = ReikaRandomHelper.getRandomPlusMinus(0, 0.03125);
      float g = -(float) ReikaRandomHelper.getRandomPlusMinus(0.125, 0.0625);
      EntityBlurFX fx =
          new EntityBlurFX(worldObj, xCoord + 0.5, yCoord + 8.25, zCoord + 0.5, vx, 0, vz)
              .setGravity(g);
      Minecraft.getMinecraft().effectRenderer.addEffect(fx);

      // ---------------------------
      int dx = worldObj.rand.nextBoolean() ? 3 : -3;
      int dz = worldObj.rand.nextBoolean() ? 3 : -3;
      double x = xCoord + dx + worldObj.rand.nextDouble();
      double y = yCoord + 5 + worldObj.rand.nextDouble();
      double z = zCoord + dz + worldObj.rand.nextDouble();
      double v = 0.0625;
      vx = x < xCoord ? v : -v;
      vz = z < zCoord ? v : -v;
      if (worldObj.rand.nextBoolean()) vx = 0;
      else vz = 0;

      EntityFX fx2 =
          new EntityCenterBlurFX(e, worldObj, x, y, z, vx, 0, vz).setScale(2).setNoSlowdown();
      fx2.noClip = true;
      Minecraft.getMinecraft().effectRenderer.addEffect(fx2);

      // ----------------------------------
      dx = worldObj.rand.nextBoolean() ? 7 : -7;
      dz = worldObj.rand.nextBoolean() ? 7 : -7;
      if (worldObj.rand.nextBoolean()) dx += Math.signum(dx) * -4;
      else dz += Math.signum(dz) * -4;
      x = xCoord + dx + worldObj.rand.nextDouble();
      y = yCoord + 5 + worldObj.rand.nextDouble();
      z = zCoord + dz + worldObj.rand.nextDouble();
      v = 0.0625;
      vx = x < xCoord ? v : -v;
      vz = z < zCoord ? v : -v;
      if (worldObj.rand.nextBoolean()) vx = 0;
      else vz = 0;

      boolean longAxis = (Math.abs(dx) == 7 && vx != 0) || (Math.abs(dz) == 7 && vz != 0);
      int l = !longAxis ? 100 : 60;

      EntityRuneFX fx3 = new EntityRuneFX(worldObj, x, y, z, vx, 0, vz, e).setScale(2).setLife(l);
      fx3.noClip = true;
      Minecraft.getMinecraft().effectRenderer.addEffect(fx3);
    }
 @Override
 public void func_180434_a(
     WorldRenderer worldrenderer,
     Entity p_180434_2_,
     float p_180434_3_,
     float p_180434_4_,
     float p_180434_5_,
     float p_180434_6_,
     float p_180434_7_,
     float p_180434_8_) {
   Minecraft.getMinecraft().getTextureManager().bindTexture(ClientProxy.particles);
   float f1 = ((float) this.particleAge + p_180434_3_) / (float) this.particleMaxAge;
   this.particleScale = this.flameScale * (1.0F - f1 * f1 * 0.5F);
   GlStateManager.blendFunc(770, 771);
   worldrenderer.startDrawingQuads();
   worldrenderer.setBrightness(this.getBrightnessForRender(p_180434_3_));
   super.func_180434_a(
       worldrenderer,
       p_180434_2_,
       p_180434_3_,
       p_180434_4_,
       p_180434_5_,
       p_180434_6_,
       p_180434_7_,
       p_180434_8_);
   Tessellator.getInstance().draw();
   GlStateManager.enableLighting();
 }
 @Override
 public void renderParticle(
     Tessellator var1, float var2, float var3, float var4, float var5, float var6, float var7) {
   float var8 = (this.particleAge + var2) / this.particleMaxAge;
   var8 = 1.0F - var8;
   var8 *= var8;
   var8 = 1.0F - var8;
   this.particleScale = this.portalParticleScale * var8;
   super.renderParticle(var1, var2, var3, var4, var5, var6, var7);
 }
 public void renderParticle(
     Tessellator par1Tessellator,
     float par2,
     float par3,
     float par4,
     float par5,
     float par6,
     float par7) {
   float var8 = ((float) this.particleAge + par2) / (float) this.particleMaxAge;
   this.particleScale = this.flameScale * (1.0F - var8 * var8 * 0.5F);
   super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7);
 }
Exemple #9
0
 public void func_70539_a(
     Tessellator p_70539_1_,
     float p_70539_2_,
     float p_70539_3_,
     float p_70539_4_,
     float p_70539_5_,
     float p_70539_6_,
     float p_70539_7_) {
   float var8 = ((float) this.field_70546_d + p_70539_2_) / (float) this.field_70547_e;
   this.field_70544_f = this.field_70562_a * (1.0F - var8 * var8 * 0.5F);
   super.func_70539_a(
       p_70539_1_, p_70539_2_, p_70539_3_, p_70539_4_, p_70539_5_, p_70539_6_, p_70539_7_);
 }
  @Override
  public void generateGundPowderSpark(
      World world, BlockPos pos, float offsetX, float offsetY, float offsetZ) {
    double motionX = 0.08 + world.rand.nextGaussian() * 0.05D;
    double motionY = 0.1 + world.rand.nextGaussian() * 0.1D;
    double motionZ = 0.05 + world.rand.nextGaussian() * 0.05D;

    EntityFX particle =
        new EntityGunpowderSparkFX(
            world,
            pos.getX() + offsetX,
            pos.getY() + offsetY,
            pos.getZ() + offsetZ,
            motionX,
            motionY,
            motionZ);

    particle.motionX = motionX;
    particle.motionY = motionY;
    particle.motionZ = motionZ;

    Minecraft.getMinecraft().effectRenderer.addEffect(particle);
  }
  @Override
  public void onUpdate() {
    super.onUpdate();

    int phase = (initialPhase + particleAge) % 64;

    motionY = 0.1f;
    motionX = cos[phase] * Config.soulFXPerturb;
    motionZ = sin[phase] * Config.soulFXPerturb;

    particleTrail.addFirst(new Double3(posX, posY, posZ));
    while (particleTrail.size() > Config.soulFXTrailLength) particleTrail.removeLast();

    if (!Config.globalEnabled) setDead();
  }
  public void renderParticle(
      Tessellator p_70539_1_,
      float p_70539_2_,
      float p_70539_3_,
      float p_70539_4_,
      float p_70539_5_,
      float p_70539_6_,
      float p_70539_7_) {
    float var8 = ((float) this.particleAge + p_70539_2_) / (float) this.particleMaxAge * 32.0F;

    if (var8 < 0.0F) {
      var8 = 0.0F;
    }

    if (var8 > 1.0F) {
      var8 = 1.0F;
    }

    super.renderParticle(
        p_70539_1_, p_70539_2_, p_70539_3_, p_70539_4_, p_70539_5_, p_70539_6_, p_70539_7_);
  }
  public void renderParticle(
      Tessellator par1Tessellator,
      float par2,
      float par3,
      float par4,
      float par5,
      float par6,
      float par7) {
    float f6 = ((float) this.particleAge + par2) / (float) this.particleMaxAge * 32.0F;

    if (f6 < 0.0F) {
      f6 = 0.0F;
    }

    if (f6 > 1.0F) {
      f6 = 1.0F;
    }

    this.particleScale = this.smokeParticleScale * f6;
    super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7);
  }
Exemple #14
0
 public void func_180434_a(
     WorldRenderer p_180434_1_,
     Entity p_180434_2_,
     float p_180434_3_,
     float p_180434_4_,
     float p_180434_5_,
     float p_180434_6_,
     float p_180434_7_,
     float p_180434_8_) {
   float var9 = ((float) this.particleAge + p_180434_3_) / (float) this.particleMaxAge * 32.0F;
   var9 = MathHelper.clamp_float(var9, 0.0F, 1.0F);
   this.particleScale = this.reddustParticleScale * var9;
   super.func_180434_a(
       p_180434_1_,
       p_180434_2_,
       p_180434_3_,
       p_180434_4_,
       p_180434_5_,
       p_180434_6_,
       p_180434_7_,
       p_180434_8_);
 }
  public void renderParticle(
      Tessellator par1Tessellator,
      float par2,
      float par3,
      float par4,
      float par5,
      float par6,
      float par7) {
    float var8 = ((float) this.particleAge + par2) / (float) this.particleMaxAge;
    this.particleScale = this.reddustParticleScale * (1.0F - var8 * var8);
    super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7);

    GL11.glPushMatrix();

    GL11.glDepthMask(false);

    GL11.glDisable(3008);
    GL11.glEnable(3042);

    GL11.glColorMask(true, true, true, true);
    GL11.glBlendFunc(770, 1);
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 0.5F);

    float var81 = 0.05F;
    float var9 = 0.05F;
    float var10 = 0.05F;
    float var11 = 0.05F;
    float var12 = 0.2F * this.particleScale;
    float var13 =
        (float) (this.prevPosX + (this.posX - this.prevPosX) * (double) par2 - interpPosX);
    float var14 =
        (float) (this.prevPosY + (this.posY - this.prevPosY) * (double) par2 - interpPosY);
    float var15 =
        (float) (this.prevPosZ + (this.posZ - this.prevPosZ) * (double) par2 - interpPosZ);
    float var16 = 1.0F;
    par1Tessellator.setColorRGBA_F(
        var16 * this.particleRed, var16 * this.particleGreen, var16 * this.particleBlue, 1.0F);
    par1Tessellator.addVertexWithUV(
        (var13 - par3 * var12 - par6 * var12),
        (var14 - par4 * var12),
        (var15 - par5 * var12 - par7 * var12),
        var81,
        var11);
    par1Tessellator.addVertexWithUV(
        (var13 - par3 * var12 + par6 * var12),
        (var14 + par4 * var12),
        (var15 - par5 * var12 + par7 * var12),
        var81,
        var10);
    par1Tessellator.addVertexWithUV(
        (var13 + par3 * var12 + par6 * var12),
        (var14 + par4 * var12),
        (var15 + par5 * var12 + par7 * var12),
        var9,
        var10);
    par1Tessellator.addVertexWithUV(
        (var13 + par3 * var12 - par6 * var12),
        (var14 - par4 * var12),
        (var15 + par5 * var12 - par7 * var12),
        var9,
        var11);

    GL11.glDisable(3042);
    GL11.glEnable(3008);
    GL11.glDepthMask(true);

    GL11.glPopMatrix();
  }