@SideOnly(Side.CLIENT)
 private void idleParticles() {
   double px = ReikaRandomHelper.getRandomPlusMinus(xCoord + 0.5, 1.5);
   double pz = ReikaRandomHelper.getRandomPlusMinus(zCoord + 0.5, 1.5);
   float g = -(float) ReikaRandomHelper.getRandomPlusMinus(0.125, 0.0625);
   int color = CrystalElement.getBlendedColor(ticks, 40);
   int l = ReikaRandomHelper.getRandomPlusMinus(80, 40);
   EntityBlurFX fx =
       new EntityBlurFX(worldObj, px, yCoord + 1.25, pz, 0, 0, 0)
           .setGravity(g)
           .setLife(l)
           .setColor(color);
   fx.noClip = true;
   Minecraft.getMinecraft().effectRenderer.addEffect(fx);
 }
Пример #2
0
  @SideOnly(Side.CLIENT)
  private void spawnParticles(World world, int x, int y, int z) {
    double px = x + particleX;
    double py = y + particleY;
    double pz = z;

    int color = CrystalElement.getBlendedColor(this.getTicksExisted(), 40);

    EntityBlurFX fx =
        new EntityBlurFX(world, px, py, pz).setScale(0.5F).setLife(40).setColor(color);
    Minecraft.getMinecraft().effectRenderer.addEffect(fx);

    px = x + 1 - particleX;
    py = y + 1 - particleY;
    fx = new EntityBlurFX(world, px, py, pz).setScale(0.5F).setLife(40).setColor(color);
    Minecraft.getMinecraft().effectRenderer.addEffect(fx);

    pz = z + 1;
    px = x + 1 - particleX;
    py = y + particleY;
    fx = new EntityBlurFX(world, px, py, pz).setScale(0.5F).setLife(40).setColor(color);
    Minecraft.getMinecraft().effectRenderer.addEffect(fx);

    px = x + particleX;
    py = y + 1 - particleY;
    fx = new EntityBlurFX(world, px, py, pz).setScale(0.5F).setLife(40).setColor(color);
    Minecraft.getMinecraft().effectRenderer.addEffect(fx);

    px = x;
    pz = z + particleX;
    py = y + particleY;
    fx = new EntityBlurFX(world, px, py, pz).setScale(0.5F).setLife(40).setColor(color);
    Minecraft.getMinecraft().effectRenderer.addEffect(fx);

    pz = z + 1 - particleX;
    py = y + 1 - particleY;
    fx = new EntityBlurFX(world, px, py, pz).setScale(0.5F).setLife(40).setColor(color);
    Minecraft.getMinecraft().effectRenderer.addEffect(fx);

    px = x + 1;
    pz = z + 1 - particleX;
    py = y + particleY;
    fx = new EntityBlurFX(world, px, py, pz).setScale(0.5F).setLife(40).setColor(color);
    Minecraft.getMinecraft().effectRenderer.addEffect(fx);

    pz = z + particleX;
    py = y + 1 - particleY;
    fx = new EntityBlurFX(world, px, py, pz).setScale(0.5F).setLife(40).setColor(color);
    Minecraft.getMinecraft().effectRenderer.addEffect(fx);

    double d = 0.05;
    particleX += particleVX;
    particleY += particleVY;
    particleX = MathHelper.clamp_double(particleX, 0, 1);
    particleY = MathHelper.clamp_double(particleY, 0, 1);

    if (particleX == 1 && particleY == 0) {
      particleVX = 0;
      particleVY = d;
    }
    if (particleY == 1 && particleY == 1) {
      particleVX = -d;
      particleVY = 0;
    }
    if (particleX == 0 && particleY == 1) {
      particleVX = 0;
      particleVY = -d;
    }
    if (particleX == 0 && particleY == 0) {
      particleVX = d;
      particleVY = 0;
    }
  }