Package logisticspipes.interfaces

Examples of logisticspipes.interfaces.ISlotCheck


    DummyContainer dummy = new DummyContainer(player, null, pipe.getUpgradeManager().getGuiController());
    dummy.addNormalSlotsForPlayerInventory(10, 135);
   
    // TAB_1 SLOTS
    for(int pipeSlot = 0; pipeSlot < 9; pipeSlot++) {
      TAB_SLOTS_1_1.add(dummy.addRestrictedSlot(pipeSlot, pipe.getUpgradeManager().getInv(), 10 + pipeSlot * 18, 42, new ISlotCheck() {
        @Override
        public boolean isStackAllowed(ItemStack itemStack) {
          if(itemStack == null) return false;
          if(itemStack.getItem() == LogisticsPipes.UpgradeItem) {
            if(!LogisticsPipes.UpgradeItem.getUpgradeForItem(itemStack, null).isAllowed(pipe)) return false;
          } else {
            return false;
          }
          return true;
        }
      }));
    }
   
    for(int pipeSlot = 0; pipeSlot < 9; pipeSlot++) {
      TAB_SLOTS_1_2.add(dummy.addRestrictedSlot(pipeSlot, pipe.getUpgradeManager().getSneakyInv(), 10 + pipeSlot * 18, 78, new ISlotCheck() {
        @Override
        public boolean isStackAllowed(ItemStack itemStack) {
          if(itemStack == null) return false;
          if(itemStack.getItem() == LogisticsPipes.UpgradeItem) {
            IPipeUpgrade upgrade = LogisticsPipes.UpgradeItem.getUpgradeForItem(itemStack, null);
            if(!(upgrade instanceof SneakyUpgrade)) return false;
            if(!upgrade.isAllowed(pipe)) return false;
          } else {
            return false;
          }
          return true;
        }
      }));
    }
   
    // TAB_2 SLOTS
    TAB_SLOTS_2.add(dummy.addStaticRestrictedSlot(0, pipe.getUpgradeManager().getSecInv(), 10, 42, new ISlotCheck() {
      @Override
      public boolean isStackAllowed(ItemStack itemStack) {
        if(itemStack == null) return false;
        if(itemStack.getItem() != LogisticsPipes.LogisticsItemCard) return false;
        if(itemStack.getItemDamage() != LogisticsItemCard.SEC_CARD) return false;
View Full Code Here


public class GuiFreqCardContent extends LogisticsBaseGuiScreen {

  public GuiFreqCardContent(EntityPlayer player, IInventory card) {
    super(180, 130, 0, 0);
    DummyContainer dummy = new DummyContainer(player.inventory, card);
    dummy.addRestrictedSlot(0, card, 82, 15, new ISlotCheck() {
      @Override
      public boolean isStackAllowed(ItemStack itemStack) {
        if(itemStack == null) return false;
        if(itemStack.getItem() != LogisticsPipes.LogisticsItemCard) return false;
        if(itemStack.getItemDamage() != LogisticsItemCard.FREQ_CARD) return false;
View Full Code Here

 
  public GuiInvSysConnector(EntityPlayer player, PipeItemsInvSysConnector pipe) {
    super(180,200,0,0);
    DummyContainer dummy = new DummyContainer(player.inventory, pipe.inv);
   
    dummy.addRestrictedSlot(0, pipe.inv, 98, 17, new ISlotCheck() {
      @Override
      public boolean isStackAllowed(ItemStack itemStack) {
        if(itemStack == null) return false;
        if(itemStack.getItem() != LogisticsPipes.LogisticsItemCard) return false;
        if(itemStack.getItemDamage() != LogisticsItemCard.FREQ_CARD) return false;
View Full Code Here

        Cinv.close(player, (int)player.posX, (int)player.posY, (int)player.posZ);
      }
    });
    dummy.addRestrictedSlot(0, Cinv, 21, 21, LogisticsPipes.ModuleItem);
    dummy.addRestrictedSlot(1, Cinv, 61, 21, LogisticsPipes.ModuleItem);
    dummy.addRestrictedSlot(2, Cinv, 41, 58, new ISlotCheck() {
      @Override public boolean isStackAllowed(ItemStack itemStack) {return false;}
    });
    dummy.addRestrictedSlot(3, Cinv, 121, 39, LogisticsPipes.LogisticsItemCard);
    for(int i=4;i<7;i++) {
      dummy.addColorSlot(i, Cinv, 101, 21 + (i - 4) * 18);
 
View Full Code Here

       
      case GuiIDs.GUI_Inv_Sys_Connector_ID:
        if(pipe == null || pipe.pipe == null || !(pipe.pipe instanceof PipeItemsInvSysConnector)) return null;
        dummy = new DummyContainer(player.inventory, ((PipeItemsInvSysConnector)pipe.pipe).inv);
       
        dummy.addRestrictedSlot(0, ((PipeItemsInvSysConnector)pipe.pipe).inv, 50, 10, new ISlotCheck() {
          @Override
          public boolean isStackAllowed(ItemStack itemStack) {
            if(itemStack == null) return false;
            if(itemStack.getItem() != LogisticsPipes.LogisticsItemCard) return false;
            if(itemStack.getItemDamage() != LogisticsItemCard.FREQ_CARD) return false;
            return true;
          }
        });
       
        dummy.addNormalSlotsForPlayerInventory(0, 50);
       
        MainProxy.sendPacketToPlayer(PacketHandler.getPacket(InvSysConResistance.class).setInteger(((PipeItemsInvSysConnector)pipe.pipe).resistance).setPosX(pipe.xCoord).setPosY(pipe.yCoord).setPosZ(pipe.zCoord), player);
       
        return dummy;
     
      case GuiIDs.GUI_Freq_Card_ID:
        if(pipe == null || pipe.pipe == null || !((pipe.pipe instanceof PipeItemsSystemEntranceLogistics) || (pipe.pipe instanceof PipeItemsSystemDestinationLogistics))) return null;
        IInventory inv = null;
        if(pipe.pipe instanceof PipeItemsSystemEntranceLogistics) {
          inv = ((PipeItemsSystemEntranceLogistics)pipe.pipe).inv;
        } else if(pipe.pipe instanceof PipeItemsSystemDestinationLogistics) {
          inv = ((PipeItemsSystemDestinationLogistics)pipe.pipe).inv;
        }
       
        dummy = new DummyContainer(player.inventory, inv);
       
        dummy.addRestrictedSlot(0, inv, 40, 40, new ISlotCheck() {
          @Override
          public boolean isStackAllowed(ItemStack itemStack) {
            if(itemStack == null) return false;
            if(itemStack.getItem() != LogisticsPipes.LogisticsItemCard) return false;
            if(itemStack.getItemDamage() != LogisticsItemCard.FREQ_CARD) return false;
View Full Code Here

    DummyContainer dummy = new DummyContainer(player, inv, getGuiController());
    dummy.addNormalSlotsForPlayerInventory(8, isCombinedSneakyUpgrade ? 90 : 60);

    //Pipe slots
      for(int pipeSlot = 0; pipeSlot < 8; pipeSlot++){
        dummy.addRestrictedSlot(pipeSlot, inv, 8 + pipeSlot * 18, 18, new ISlotCheck() {
        @Override
        public boolean isStackAllowed(ItemStack itemStack) {
          if(itemStack == null) return false;
          if(itemStack.getItem() == LogisticsPipes.UpgradeItem) {
            if(!LogisticsPipes.UpgradeItem.getUpgradeForItem(itemStack, null).isAllowed(pipe)) return false;
          } else {
            return false;
          }
          return true;
        }
        });
      }
      //Static slot for Security Cards
      dummy.addStaticRestrictedSlot(0, secInv, 8 + 8 * 18, 18, new ISlotCheck() {
      @Override
      public boolean isStackAllowed(ItemStack itemStack) {
        if(itemStack == null) return false;
        if(itemStack.getItem() != LogisticsPipes.LogisticsItemCard) return false;
        if(itemStack.getItemDamage() != LogisticsItemCard.SEC_CARD) return false;
        if(!SimpleServiceLocator.securityStationManager.isAuthorized(UUID.fromString(itemStack.getTagCompound().getString("UUID")))) return false;
        return true;
      }
      }, 1);
     
    int y = isCombinedSneakyUpgrade ? 58 : 100000;
    for(int pipeSlot = 0; pipeSlot < 9; pipeSlot++){
        dummy.addRestrictedSlot(pipeSlot, sneakyInv, 8 + pipeSlot * 18, y, new ISlotCheck() {
        @Override
        public boolean isStackAllowed(ItemStack itemStack) {
          if(itemStack == null) return false;
          if(itemStack.getItem() == LogisticsPipes.UpgradeItem) {
            IPipeUpgrade upgrade = LogisticsPipes.UpgradeItem.getUpgradeForItem(itemStack, null);
View Full Code Here

    if(tile == null) return null;
    DummyContainer dummy = new DummyContainer(player, tile, tile);
    for (int i = 0; i < 3; i++) {
      for (int j = 0; j < 3; j++) {
        final int slotNumber = i * 3 + j;
        dummy.addRestrictedSlot(slotNumber,tile, 44 + (j * 18), 17 + (i * 18), new ISlotCheck() {
          @Override
          public boolean isStackAllowed(ItemStack itemStack) {
            return tile.checkSlot(itemStack, slotNumber);
          }
        });
      }
    }
    dummy.addRestrictedSlot(9, tile, 107, 17, Items.iron_ingot);
    dummy.addRestrictedSlot(10, tile, 141, 47, (Item)null);
    dummy.addRestrictedSlot(11, tile, 9, 9, new ISlotCheck() {
      @Override
      public boolean isStackAllowed(ItemStack itemStack) {
        return tile.getRecipeForTaget(itemStack) != null && tile.areStacksEmpty();
      }
    });
View Full Code Here

      }
    });
    for(int i=0;i<2;i++) {
      dummy.addRestrictedSlot(i, Cinv, 0, 0, LogisticsPipes.ModuleItem);
    }
    dummy.addRestrictedSlot(2, Cinv, 0, 0, new ISlotCheck() {
      @Override public boolean isStackAllowed(ItemStack itemStack) {return false;}
    });
    dummy.addRestrictedSlot(3, Cinv, 0, 0, LogisticsPipes.LogisticsItemCard);
    for(int i=4;i<10;i++) {
      dummy.addColorSlot(i, Cinv, 0, 0);
View Full Code Here

      }
    });
    dummy.addNormalSlotsForPlayerInventory(0, 0);
    // TAB_1 SLOTS
    for(int pipeSlot = 0; pipeSlot < 9; pipeSlot++) {
        dummy.addRestrictedSlot(pipeSlot, pipe.getUpgradeManager().getInv(), 8 + pipeSlot * 18, 18, new ISlotCheck() {
        @Override
        public boolean isStackAllowed(ItemStack itemStack) {
          if(itemStack == null) return false;
          if(itemStack.getItem() == LogisticsPipes.UpgradeItem) {
            if(!LogisticsPipes.UpgradeItem.getUpgradeForItem(itemStack, null).isAllowed(pipe)) return false;
          } else {
            return false;
          }
          return true;
        }
        });
      }
    for(int pipeSlot = 0; pipeSlot < 9; pipeSlot++) {
        dummy.addRestrictedSlot(pipeSlot, pipe.getUpgradeManager().getSneakyInv(), 8 + pipeSlot * 18, 48, new ISlotCheck() {
        @Override
        public boolean isStackAllowed(ItemStack itemStack) {
          if(itemStack == null) return false;
          if(itemStack.getItem() == LogisticsPipes.UpgradeItem) {
            IPipeUpgrade upgrade = LogisticsPipes.UpgradeItem.getUpgradeForItem(itemStack, null);
            if(!(upgrade instanceof SneakyUpgrade)) return false;
            if(!upgrade.isAllowed(pipe)) return false;
          } else {
            return false;
          }
          return true;
        }
        });
      }
    // TAB_2 SLOTS
      dummy.addStaticRestrictedSlot(0, pipe.getUpgradeManager().getSecInv(), 8 + 8 * 18, 18, new ISlotCheck() {
      @Override
      public boolean isStackAllowed(ItemStack itemStack) {
        if(itemStack == null) return false;
        if(itemStack.getItem() != LogisticsPipes.LogisticsItemCard) return false;
        if(itemStack.getItemDamage() != LogisticsItemCard.SEC_CARD) return false;
View Full Code Here

TOP

Related Classes of logisticspipes.interfaces.ISlotCheck

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.