Package powercrystals.core.position

Examples of powercrystals.core.position.BlockPosition


    {
      NBTTagCompound tag = new NBTTagCompound();
      NBTTagCompound name = new NBTTagCompound();
      name.setString("Name", getInvName());
      tag.setTag("display", name);
      BlockNBTManager.setForBlock(new BlockPosition(xCoord, yCoord, zCoord), tag);
    }
  }
View Full Code Here


  public static ForgeDirection[] directionsWithoutConveyors(World world, int x, int y, int z)
  {
    ArrayList<ForgeDirection> nonConveyors = new ArrayList<ForgeDirection>();
    for(ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS)
    {
      BlockPosition bp = new BlockPosition(x, y, z);
      bp.orientation = direction;
      bp.moveForwards(1);
      TileEntity te = world.getBlockTileEntity(bp.x, bp.y, bp.z);
      if(te == null || !(te instanceof TileEntityConveyor))
      {
        nonConveyors.add(direction);
      }
View Full Code Here

  }
 
  @Override
  public boolean activateMachine()
  {   
    BlockPosition bp = BlockPosition.fromFactoryTile(this);
    bp.moveForwards(1);
    int blockId = worldObj.getBlockId(bp.x, bp.y, bp.z);
    int blockMeta = worldObj.getBlockMetadata(bp.x, bp.y, bp.z);
   
    Block b = Block.blocksList[blockId];
    if(b != null && !b.isAirBlock(worldObj, bp.x, bp.y, bp.z) && !Util.isBlockUnbreakable(worldObj, bp.x, bp.y, bp.z) && b.getBlockHardness(worldObj, bp.x, bp.y, bp.z) >= 0)
View Full Code Here

  {
    if(tank != null && tank.getLiquid() != null && tank.getLiquid().amount > 0)
    {
      LiquidStack l = tank.getLiquid().copy();
      l.amount = Math.min(l.amount, LiquidContainerRegistry.BUCKET_VOLUME);
      for(BlockPosition adj : new BlockPosition(from).getAdjacent(true))
      {
        TileEntity tile = from.worldObj.getBlockTileEntity(adj.x, adj.y, adj.z);
        if(tile instanceof ITankContainer)
        {
          int filled = ((ITankContainer)tile).fill(adj.orientation.getOpposite(), l, true);
View Full Code Here

      {
        continue;
      }
     
      ItemStack stackToAdd = contents.getValue().copy();
      ItemStack remaining = UtilInventory.dropStack(world, new BlockPosition(x, y, z), contents.getValue(), ForgeDirection.VALID_DIRECTIONS, ForgeDirection.UNKNOWN);
     
      if(remaining != null)
      {
        stackToAdd.stackSize -= remaining.stackSize;
      }
View Full Code Here

    {
      return true;
    }
    for(ForgeDirection d : _attachDirections)
    {
      BlockPosition bp = new BlockPosition(x, y, z, d);
      for(int i = 0; i < _attachDistance; i++)
      {
        bp.moveForwards(1);
        if(world.getBlockId(bp.x, bp.y, bp.z) == blockID && world.isBlockSolidOnSide(bp.x, bp.y - 1, bp.z, ForgeDirection.UP))
        {
          return true;
        }
      }
View Full Code Here

    {
      ((TileEntityRedNetCable)te).getNetwork().setInvalid();
    }
    for(ForgeDirection d : ForgeDirection.VALID_DIRECTIONS)
    {
      BlockPosition bp = new BlockPosition(x, y, z);
      bp.orientation = d;
      bp.moveForwards(1);
      world.notifyBlockOfNeighborChange(bp.x, bp.y, bp.z, MineFactoryReloadedCore.rednetCableBlock.blockID);
      world.notifyBlocksOfNeighborChange(bp.x, bp.y, bp.z, MineFactoryReloadedCore.rednetCableBlock.blockID);
    }
    super.breakBlock(world, x, y, z, id, meta);
  }
View Full Code Here

      if(cable.getNetwork() == null || cable.getConnectionState(ForgeDirection.VALID_DIRECTIONS[side].getOpposite()) == RedNetConnectionType.None)
      {
        return 0;
      }
     
      BlockPosition nodebp = new BlockPosition(x, y, z, ForgeDirection.getOrientation(side).getOpposite());
      nodebp.moveForwards(1);

      int subnet = cable.getSideColor(nodebp.orientation);
     
      if(cable.getNetwork().isWeakNode(nodebp))
      {
View Full Code Here

  }
 
  @Override
  public void onHitBlock(EntityPlayer owner, World world, int x, int y, int z, int side, double distance)
  {
    BlockPosition bp = new BlockPosition(x, y, z, ForgeDirection.getOrientation(side));
    bp.moveForwards(1);
    placeBlockAt(world, bp.x, bp.y, bp.z);
  }
View Full Code Here

        _selectedCircuit--;
        if(_selectedCircuit < 0)
        {
          _selectedCircuit = _logic.getCircuitCount() - 1;
        }
        MineFactoryReloadedClient.prcPages.put(new BlockPosition(_logic), _selectedCircuit);
        requestCircuit();
      }
    };
   
    _nextCircuit = new Button(this, 344, 76, 30, 30, "Next")
    {
      @Override
      public void onClick()
      {
        _selectedCircuit++;
        if(_selectedCircuit >= _logic.getCircuitCount())
        {
          _selectedCircuit = 0;
        }
        MineFactoryReloadedClient.prcPages.put(new BlockPosition(_logic), _selectedCircuit);
        requestCircuit();
      }
    };
   
    addControl(_prevCircuit);
    addControl(_nextCircuit);
   
    _reinit = new Button(this, 316, 228, 60, 20, "Reinitialize")
    {
      @Override
      public void onClick()
      {
        _reinitCountdown = 40;
      }
    };
   
    _reinitConfirm = new Button(this, 316, 228, 60, 20, "Confirm")
    {
      @Override
      public void onClick()
      {
        PacketDispatcher.sendPacketToServer(PacketWrapper.createPacket(MineFactoryReloadedCore.modNetworkChannel, Packets.LogicReinitialize,
            new Object[] { _logic.xCoord, _logic.yCoord, _logic.zCoord }));
        _reinitCountdown = 0;
      }
    };
   
    addControl(_reinit);
    addControl(_reinitConfirm);
   
    _reinitConfirm.setVisible(false);
   
    int rotation = logic.worldObj.getBlockMetadata(logic.xCoord, logic.yCoord, logic.zCoord);
   
    for(int i = 0; i < _inputIOPinButtons.length; i++)
    {
      _inputIOBufferButtons[i= new ButtonLogicBufferSelect(this,  22, 16 + i * 14, i, LogicButtonType.Input, rotation);
      _inputIOPinButtons[i]   = new ButtonLogicPinSelect(   this,  52, 16 + i * 14, i, LogicButtonType.Input);
     
      _outputIOBufferButtons[i] = new ButtonLogicBufferSelect(this, 254, 16 + i * 14, i, LogicButtonType.Output, rotation);
      _outputIOPinButtons[i= new ButtonLogicPinSelect(   this, 284, 16 + i * 14, i, LogicButtonType.Output);
     
      addControl(_inputIOBufferButtons[i]);
      addControl(_outputIOBufferButtons[i]);
      addControl(_inputIOPinButtons[i]);
      addControl(_outputIOPinButtons[i]);
    }
   
   
    Integer lastPage = MineFactoryReloadedClient.prcPages.get(new BlockPosition(_logic));
    if(lastPage != null && lastPage < _logic.getCircuitCount())
    {
      _selectedCircuit = lastPage;
    }
    requestCircuit();
View Full Code Here

TOP

Related Classes of powercrystals.core.position.BlockPosition

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.