Package crazypants.util

Examples of crazypants.util.BlockCoord


            if(isNonMultiReservoir(dir.offsetX + neighbor.offsetX, dir.offsetY + neighbor.offsetY, dir.offsetZ + neighbor.offsetZ)) {
              BlockCoord[] mb = new BlockCoord[4];
              mb[0] = inDirection(dir);
              mb[1] = inDirection(neighbor);
              mb[2] = inDirection(dir.offsetX + neighbor.offsetX, dir.offsetY + neighbor.offsetY, dir.offsetZ + neighbor.offsetZ);
              mb[3] = new BlockCoord(xCoord, yCoord, zCoord);
              for (BlockCoord bc : mb) {
                TileReservoir res = getReservoir(bc);
                res.setMultiblock(mb);
              }
              return true;
View Full Code Here


    }
    return false;
  }

  private BlockCoord inDirection(int offsetX, int offsetY, int offsetZ) {
    return new BlockCoord(xCoord + offsetX, yCoord + offsetY, zCoord + offsetZ);
  }
View Full Code Here

  public Vector3f getOffsetFromController() {
    if(!isMultiblock()) {
      return new Vector3f();
    }
    BlockCoord masterBC = multiblock[0];
    BlockCoord myBC = new BlockCoord(xCoord, yCoord, zCoord);
    return new Vector3f(masterBC.x - myBC.x, masterBC.y - myBC.y, masterBC.z - myBC.z);
  }
View Full Code Here

  }

  @Override
  protected boolean doPull(ForgeDirection dir) {
    boolean res = super.doPull(dir);
    BlockCoord loc = getLocation().getLocation(dir);
    IFluidHandler target = FluidUtil.getFluidHandler(worldObj, loc);
    if(target != null) {
      FluidTankInfo[] infos = target.getTankInfo(dir.getOpposite());
      if(infos != null) {
        for (FluidTankInfo info : infos) {
View Full Code Here

  private boolean transmitEnergy() {
    if(getEnergyStored() <= 0) {
      return false;
    }
    if(powerDis == null) {
      powerDis = new PowerDistributor(new BlockCoord(this));
    }
    int transmitted = powerDis.transmitEnergy(worldObj, Math.min(outputPerTick * 2, getEnergyStored()));
    setEnergyStored(getEnergyStored() - transmitted);   
    return transmitted > 0;
  }
View Full Code Here

  }

  public boolean isClear() {
    World worldObj = transciever.getWorldObj();

    BlockCoord railCoord = new BlockCoord(transciever).getLocation(ForgeDirection.UP);
    int meta = worldObj.getBlockMetadata(railCoord.x, railCoord.y, railCoord.z);

    double buf = 1;
    ForgeDirection dir = BlockEnderRail.getDirection(meta);
    Vector3d offset = ForgeDirectionOffsets.forDirCopy(dir);
View Full Code Here

    return res;
  }

  @Override
  public BlockCoord getLocation() {
    return new BlockCoord(this);
  }
View Full Code Here

  public BlockCoord getLocation() {
    return new BlockCoord(this);
  }

  private IPowerInterface getReceptorForFace(ForgeDirection faceHit) {
    BlockCoord checkLoc = new BlockCoord(this).getLocation(faceHit);
    TileEntity te = worldObj.getTileEntity(checkLoc.x, checkLoc.y, checkLoc.z);
    if(!(te instanceof TileCapacitorBank)) {
      return PowerHandlerUtil.create(te);
    }
    return null;
View Full Code Here

  }

  public List<GaugeBounds> getGaugeBounds() {
    if(gaugeBounds == null) {
      gaugeBounds = GaugeBounds.calculateGaugeBounds(new BlockCoord(this), multiblock);
    }
    return gaugeBounds;
  }
View Full Code Here

    }
    if(localReceptors != null) {
      localReceptors.clear();
    }

    BlockCoord bc = new BlockCoord(this);
    for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
      IoMode mode = getIoMode(dir);
      if(mode != IoMode.DISABLED) {
        BlockCoord checkLoc = bc.getLocation(dir);
        TileEntity te = worldObj.getTileEntity(checkLoc.x, checkLoc.y, checkLoc.z);
        if(!(te instanceof TileCapacitorBank)) {
          IPowerInterface ph = PowerHandlerUtil.create(te);
          if(ph != null && ph.canConduitConnect(dir)) {
            if(localReceptors == null) {
View Full Code Here

TOP

Related Classes of crazypants.util.BlockCoord

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.