Package universalelectricity.api.vector

Examples of universalelectricity.api.vector.Vector3


    double xDifference = this.posX - orbitPosition.x;
    double yDifference = this.posY - orbitPosition.y;
    double zDifference = this.posZ - orbitPosition.z;

    double speed = this.maxSpeed * ((float) this.particleAge / (float) this.particleMaxAge);
    Vector3 originalPosition = new Vector3(this);
    Vector3 relativePosition = originalPosition.clone().subtract(this.orbitPosition);
    relativePosition.rotate(speed, 0, 0);
    Vector3 newPosition = this.orbitPosition.clone().add(relativePosition);
    this.rotation += speed;

    // Orbit
    this.moveEntity(newPosition.x - originalPosition.x, newPosition.y - originalPosition.y, newPosition.z - originalPosition.z);
  }
View Full Code Here


  public void invalidate()
  {
    if (this.markSendFortron)
    {
      // Let remaining Fortron escape.
      MFFSHelper.transferFortron(this, FrequencyGrid.instance().getFortronTiles(this.worldObj, new Vector3(this), 100, this.getFrequency()), TransferMode.DRAIN, Integer.MAX_VALUE);
    }

    super.invalidate();
  }
View Full Code Here

    }
  }

  public void sendFortronToClients(int range)
  {
    PacketHandler.sendPacketToClients(ModularForceFieldSystem.PACKET_TILE.getPacket(this, this.getPacketData(TilePacketType.FORTRON.ordinal()).toArray()), this.worldObj, new Vector3(this), range);
  }
View Full Code Here

     */
    for (ItemStack itemStack : this.getCards())
    {
      if (itemStack != null && itemStack.getItem() instanceof ICoordLink)
      {
        Vector3 linkedPosition = ((ICoordLink) itemStack.getItem()).getLink(itemStack);

        if (linkedPosition != null)
        {
          TileEntity tileEntity = linkedPosition.getTileEntity(this.worldObj);

          if (linkedPosition != null && tileEntity instanceof IBiometricIdentifier)
          {
            list.add((IBiometricIdentifier) tileEntity);
          }
View Full Code Here

    for (ForgeDirection direction : this.getOutputDirections())
    {
      if (outputEnergy > 0)
      {
        TileEntity tileEntity = new Vector3(this).translate(direction).getTileEntity(this.worldObj);

        if (tileEntity != null)
        {
          usedEnergy += CompatibilityModule.receiveEnergy(tileEntity, direction.getOpposite(), outputEnergy, true);
        }
View Full Code Here

        toBeInjected = transferer.requestFortron(receiver.provideFortron(toBeInjected, true), true);

        // Draw Beam Effect
        if (world.isRemote && toBeInjected > 0 && !isCamo)
        {
          ModularForceFieldSystem.proxy.renderBeam(world, Vector3.translate(new Vector3(tileEntity), 0.5), Vector3.translate(new Vector3((TileEntity) receiver), 0.5), 0.6f, 0.6f, 1, 20);
        }
      }
      else
      {
        // Take energy from receiver.
        joules = Math.min(Math.abs(joules), limit);
        int toBeEjected = transferer.provideFortron(receiver.requestFortron(joules, false), false);

        toBeEjected = receiver.requestFortron(transferer.provideFortron(toBeEjected, true), true);

        // Draw Beam Effect
        if (world.isRemote && toBeEjected > 0 && !isCamo)
        {
          ModularForceFieldSystem.proxy.renderBeam(world, Vector3.translate(new Vector3((TileEntity) receiver), 0.5), Vector3.translate(new Vector3(tileEntity), 0.5), 0.6f, 0.6f, 1, 20);
        }

      }
    }
View Full Code Here

      {
        IInterdictionMatrix interdictionMatrix = (IInterdictionMatrix) frequencyTile;

        if (interdictionMatrix.isActive())
        {
          if (position.distance(new Vector3((TileEntity) interdictionMatrix)) <= interdictionMatrix.getActionRange())
          {
            return interdictionMatrix;
          }
        }
      }
View Full Code Here

    if (recur)
    {
      for (int i = 0; i < 6; i++)
      {
        ForgeDirection direction = ForgeDirection.getOrientation(i);
        Vector3 vector = new Vector3(tileEntity);
        vector.translate(direction);
        TileEntity checkTile = vector.getTileEntity(tileEntity.worldObj);

        if (checkTile != null)
        {
          ItemStack checkStack = getFirstItemBlock(checkTile, itemStack, false);
View Full Code Here

            {
              HashMap<Vector3, int[]> fieldMap = ((ItemModeCustom) projector.getMode()).getFieldBlockMap(projector, projector.getModeStack());

              if (fieldMap != null)
              {
                Vector3 fieldCenter = new Vector3((TileEntity) projector).translate(projector.getTranslation());
                Vector3 relativePosition = position.clone().subtract(fieldCenter);
                relativePosition.rotate(-projector.getRotationYaw(), -projector.getRotationPitch());
                int[] blockInfo = fieldMap.get(relativePosition.round());

                if (blockInfo != null && blockInfo[0] > 0)
                {
                  return new ItemStack(Block.blocksList[blockInfo[0]], 1, blockInfo[1]);
                }
View Full Code Here

      if (evt.entityPlayer.capabilities.isCreativeMode)
      {
        return;
      }

      Vector3 position = new Vector3(evt.x, evt.y, evt.z);

      /**
       * Check if Interdiction Matrix blocked a specific action.
       */
      IInterdictionMatrix interdictionMatrix = MFFSHelper.getNearestInterdictionMatrix(evt.entityPlayer.worldObj, position);

      if (interdictionMatrix != null)
      {
        int blockID = position.getBlockID(evt.entityPlayer.worldObj);

        if (ModularForceFieldSystem.blockBiometricIdentifier.blockID == blockID && MFFSHelper.isPermittedByInterdictionMatrix(interdictionMatrix, evt.entityPlayer.username, Permission.SECURITY_CENTER_CONFIGURE))
        {
          return;
        }

        boolean hasPermission = MFFSHelper.hasPermission(evt.entityPlayer.worldObj, new Vector3(evt.x, evt.y, evt.z), interdictionMatrix, evt.action, evt.entityPlayer);

        if (!hasPermission)
        {
          evt.entityPlayer.addChatMessage("[" + ModularForceFieldSystem.blockInterdictionMatrix.getLocalizedName() + "] You have no permission to do that!");
          evt.setCanceled(true);
View Full Code Here

TOP

Related Classes of universalelectricity.api.vector.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.