Package universalelectricity.api.vector

Examples of universalelectricity.api.vector.VectorWorld


          }
          case 2:
          {
            int animationTime = dataStream.readInt();
            Vector3 anchorPosition = new Vector3(dataStream.readDouble(), dataStream.readDouble(), dataStream.readDouble());
            VectorWorld targetPosition = new VectorWorld(PacketHandler.readNBTTagCompound(dataStream));
            boolean isPreview = dataStream.readBoolean();

            /**
             * Holographic Orbit FXs
             */
            NBTTagCompound nbt = PacketHandler.readNBTTagCompound(dataStream);

            NBTTagList nbtList = (NBTTagList) nbt.getTag("list");

            for (int i = 0; i < nbtList.tagCount(); i++)
            {
              // Render hologram for starting position
              Vector3 vector = new Vector3((NBTTagCompound) nbtList.tagAt(i)).translate(0.5);

              if (isPreview)
              {
                ModularForceFieldSystem.proxy.renderHologramOrbit(this, this.worldObj, anchorPosition, vector, 1, 1, 1, animationTime, 30f);
              }
              else
              {
                ModularForceFieldSystem.proxy.renderHologramOrbit(this, this.worldObj, anchorPosition, vector, 0.1f, 1, 0, animationTime, 30f);
              }

              if (targetPosition.world != null && targetPosition.world.getChunkProvider().chunkExists(targetPosition.intX(), targetPosition.intZ()))
              {
                // Render hologram for destination position
                Vector3 destination = vector.clone().difference(anchorPosition).add(targetPosition);

                if (isPreview)
View Full Code Here


   */
  protected boolean canMove()
  {
    Set<Vector3> mobilizationPoints = this.getInteriorPoints();
    /** The center in which we want to translate into */
    VectorWorld targetCenterPosition = this.getTargetPosition();

    for (Vector3 position : mobilizationPoints)
    {
      if (!this.worldObj.isAirBlock(position.intX(), position.intY(), position.intZ()))
      {
        // The relative position between this coordinate and the anchor.
        Vector3 relativePosition = position.clone().subtract(this.getAbsoluteAnchor());
        VectorWorld targetPosition = (VectorWorld) targetCenterPosition.clone().add(relativePosition);

        if (!this.canMove(new VectorWorld(this.worldObj, position), targetPosition))
        {
          this.failedPositions.add(position);
          return false;
        }
      }
View Full Code Here

  protected boolean moveBlock(Vector3 position)
  {
    if (!this.worldObj.isRemote)
    {
      Vector3 relativePosition = position.clone().subtract(this.getAbsoluteAnchor());
      VectorWorld newPosition = (VectorWorld) this.getTargetPosition().clone().add(relativePosition);

      TileEntity tileEntity = position.getTileEntity(this.worldObj);
      int blockID = position.getBlockID(this.worldObj);

      if (!this.worldObj.isAirBlock(position.intX(), position.intY(), position.intZ()) && tileEntity != this)
View Full Code Here

    if (this.isTeleport())
    {
      return ((ICoordLink) this.getCard().getItem()).getLink(this.getCard());
    }

    return (VectorWorld) new VectorWorld(this.worldObj, this.getAbsoluteAnchor()).clone().translate(this.getDirection());
  }
View Full Code Here

    return new Vector3(this);
  }

  protected void moveEntities()
  {
    VectorWorld targetLocation = this.getTargetPosition();
    AxisAlignedBB axisalignedbb = this.getSearchAxisAlignedBB();

    if (axisalignedbb != null)
    {
      List<Entity> entities = this.worldObj.getEntitiesWithinAABBExcludingEntity(null, axisalignedbb);

      for (Entity entity : entities)
      {
        Vector3 relativePosition = new VectorWorld(entity).clone().subtract(this.getAbsoluteAnchor().translate(0.5));
        VectorWorld newLocation = (VectorWorld) targetLocation.clone().translate(0.5).add(relativePosition);
        moveEntity(entity, newLocation);
      }
    }
  }
View Full Code Here

  {
    super.addInformation(itemstack, entityplayer, list, flag);

    if (hasLink(itemstack))
    {
      VectorWorld vec = getLink(itemstack);
      int blockId = vec.getBlockID(entityplayer.worldObj);

      if (Block.blocksList[blockId] != null)
      {
        list.add(LanguageUtility.getLocal("info.item.linkedWith") + " " + Block.blocksList[blockId].getLocalizedName());
      }

      list.add(vec.intX() + ", " + vec.intY() + ", " + vec.intZ());
      list.add(LanguageUtility.getLocal("info.item.dimension") + " '" + vec.world.provider.getDimensionName() + "'");
    }
    else
    {
      list.add(LanguageUtility.getLocal("info.item.notLinked"));
View Full Code Here

  {
    super.addInformation(itemstack, entityplayer, list, flag);

    if (hasLink(itemstack))
    {
      VectorWorld vec = getLink(itemstack);
      int blockId = vec.getBlockID(entityplayer.worldObj);

      if (Block.blocksList[blockId] != null)
      {
        list.add(LanguageUtility.getLocal("info.item.linkedWith") + " " + Block.blocksList[blockId].getLocalizedName());
      }

      list.add(vec.intX() + ", " + vec.intY() + ", " + vec.intZ());
      list.add(LanguageUtility.getLocal("info.item.dimension") + " " + vec.world.provider.getDimensionName());
    }
    else
    {
      list.add(LanguageUtility.getLocal("info.item.notLinked"));
View Full Code Here

  @Override
  public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10)
  {
    if (!world.isRemote && player.isSneaking())
    {
      VectorWorld vector = new VectorWorld(world, x, y, z);
      this.setLink(itemStack, vector);

      if (Block.blocksList[vector.getBlockID(world)] != null)
      {
        player.addChatMessage(LanguageUtility.getLocal("message.remoteController.linked").replaceAll("%p", x + ", " + y + ", " + z).replaceAll("%q", Block.blocksList[vector.getBlockID(world)].getLocalizedName()));
      }
    }

    return true;
  }
View Full Code Here

  @Override
  public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int par7, float par8, float par9, float par10)
  {
    if (!world.isRemote)
    {
      VectorWorld vector = new VectorWorld(world, x, y, z);
      this.setLink(itemStack, vector);

      if (Block.blocksList[vector.getBlockID(world)] != null)
      {
        player.addChatMessage(LanguageUtility.getLocal("info.item.linkedWith") + " " + x + ", " + y + ", " + z + " - " + Block.blocksList[vector.getBlockID(world)].getLocalizedName());
      }
    }

    return true;
  }
View Full Code Here

    if (itemStack.stackTagCompound == null || !itemStack.getTagCompound().hasKey("link"))
    {
      return null;
    }

    return new VectorWorld(itemStack.getTagCompound().getCompoundTag("link"));
  }
View Full Code Here

TOP

Related Classes of universalelectricity.api.vector.VectorWorld

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.