Package vazkii.botania.common.core.helper

Examples of vazkii.botania.common.core.helper.Vector3


      active.removeAll(remove);

      player.capabilities.isFlying = player.capabilities.isFlying && player.capabilities.isCreativeMode;

      if(vazkii.botania.common.core.helper.MathHelper.pointDistanceSpace(player.posX, player.posY, player.posZ, source.posX + 0.5, source.posY + 0.5, source.posZ + 0.5) >= range) {
        Vector3 sourceVector = new Vector3(source.posX + 0.5, source.posY + 0.5, source.posZ + 0.5);
        Vector3 playerVector = Vector3.fromEntityCenter(player);
        Vector3 motion = sourceVector.copy().sub(playerVector).copy().normalize();

        player.motionX = motion.x;
        player.motionY = 0.2;
        player.motionZ = motion.z;
      }
View Full Code Here


        }
      }
    }

    Vector3 vec3m = new Vector3(motionX, motionY, motionZ);
    if (vec3m.mag() < 1.0F) {
      if (!worldObj.isRemote) {
        Entity item = getEntityItem().getItem().createEntity(worldObj, this, getEntityItem());
        if (item == null) {
          item = new EntityItem(worldObj, posX, posY, posZ, getEntityItem());
          worldObj.spawnEntityInWorld(item);
View Full Code Here

    List<ISparkEntity> allSparks = SparkHelper.getSparksAround(worldObj, posX, posY, posZ);
    if(worldObj.isRemote && !didStartupParticles) {
      for(ISparkEntity spark : allSparks) {
        Entity e = (Entity) spark;
        Vector3 orig = new Vector3(e.posX , e.posY + 0.25, e.posZ);
        Vector3 end = new Vector3(posX, posY + 0.25, posZ);
        Vector3 diff = end.copy().sub(orig);
        Vector3 movement = diff.copy().normalize().multiply(0.05);
        int iters = (int) (diff.mag() / movement.mag());
        float huePer = 1F / iters;
        float hueSum = (float) Math.random();

        Vector3 currentPos = orig.copy();
        for(int i = 0; i < iters; i++) {
          float hue = i * huePer + hueSum;
          Color color = Color.getHSBColor(hue, 1F, 1F);
          float r = Math.min(1F, color.getRed() / 255F + 0.4F);
          float g = Math.min(1F, color.getGreen() / 255F + 0.4F);
          float b = Math.min(1F, color.getBlue() / 255F + 0.4F);

          Botania.proxy.setSparkleFXNoClip(true);
          Botania.proxy.sparkleFX(worldObj, currentPos.x, currentPos.y, currentPos.z, r, g, b, 0.6F, 12);
          Botania.proxy.setSparkleFXNoClip(false);
          currentPos.add(movement);
        }
      }

      didStartupParticles = true;
    }
View Full Code Here

    if(removeTransferants > 0)
      removeTransferants--;
  }

  void particlesTowards(Entity e) {
    Vector3 thisVec = Vector3.fromEntityCenter(this).add(0, 0, 0);
    Vector3 receiverVec = Vector3.fromEntityCenter(e).add(0, 0, 0);

    double rc = 0.45;
    thisVec.add((Math.random() - 0.5) * rc, (Math.random() - 0.5) * rc, (Math.random() - 0.5) * rc);
    receiverVec.add((Math.random() - 0.5) * rc, (Math.random() - 0.5) * rc, (Math.random() - 0.5) * rc);

    Vector3 motion = receiverVec.copy().sub(thisVec);
    motion.multiply(0.04F);
    float r = 0.4F + 0.3F * (float) Math.random();
    float g = 0.4F + 0.3F * (float) Math.random();
    float b = 0.4F + 0.3F * (float) Math.random();
    float size = 0.125F + 0.125F * (float) Math.random();

View Full Code Here

  public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) {
    int color = getRenderColor(par1World.getBlockMetadata(par2, par3, par4));
    int colorBright = new Color(color).brighter().getRGB();
    int colorDark = new Color(color).darker().getRGB();

    Vector3 origVector = new Vector3(par2 + 0.5, par3 + 0.5, par4 + 0.5);
    Vector3 endVector = origVector.copy().add(par1World.rand.nextDouble() * 2 - 1, par1World.rand.nextDouble() * 2 - 1, par1World.rand.nextDouble() * 2 - 1);
    Botania.proxy.lightningFX(par1World, origVector, endVector, 5F, colorDark, colorBright);
  }
View Full Code Here

    onEntityUpdate();

    if(throwableShake > 0)
      --throwableShake;

    Vec3 vec3 = new Vector3(posX, posY, posZ).toVec3D();
    Vec3 vec31 = new Vector3(posX + motionX, posY + motionY, posZ + motionZ).toVec3D();
    MovingObjectPosition movingobjectposition = clip(vec3, vec31);

    if(movingobjectposition != null)
      vec31 = new Vector3(movingobjectposition.hitVec.xCoord, movingobjectposition.hitVec.yCoord, movingobjectposition.hitVec.zCoord).toVec3D();

    if(!worldObj.isRemote) {
      Entity entity = null;
      List list = worldObj.getEntitiesWithinAABBExcludingEntity(this, boundingBox.addCoord(motionX, motionY, motionZ).expand(1.0D, 1.0D, 1.0D));
      double d0 = 0.0D;
View Full Code Here

            par1Vec3.xCoord += d6 * d5;
            par1Vec3.yCoord += d7 * d5;
            par1Vec3.zCoord = d2;
          }

          Vec3 vec32 = new Vector3(par1Vec3.xCoord, par1Vec3.yCoord, par1Vec3.zCoord).toVec3D();
          l = (int)(vec32.xCoord = MathHelper.floor_double(par1Vec3.xCoord));

          if (b0 == 5) {
            --l;
            ++vec32.xCoord;
View Full Code Here

        double savedPosX = posX;
        double savedPosY = posY;
        double savedPosZ = posZ;

        Vector3 currentPos = Vector3.fromEntity(this);
        Vector3 oldPos = new Vector3(prevPosX, prevPosY, prevPosZ);
        Vector3 diffVec = oldPos.copy().sub(currentPos);
        Vector3 diffVecNorm = diffVec.copy().normalize();

        double distance = 0.095;

        do {
          r = or + ((float) Math.random() - 0.5F) * 0.25F;
 
View Full Code Here

    if(boundTile.posY != -1 && par2EntityPlayer.isSneaking() && (boundTile.posX != par4 || boundTile.posY != par5 || boundTile.posZ != par6)) {
      TileEntity tile = par3World.getTileEntity(boundTile.posX, boundTile.posY, boundTile.posZ);
      if(tile instanceof IWandBindable) {
        if(((IWandBindable) tile).bindTo(par2EntityPlayer, par1ItemStack, par4, par5, par6, par7)) {
          if(par3World.isRemote) {
            Vector3 orig = new Vector3(boundTile.posX + 0.5, boundTile.posY + 0.5, boundTile.posZ + 0.5);
            Vector3 end = new Vector3(par4 + 0.5, par5 + 0.5, par6 + 0.5);
            Vector3 diff = end.copy().sub(orig);
            Vector3 movement = diff.copy().normalize().multiply(0.05);
            int iters = (int) (diff.mag() / movement.mag());
            float huePer = 1F / iters;
            float hueSum = (float) Math.random();

            Vector3 currentPos = orig.copy();
            for(int i = 0; i < iters; i++) {
              float hue = i * huePer + hueSum;
              Color color = Color.getHSBColor(hue, 1F, 1F);
              float r = color.getRed() / 255F;
              float g = color.getGreen() / 255F;
              float b = color.getBlue() / 255F;

              Botania.proxy.setSparkleFXNoClip(true);
              Botania.proxy.sparkleFX(par3World, currentPos.x, currentPos.y, currentPos.z, r, g, b, 0.5F, 4);
              Botania.proxy.setSparkleFXNoClip(false);
              currentPos.add(movement);
            }
          }

          par3World.markBlockForUpdate(boundTile.posX, boundTile.posY, boundTile.posZ);
          setBoundTile(par1ItemStack, 0, -1, 0);
View Full Code Here

        double z2 = entity.posZ;

        float distance = MathHelper.pointDistanceSpace(x1, y1, z1, x2, y2, z2);

        if(distance > maxDist && distance < range) {
          MathHelper.setEntityMotionFromVector(entity, new Vector3(x1, y1, z1), getMotionVelocity());
          if(supertile.getWorldObj().rand.nextInt(3) == 0)
            Botania.proxy.sparkleFX(supertile.getWorldObj(), x2 + Math.random() * entity.width, y2 + Math.random() * entity.height, z2 + Math.random() * entity.width, 0.5F, 0.5F, 0.5F, 1F, 3);
        }
      }

View Full Code Here

TOP

Related Classes of vazkii.botania.common.core.helper.Vector3

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.