Examples of BlockPosition


Examples of powercrystals.core.position.BlockPosition

        _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

Examples of powercrystals.core.position.BlockPosition

    _powerProvider.configure(0, 0, 0, 0, 0);
  }
 
  protected final int producePower(int mj)
  {
    BlockPosition ourbp = BlockPosition.fromFactoryTile(this);
   
    for(BlockPosition bp : ourbp.getAdjacent(true))
    {
      TileEntity te = worldObj.getBlockTileEntity(bp.x, bp.y, bp.z);
      if(te == null || !(te instanceof IPowerReceptor))
      {
        continue;
View Full Code Here

Examples of powercrystals.core.position.BlockPosition

    return new IconOverlay(BlockFactoryGlass._texture, 8, 8, 0, 0);
  }

  public Icon getBlockOverlayTexture(IBlockAccess world, int x, int y, int z, int side)
  {
    BlockPosition bp = new BlockPosition(x, y, z, ForgeDirection.VALID_DIRECTIONS[side]);
    boolean[] sides = new boolean[8];
    bp.moveRight(1);
    sides[0] = world.getBlockId(bp.x,bp.y,bp.z) == blockID;
    bp.moveDown(1);
    sides[4] = world.getBlockId(bp.x,bp.y,bp.z) == blockID;
    bp.moveLeft(1);
    sides[1] = world.getBlockId(bp.x,bp.y,bp.z) == blockID;
    bp.moveLeft(1);
    sides[5] = world.getBlockId(bp.x,bp.y,bp.z) == blockID;
    bp.moveUp(1);
    sides[3] = world.getBlockId(bp.x,bp.y,bp.z) == blockID;
    bp.moveUp(1);
    sides[6] = world.getBlockId(bp.x,bp.y,bp.z) == blockID;
    bp.moveRight(1);
    sides[2] = world.getBlockId(bp.x,bp.y,bp.z) == blockID;
    bp.moveRight(1);
    sides[7] = world.getBlockId(bp.x,bp.y,bp.z) == blockID;
    return new IconOverlay(BlockFactoryGlass._texture, 8, 8, sides);
  }
View Full Code Here

Examples of powercrystals.core.position.BlockPosition

    return new IconOverlay(_texture, 8, 8, 0, 0);
  }

  public Icon getBlockOverlayTexture(IBlockAccess world, int x, int y, int z, int side)
  {
    BlockPosition bp;
    boolean[] sides = new boolean[8];
    if (side <= 1)
    {
      bp = new BlockPosition(x, y, z, ForgeDirection.NORTH);
      bp.moveRight(1);
      sides[0] = world.getBlockId(bp.x,bp.y,bp.z) == blockID;
      bp.moveBackwards(1);
      sides[4] = world.getBlockId(bp.x,bp.y,bp.z) == blockID;
      bp.moveLeft(1);
      sides[1] = world.getBlockId(bp.x,bp.y,bp.z) == blockID;
      bp.moveLeft(1);
      sides[5] = world.getBlockId(bp.x,bp.y,bp.z) == blockID;
      bp.moveForwards(1);
      sides[3] = world.getBlockId(bp.x,bp.y,bp.z) == blockID;
      bp.moveForwards(1);
      sides[6] = world.getBlockId(bp.x,bp.y,bp.z) == blockID;
      bp.moveRight(1);
      sides[2] = world.getBlockId(bp.x,bp.y,bp.z) == blockID;
      bp.moveRight(1);
      sides[7] = world.getBlockId(bp.x,bp.y,bp.z) == blockID;
    }
    else
    {
      bp = new BlockPosition(x, y, z, ForgeDirection.VALID_DIRECTIONS[side]);
      bp.moveRight(1);
      sides[0] = world.getBlockId(bp.x,bp.y,bp.z) == blockID;
      bp.moveDown(1);
      sides[4] = world.getBlockId(bp.x,bp.y,bp.z) == blockID;
      bp.moveLeft(1);
      sides[1] = world.getBlockId(bp.x,bp.y,bp.z) == blockID;
      bp.moveLeft(1);
      sides[5] = world.getBlockId(bp.x,bp.y,bp.z) == blockID;
      bp.moveUp(1);
      sides[3] = world.getBlockId(bp.x,bp.y,bp.z) == blockID;
      bp.moveUp(1);
      sides[6] = world.getBlockId(bp.x,bp.y,bp.z) == blockID;
      bp.moveRight(1);
      sides[2] = world.getBlockId(bp.x,bp.y,bp.z) == blockID;
      bp.moveRight(1);
      sides[7] = world.getBlockId(bp.x,bp.y,bp.z) == blockID;
    }
    return new IconOverlay(_texture, 8, 8, sides);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.