Package logisticspipes.utils.gui

Examples of logisticspipes.utils.gui.DummyContainer


  private final ModuleFluidSupplier _liquidSupplier;
 
  public GuiFluidSupplier(IInventory playerInventory, ModuleFluidSupplier module) {
    super(null, module);
    _liquidSupplier = module;
    DummyContainer dummy = new DummyContainer(playerInventory, _liquidSupplier.getFilterInventory());
    dummy.addNormalSlotsForPlayerInventory(8, 60);

    //Pipe slots
      for(int pipeSlot = 0; pipeSlot < 9; pipeSlot++){
        dummy.addDummySlot(pipeSlot, 8 + pipeSlot * 18, 18);
      }
     
      this.inventorySlots = dummy;
    xSize = 175;
    ySize = 142;
View Full Code Here


public class GuiApiaristSink extends ModuleBaseGui {

  private final ModuleApiaristSink module;
 
  public GuiApiaristSink(ModuleApiaristSink module, EntityPlayer player) {
    super(new DummyContainer(player.inventory,null), module);
    this.module = module;
    for(int i=0; i < 6; i++) {
      SinkSetting filter = module.filter[i];
      this.addRenderSlot(new TypeSlot(20, 20 + (i*18), filter, i));
      this.addRenderSlot(new GroupSlot(guiLeft + 45, guiTop + 25 + (i*18), filter, i));
View Full Code Here

      dimension = dim;
    } else {
      dimension = dimensioncache;
    }
    _entityPlayer = entityPlayer;
    this.inventorySlots = new DummyContainer(entityPlayer.inventory, null);
  }
View Full Code Here

 
  public GuiSupplierPipe(IInventory playerInventory, IInventory dummyInventory, ModuleActiveSupplier module, Boolean flag, int[] slots) {
    super(null);
    hasPatternUpgrade = flag;
   
    DummyContainer dummy = new DummyContainer(playerInventory, dummyInventory);
    dummy.addNormalSlotsForPlayerInventory(18, 97);
   
    if(hasPatternUpgrade) {
      for(int i = 0; i < 9;i++) {
        dummy.addDummySlot(i, 18 + i * 18, 20);
      }
    } else {
      int xOffset = 72;
      int yOffset = 18;
      for (int row = 0; row < 3; row++){
        for (int column = 0; column < 3; column++){
          dummy.addDummySlot(column + row * 3, xOffset + column * 18, yOffset + row * 18);         
        }
      }
    }
    this.inventorySlots = dummy;
    module.slotArray = slots;
View Full Code Here

  private final LogisticsPowerProviderTileEntity junction;
 
  public GuiPowerProvider(EntityPlayer player, LogisticsPowerProviderTileEntity junction) {
    super(176, 166, 0, 0);
    DummyContainer dummy = new DummyContainer(player, null, junction);
    dummy.addNormalSlotsForPlayerInventory(8, 80);
    this.inventorySlots = dummy;
    this.junction = junction;
  }
View Full Code Here

      if(upgrade.hasCombinedSneakyUpgrade()) {
        ySize = BIG_SIZE;
      } else {
        ySize = SMALL_SIZE;
      }
      DummyContainer newSlots = upgrade.getDummyContainer(player);
      for(int i=0;i<newSlots.inventorySlots.size();i++) {
        Slot oldSlot = (Slot) this.inventorySlots.inventorySlots.get(i);
        Slot newSlot = (Slot) newSlots.inventorySlots.get(i);
        oldSlot.xDisplayPosition = newSlot.xDisplayPosition;
        oldSlot.yDisplayPosition = newSlot.yDisplayPosition;
View Full Code Here

  }

  public GuiElectricManager(IInventory playerInventory, ModuleElectricManager module) {
    super(null, module);
    _module = module;
    DummyContainer dummy = new DummyContainer(playerInventory, _module.getFilterInventory());
    dummy.addNormalSlotsForPlayerInventory(8, 60);

    //Pipe slots
    for(int pipeSlot = 0; pipeSlot < 9; pipeSlot++){
      dummy.addDummySlot(pipeSlot, 8 + pipeSlot * 18, 18);
    }
    this.inventorySlots = dummy;
    xSize = 175;
    ySize = 142;
  }
View Full Code Here

public class GuiCardManager extends LogisticsBaseGuiScreen {

  public GuiCardManager(EntityPlayer player) {
    super(180, 180, 0, 0);
    final CardManagmentInventory Cinv = new CardManagmentInventory();
    DummyContainer dummy = new DummyContainer(player, Cinv, new IGuiOpenControler() {
      @Override public void guiOpenedByPlayer(EntityPlayer player) {}
      @Override
      public void guiClosedByPlayer(EntityPlayer player) {
        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);
    }
    for(int i=7;i<10;i++) {
      dummy.addColorSlot(i, Cinv, 141, 21 + (i - 7) * 18);
    }
    dummy.addNormalSlotsForPlayerInventory(10, 95);
    this.inventorySlots = dummy;
  }
View Full Code Here

    if(tile instanceof LogisticsTileGenericPipe) {
      pipe = (LogisticsTileGenericPipe)tile;
    }
    final LogisticsTileGenericPipe fpipe = pipe;
   
    DummyContainer dummy;
    int xOffset;
    int yOffset;
   
    if(ID > 10000) {
      ID -= 10000;
    }
   
    //Handle Module Configuration
    if(ID == -1) {
      return getServerGuiElement(100 * -20 + x, player, world, 0, -1, z);
    }
   
    if(ID < 110 && ID > 0) {
      switch(ID) {

      case GuiIDs.GUI_FluidSupplier_ID:
        if(pipe == null || pipe.pipe == null || !(pipe.pipe instanceof PipeItemsFluidSupplier)) return null;
        dummy = new DummyContainer(player.inventory, ((PipeItemsFluidSupplier)pipe.pipe).getDummyInventory());
        dummy.addNormalSlotsForPlayerInventory(18, 97);
       
        xOffset = 72;
        yOffset = 18;
       
        for (int row = 0; row < 3; row++){
          for (int column = 0; column < 3; column++){
            dummy.addDummySlot(column + row * 3, xOffset + column * 18, yOffset + row * 18);         
          }
        }
       
        MainProxy.sendPacketToPlayer(PacketHandler.getPacket(FluidSupplierMode.class).setInteger((((PipeItemsFluidSupplier)pipe.pipe).isRequestingPartials() ? 1 : 0)).setPosX(pipe.xCoord).setPosY(pipe.yCoord).setPosZ(pipe.zCoord), player);
          return dummy;

      case GuiIDs.GUI_FluidSupplier_MK2_ID:
        if(pipe == null || pipe.pipe == null || !(pipe.pipe instanceof PipeFluidSupplierMk2)) return null;
        dummy = new DummyContainer(player.inventory, ((PipeFluidSupplierMk2)pipe.pipe).getDummyInventory());
        dummy.addNormalSlotsForPlayerInventory(18, 97);
        dummy.addFluidSlot(0, ((PipeFluidSupplierMk2)pipe.pipe).getDummyInventory(), 0, 0);
       
        MainProxy.sendPacketToPlayer(PacketHandler.getPacket(FluidSupplierMode.class).setInteger((((PipeFluidSupplierMk2)pipe.pipe).isRequestingPartials() ? 1 : 0)).setPosX(pipe.xCoord).setPosY(pipe.yCoord).setPosZ(pipe.zCoord), player);
        MainProxy.sendPacketToPlayer(PacketHandler.getPacket(FluidSupplierMinMode.class).setInteger(((PipeFluidSupplierMk2)pipe.pipe).getMinMode().ordinal()).setPosX(pipe.xCoord).setPosY(pipe.yCoord).setPosZ(pipe.zCoord), player);
          return dummy;
       
      case GuiIDs.GUI_ProviderPipe_ID:
        if(pipe == null || pipe.pipe == null || !(pipe.pipe instanceof PipeItemsProviderLogistics)) return null;
        dummy = new DummyContainer(player.inventory, ((PipeItemsProviderLogistics)pipe.pipe).getprovidingInventory());
        dummy.addNormalSlotsForPlayerInventory(18, 97);
       
        xOffset = 72;
        yOffset = 18;
       
        for (int row = 0; row < 3; row++){
          for (int column = 0; column < 3; column++){
            dummy.addDummySlot(column + row * 3, xOffset + column * 18, yOffset + row * 18);         
          }
        }
        return dummy;
       
      case GuiIDs.GUI_SatelitePipe_ID:
        if(pipe != null && pipe.pipe != null && pipe.pipe instanceof PipeItemsSatelliteLogistics) {
          return new DummyContainer(player.inventory, null);
        }
        if(pipe != null && pipe.pipe != null && pipe.pipe instanceof PipeFluidSatellite) {
          return new DummyContainer(player.inventory, null);
        }
       
      case GuiIDs.GUI_Normal_Orderer_ID:
        if(pipe == null || pipe.pipe == null || !(pipe.pipe instanceof CoreRoutedPipe)) return null;
        return new DummyContainer(player.inventory, null);

      case GuiIDs.GUI_Normal_Mk2_Orderer_ID:
        if(pipe == null || pipe.pipe == null || !(pipe.pipe instanceof PipeItemsRequestLogisticsMk2)) return null;
        return new DummyContainer(player.inventory, null);
       
      case GuiIDs.GUI_Fluid_Orderer_ID:
        if(pipe == null || pipe.pipe == null || !(pipe.pipe instanceof PipeFluidRequestLogistics)) return null;
        return new DummyContainer(player.inventory, null);
       
      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;
            return true;
          }
        });
        dummy.addNormalSlotsForPlayerInventory(0, 0);
       
        return dummy;
       
      case GuiIDs.GUI_HUD_Settings:
        dummy = new DummyContainer(player.inventory, null);
        dummy.addRestrictedHotbarForPlayerInventory(10, 160);
        dummy.addRestrictedArmorForPlayerInventory(10, 60);
        return dummy;
       
      case GuiIDs.GUI_Fluid_Basic_ID:
        if(pipe == null || pipe.pipe == null || !((pipe.pipe instanceof PipeFluidBasic))) return null;
        dummy = new DummyContainer(player, ((PipeFluidBasic)pipe.pipe).filterInv, new IGuiOpenControler() {
          @Override
          public void guiOpenedByPlayer(EntityPlayer player) {
            ((PipeFluidBasic)fpipe.pipe).guiOpenedByPlayer(player);
          }

          @Override
          public void guiClosedByPlayer(EntityPlayer player) {
            ((PipeFluidBasic)fpipe.pipe).guiClosedByPlayer(player);
          }
        });
        dummy.addFluidSlot(0, ((PipeFluidBasic)pipe.pipe).filterInv, 28, 15);
        dummy.addNormalSlotsForPlayerInventory(10, 45);
        return dummy;
       
      case GuiIDs.GUI_FIREWALL:
        if(pipe == null || pipe.pipe == null || !((pipe.pipe instanceof PipeItemsFirewall))) return null;
        dummy = new DummyContainer(player.inventory, ((PipeItemsFirewall)pipe.pipe).inv);
        dummy.addNormalSlotsForPlayerInventory(33, 147);
        for(int i = 0;i < 6;i++) {
          for(int j = 0;j < 6;j++) {
            dummy.addDummySlot(i*6 + j, 0, 0);
          }
        }
        return dummy;
   
      case GuiIDs.GUI_Request_Table_ID:
        if(pipe == null || !(pipe.pipe instanceof PipeBlockRequestTable)) return null;
        dummy = new DummyContainer(player, ((PipeBlockRequestTable)pipe.pipe).matrix, (PipeBlockRequestTable)pipe.pipe);
        int i = 0;
        for(int Y = 0;Y < 3;Y++) {
          for(int X = 0;X < 9;X++) {
            dummy.addNormalSlot(i++, ((PipeBlockRequestTable)pipe.pipe).inv, 0, 0);
          }
        }
        i = 0;
        for(int Y = 0;Y < 3;Y++) {
          for(int X = 0;X < 3;X++) {
            dummy.addDummySlot(i++, 0, 0);
          }
        }
        dummy.addCallableSlotHandler(0, ((PipeBlockRequestTable)pipe.pipe).resultInv, 0, 0, new ISlotClick() {
          @Override
          public ItemStack getResultForClick() {
            return ((PipeBlockRequestTable)fpipe.pipe).getResultForClick();
          }
        });
        dummy.addNormalSlot(0, ((PipeBlockRequestTable)pipe.pipe).toSortInv, 0, 0);
        dummy.addNormalSlot(0, ((PipeBlockRequestTable)pipe.pipe).diskInv, 0, 0);
        dummy.addNormalSlotsForPlayerInventory(0, 0);
        return dummy;
       
      default:break;
      }
    }
View Full Code Here

      }
    };
  }

  public DummyContainer getDummyContainer(EntityPlayer player) {
    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

TOP

Related Classes of logisticspipes.utils.gui.DummyContainer

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.