Package logisticspipes.utils

Examples of logisticspipes.utils.WorldUtil


    return new SinkReply(_sinkReply, spaceFor(item, includeInTransit));
  }

  private int spaceFor(ItemIdentifier item, boolean includeInTransit) {
    int count=0;
    WorldUtil wUtil = new WorldUtil(pipe.getWorld(),pipe.getX(),pipe.getY(),pipe.getZ());
    for (AdjacentTile tile : wUtil.getAdjacentTileEntities(true)){
      if (!(tile.tile instanceof IInventory)) continue;
      IInventory base = (IInventory) tile.tile;
      if (base instanceof net.minecraft.inventory.ISidedInventory) {
        base = new SidedInventoryMinecraftAdapter((net.minecraft.inventory.ISidedInventory) base, tile.orientation.getOpposite(),false);
      }
View Full Code Here


    }
    return super.getNonRoutedTexture(connection);
  }
 
  private boolean isFluidSidedTexture(ForgeDirection connection) {
    WorldUtil util = new WorldUtil(getWorld(), getX(), getY(), getZ());
    TileEntity tile = util.getAdjacentTileEntitie(connection);
    if (tile instanceof IFluidHandler) {
      IFluidHandler liq = (IFluidHandler) tile;

      if (liq.getTankInfo(connection.getOpposite()) != null && liq.getTankInfo(connection.getOpposite()).length > 0)
        return true;
View Full Code Here

    }
    return null;
  }

  public TileEntity getPointedTileEntity() {
    WorldUtil wUtil = new WorldUtil(getWorld(), getX(), getY(), getZ());
    for (AdjacentTile tile : wUtil.getAdjacentTileEntities(true)){
      if(tile.tile != null) {
        if(SimpleServiceLocator.forestryProxy.isTileAnalyser(tile.tile)) {
          return tile.tile;
        }
      }
View Full Code Here

 
  protected List<IInventory> getConnectedRawInventories()  {
    if(_cachedAdjacentInventories != null) {
      return _cachedAdjacentInventories;
    }
    WorldUtil worldUtil = new WorldUtil(this.getWorld(), this.getX(), this.getY(), this.getZ());
    LinkedList<IInventory> adjacent = new LinkedList<IInventory>();
    for (AdjacentTile tile : worldUtil.getAdjacentTileEntities(true)){
      if (!(tile.tile instanceof IInventory)) continue;
      adjacent.add(InventoryHelper.getInventory((IInventory)tile.tile));
    }
    _cachedAdjacentInventories=adjacent;
    return _cachedAdjacentInventories;
View Full Code Here

 
  /***  --  IAdjacentWorldAccess  --  ***/
 
  @Override
  public LinkedList<AdjacentTile> getConnectedEntities() {
    WorldUtil world = new WorldUtil(this.getWorld(), this.getX(), this.getY(), this.getZ());
    LinkedList<AdjacentTile> adjacent = world.getAdjacentTileEntities(true);
   
    Iterator<AdjacentTile> iterator = adjacent.iterator();
    while (iterator.hasNext()){
      AdjacentTile tile = iterator.next();
      if (!MainProxy.checkPipesConnections(this.container, tile.tile, tile.orientation)){
View Full Code Here

  public LPPosition getLPPosition() {
    return new LPPosition(this);
  }

  public WorldUtil getWorldUtil() {
    return new WorldUtil(this.getWorld(), this.getX(), this.getY(), this.getZ());
  }
View Full Code Here

    return new SinkReply(_sinkReply, spaceFor(item, includeInTransit));
  }

  protected int spaceFor(ItemIdentifier item, boolean includeInTransit) {
    int count = 0;
    WorldUtil wUtil = new WorldUtil(getWorld(), _service.getX(), _service.getY(), _service.getZ());
    for(AdjacentTile tile: wUtil.getAdjacentTileEntities(true)) {
      if(!(tile.tile instanceof IInventory)) continue;
      IInventory base = (IInventory)tile.tile;
      if(base instanceof net.minecraft.inventory.ISidedInventory) {
        base = new SidedInventoryMinecraftAdapter((net.minecraft.inventory.ISidedInventory)base, tile.orientation.getOpposite(), false);
      }
View Full Code Here

      // Send packet asking for import
      final CoordinatesPacket packet = PacketHandler.getPacket(CPipeSatelliteImport.class).setModulePos(this);
      MainProxy.sendPacketToServer(packet);
    } else {
      boolean fuzzyFlagsChanged = false;
      final WorldUtil worldUtil = new WorldUtil(getWorld(), getX(), getY(), getZ());
      for(final AdjacentTile tile: worldUtil.getAdjacentTileEntities(true)) {
        for(ICraftingRecipeProvider provider: SimpleServiceLocator.craftingRecipeProviders) {
          if(provider.importRecipe(tile.tile, _dummyInventory)) {
            if(provider instanceof IFuzzyRecipeProvider) {
              fuzzyFlagsChanged = ((IFuzzyRecipeProvider)provider).importFuzzyFlags(tile.tile, _dummyInventory, fuzzyCraftingFlagArray);
            }
View Full Code Here

    // give up and select whatever is right of the current slot
    if(!foundSlot) {
      player.inventory.currentItem = (player.inventory.currentItem + 1) % 9;
    }
   
    final WorldUtil worldUtil = new WorldUtil(getWorld(), getX(), getY(), getZ());
    boolean found = false;
    for(final AdjacentTile tile: worldUtil.getAdjacentTileEntities(true)) {
      for(ICraftingRecipeProvider provider: SimpleServiceLocator.craftingRecipeProviders) {
        if(provider.canOpenGui(tile.tile)) {
          found = true;
          break;
        }
View Full Code Here

 
  private List<AdjacentTile> _cachedCrafters = null;
  public List<AdjacentTile> locateCrafters()  {
    if(_cachedCrafters !=null)
      return _cachedCrafters;
    WorldUtil worldUtil = new WorldUtil(this.getWorld(), this.getX(), this.getY(), this.getZ());
    LinkedList<AdjacentTile> crafters = new LinkedList<AdjacentTile>();
    for (AdjacentTile tile : worldUtil.getAdjacentTileEntities(true)){
      if (!(tile.tile instanceof IInventory)) continue;
      crafters.add(tile);
    }
    _cachedCrafters=crafters;
    return _cachedCrafters;
View Full Code Here

TOP

Related Classes of logisticspipes.utils.WorldUtil

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.