Package logisticspipes.modules.abstractmodules

Examples of logisticspipes.modules.abstractmodules.LogisticsModule


  }
 
  @Override
  public boolean canCraft(ItemIdentifier toCraft) {
    for (int i = 0; i < this.getChassiSize(); i++) {
      LogisticsModule x = _module.getSubModule(i);
     
      if(x!=null && x instanceof ICraftItems) {
        if(((ICraftItems)x).canCraft(toCraft)) {
          return true;
        }
View Full Code Here


  @Override
  public void onAllowedRemoval() {
    _moduleInventory.removeListener(this);
    if(MainProxy.isServer(this.getWorld())) {
      for (int i = 0; i < this.getChassiSize(); i++){
        LogisticsModule x = _module.getSubModule(i);
        if (x instanceof ILegacyActiveModule) {
          ILegacyActiveModule y = (ILegacyActiveModule)x;
          y.onBlockRemoval();
        }
      }
View Full Code Here

  @Override
  public void itemArrived(ItemIdentifierStack item, IAdditionalTargetInformation info) {
    if(MainProxy.isServer(this.getWorld())) {
      if(info instanceof ChasseTargetInformation) {
        ChasseTargetInformation target = (ChasseTargetInformation) info;
        LogisticsModule module = _module.getSubModule(target.moduleSlot);
        if(module instanceof IRequireReliableTransport) {
          ((IRequireReliableTransport) module).itemArrived(item, info);
        }
      } else {
        if(LPConstants.DEBUG && info != null) {
View Full Code Here

  @Override
  public void itemLost(ItemIdentifierStack item, IAdditionalTargetInformation info) {
    if(MainProxy.isServer(this.getWorld())) {
      if(info instanceof ChasseTargetInformation) {
        ChasseTargetInformation target = (ChasseTargetInformation) info;
        LogisticsModule module = _module.getSubModule(target.moduleSlot);
        if(module instanceof IRequireReliableTransport) {
          ((IRequireReliableTransport) module).itemLost(item, info);
        }
      } else {
        if(LPConstants.DEBUG) {
View Full Code Here

  @Override
  public int addToBuffer(ItemIdentifierStack item, IAdditionalTargetInformation info) {
    if(MainProxy.isServer(this.getWorld())) {
      if(info instanceof ChasseTargetInformation) {
        ChasseTargetInformation target = (ChasseTargetInformation) info;
        LogisticsModule module = _module.getSubModule(target.moduleSlot);
        if(module instanceof IBufferItems) {
          return ((IBufferItems)module).addToBuffer(item, info);
        }
      } else {
        if(LPConstants.DEBUG) {
View Full Code Here

        }
        continue;
      }

      if (stack.getItem() instanceof ItemModule){
        LogisticsModule current = _module.getModule(i);
        LogisticsModule next = ((ItemModule)stack.getItem()).getModuleForItem(stack, _module.getModule(i), this, this);
        next.registerPosition(ModulePositionType.SLOT, i);
        next.registerCCEventQueuer(this);
        if (current != next){
          _module.installModule(i, next);
          if(!MainProxy.isClient()) {
            ItemModuleInformationManager.readInformation(stack, next);
          }
          ItemModuleInformationManager.removeInformation(stack);
        }
        inventory.setInventorySlotContents(i,stack);
      }
    }
    if (reInitGui) {
      if(MainProxy.isClient(this.getWorld())) {
        if (FMLClientHandler.instance().getClient().currentScreen instanceof GuiChassiPipe){
          FMLClientHandler.instance().getClient().currentScreen.initGui();
        }
      }
    }
    if(MainProxy.isServer()) {
      if(!localModeWatchers.isEmpty()) {
        MainProxy.sendToPlayerList(PacketHandler.getPacket(ChassiePipeModuleContent.class).setIdentList(ItemIdentifierStack.getListFromInventory(_moduleInventory)).setPosX(getX()).setPosY(getY()).setPosZ(getZ()), localModeWatchers);
      }
      //register earlier provider modules with later ones, needed for the "who is the first whose filter allows that item" check
      List<ILegacyActiveModule> prevModules = new LinkedList<ILegacyActiveModule>();
      for (int i = 0; i < this.getChassiSize(); i++){
        LogisticsModule x = _module.getSubModule(i);
        if (x instanceof ILegacyActiveModule) {
          ILegacyActiveModule y = (ILegacyActiveModule)x;
          y.registerPreviousLegacyModules(new ArrayList<ILegacyActiveModule>(prevModules));
          prevModules.add(y);
        }
View Full Code Here

    }
    for(IFilter filter:filters) {
      if(filter.isBlocked() == filter.isFilteredItem(tree.getStackItem().getUndamaged()) || filter.blockProvider()) return;
    }
    for (int i = 0; i < this.getChassiSize(); i++){
      LogisticsModule x = _module.getSubModule(i);
      if (x instanceof ILegacyActiveModule){
        ILegacyActiveModule y = (ILegacyActiveModule)x;
        if(y.filterAllowsItem(tree.getStackItem())) {
          y.canProvide(tree, donePromisses, filters);
          return;
View Full Code Here

    //TODO extract information from info to determine the module
    if (!isEnabled()) {
      return null;
    }
    for (int i = 0; i < this.getChassiSize(); i++) {
      LogisticsModule x = _module.getSubModule(i);
      if (x instanceof ILegacyActiveModule){
        ILegacyActiveModule y = (ILegacyActiveModule) x;
        if(y.filterAllowsItem(promise.item)) {
          spawnParticle(Particles.WhiteParticle, 2);
          return y.fullFill(promise, destination, info);
View Full Code Here

  }
 
  public final LogisticsModule getLogisticsModule(EntityPlayer player) {
    ItemStack item = player.inventory.mainInventory[invSlot];
    if(item == null) return null;
    LogisticsModule module = LogisticsPipes.ModuleItem.getModuleForItem(item, null, new DummyWorldProvider(player.getEntityWorld()), null);
    module.registerPosition(ModulePositionType.IN_HAND, invSlot);
    ItemModuleInformationManager.readInformation(item, module);
    return module;
  }
View Full Code Here

      Character.valueOf('U'), parts.getGearTear2(),
      Character.valueOf('B'), new ItemStack(LogisticsPipes.ModuleItem, 1, ItemModule.ENCHANTMENTSINK)
    });
   
    for(int i=0; i<1000;i++) {
      LogisticsModule module = LogisticsPipes.ModuleItem.getModuleForItem(new ItemStack(LogisticsPipes.ModuleItem, 1, i), null, null, null);
      if(module != null) {
        NBTTagCompound nbt = new NBTTagCompound();
        boolean force = false;
        try {
          module.writeToNBT(nbt);
        } catch(Exception e) {
          force = true;
        }
        if(!nbt.equals(new NBTTagCompound()) || force) {
          craftingManager.addShapelessResetRecipe(LogisticsPipes.ModuleItem, i);
View Full Code Here

TOP

Related Classes of logisticspipes.modules.abstractmodules.LogisticsModule

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.