Package logisticspipes.utils

Examples of logisticspipes.utils.SidedInventoryMinecraftAdapter


      WorldUtil wUtil = new WorldUtil(getWorld(), getX(), getY(), getZ());
      for (AdjacentTile tile : wUtil.getAdjacentTileEntities(true)){
        if(tile.tile instanceof IInventory) {
          IInventory inv = InventoryHelper.getInventory((IInventory) tile.tile);
          if(inv instanceof net.minecraft.inventory.ISidedInventory) {
            inv = new SidedInventoryMinecraftAdapter((net.minecraft.inventory.ISidedInventory)inv, tile.orientation.getOpposite(),false);
          }
          if(checkOneConnectedInv(inv,tile.orientation)) {
            updateContentListener();
            break;
          }
View Full Code Here


  }
 
  private IInventoryUtil getAdaptedInventoryUtil(AdjacentTile tile){
    IInventory base = (IInventory) tile.tile;
    if(base instanceof net.minecraft.inventory.ISidedInventory) {
      base = new SidedInventoryMinecraftAdapter((net.minecraft.inventory.ISidedInventory)base, tile.orientation.getOpposite(), true);
    }
    ExtractionMode mode = getExtractionMode();
    switch(mode){
      case LeaveFirst:
        return SimpleServiceLocator.inventoryUtilFactory.getHidingInventoryUtil(base, tile.orientation.getOpposite(), false, false, 1, 0);
View Full Code Here

    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);
      }
      IInventoryUtil inv =SimpleServiceLocator.inventoryUtilFactory.getInventoryUtil(base);
      count += inv.roomForItem(item, 9999);
    }
    if(includeInTransit) {
View Full Code Here

        boolean tookSome = false;
        if(arrivingItem.getAdditionalTargetInformation() instanceof ITargetSlotInformation) {

          ITargetSlotInformation information = (ITargetSlotInformation) arrivingItem.getAdditionalTargetInformation();
          IInventory inv = (IInventory)tile;
          if(inv instanceof ISidedInventory) inv = new SidedInventoryMinecraftAdapter((ISidedInventory)inv, ForgeDirection.UNKNOWN, false);
          IInventoryUtil util = SimpleServiceLocator.inventoryUtilFactory.getInventoryUtil(inv);
          if(util instanceof ISpecialInsertion) {
            int slot = information.getTargetSlot();
            int amount = information.getAmount();
            if(util.getSizeInventory() > slot) {
View Full Code Here

  
  @Override
  public IInventoryUtil getPointedInventory(ExtractionMode mode, boolean forExtraction) {
    IInventory inv = getRealInventory();
    if(inv == null) return null;
    if (inv instanceof net.minecraft.inventory.ISidedInventory) inv = new SidedInventoryMinecraftAdapter((net.minecraft.inventory.ISidedInventory) inv, this.getPointedOrientation().getOpposite(), forExtraction);
    switch(mode){
      case LeaveFirst:
        return SimpleServiceLocator.inventoryUtilFactory.getHidingInventoryUtil(inv, this.getPointedOrientation().getOpposite(), false, false, 1, 0);
      case LeaveLast:
        return SimpleServiceLocator.inventoryUtilFactory.getHidingInventoryUtil(inv, this.getPointedOrientation().getOpposite(), false, false, 0, 1);
View Full Code Here

  @Override
  public IInventoryUtil getSneakyInventory(ForgeDirection _sneakyOrientation, boolean forExtraction) {
    IInventory inv = getRealInventory();
    if(inv == null) return null;
    if (inv instanceof net.minecraft.inventory.ISidedInventory) inv = new SidedInventoryMinecraftAdapter((net.minecraft.inventory.ISidedInventory) inv, _sneakyOrientation, forExtraction);
    return SimpleServiceLocator.inventoryUtilFactory.getInventoryUtil(inv, _sneakyOrientation);
  }
View Full Code Here

    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);
      }
      IInventoryUtil inv = SimpleServiceLocator.inventoryUtilFactory.getInventoryUtil(base);
      count += inv.roomForItem(item, 9999);
    }
    if(includeInTransit) {
View Full Code Here

  private ItemStack extract(AdjacentTile tile, ItemIdentifier item, int amount) {
    if (tile.tile instanceof LogisticsCraftingTableTileEntity) {
      return extractFromLogisticsCraftingTable((LogisticsCraftingTableTileEntity)tile.tile, item, amount);
    } else if (tile.tile instanceof net.minecraft.inventory.ISidedInventory) {
      IInventory sidedadapter = new SidedInventoryMinecraftAdapter((net.minecraft.inventory.ISidedInventory) tile.tile, ForgeDirection.UNKNOWN, true);
      return extractFromIInventory(sidedadapter, item, amount);
    } else if (tile.tile instanceof IInventory) {
      return extractFromIInventory((IInventory)tile.tile, item, amount);
    }
    return null;
View Full Code Here

    return null;
  }

  private ItemStack extractFiltered(AdjacentTile tile, ItemIdentifierInventory inv, boolean isExcluded, int filterInvLimit) {
    if (tile.tile instanceof net.minecraft.inventory.ISidedInventory) {
      IInventory sidedadapter = new SidedInventoryMinecraftAdapter((net.minecraft.inventory.ISidedInventory) tile.tile, ForgeDirection.UNKNOWN, true);
      return extractFromIInventoryFiltered(sidedadapter, inv, isExcluded, filterInvLimit);
    } else if (tile.tile instanceof IInventory) {
      return extractFromIInventoryFiltered((IInventory)tile.tile, inv, isExcluded, filterInvLimit);
    }
    return null;
View Full Code Here

 
  @Override
  @SuppressWarnings("unchecked")
  public void processPacket(EntityPlayer player) {
    IInventory inv = this.getTile(player.worldObj, IInventory.class);
    if (inv instanceof ISidedInventory) inv = new SidedInventoryMinecraftAdapter((ISidedInventory) inv, ForgeDirection.UNKNOWN, false);
    IInventoryUtil util = SimpleServiceLocator.inventoryUtilFactory.getInventoryUtil(inv);Slot result = null;
    if(((List<Slot>)player.openContainer.inventorySlots).get(inventorySlot).slotNumber == inventorySlot) {
      result = ((List<Slot>)player.openContainer.inventorySlots).get(inventorySlot);
    }
    if(result == null) {
View Full Code Here

TOP

Related Classes of logisticspipes.utils.SidedInventoryMinecraftAdapter

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.