Package logisticspipes.modules.abstractmodules

Examples of logisticspipes.modules.abstractmodules.LogisticsModule


    super(id);
  }
 
  @Override
  public Object getClientGui(EntityPlayer player) {
    LogisticsModule module = this.getLogisticsModule(player);
    if(!(module instanceof ModuleProvider)) return null;
    return new logisticspipes.gui.modules.GuiProvider(player.inventory, (ModuleProvider) module);
  }
View Full Code Here


    super(id);
  }
 
  @Override
  public Object getClientGui(EntityPlayer player) {
    LogisticsModule module = this.getLogisticsModule(player);
    if(!(module instanceof ModuleAdvancedExtractor)) return null;
    return new GuiAdvancedExtractor(player.inventory, (ModuleAdvancedExtractor) module);
  }
View Full Code Here

    super(id);
  }

  @Override
  public Object getClientGui(EntityPlayer player) {
    LogisticsModule module = this.getLogisticsModule(player);
    if(!(module instanceof ModuleCCBasedQuickSort)) return null;
    return new GuiCCBasedQuickSort(player.inventory, (ModuleCCBasedQuickSort) module);
  }
View Full Code Here

    super(id);
  }

  @Override
  public Object getClientGui(EntityPlayer player) {
    LogisticsModule module = this.getLogisticsModule(player);
    if(!(module instanceof ModuleApiaristAnalyser)) return null;
    return new GuiApiaristAnalyser((ModuleApiaristAnalyser) module, player.inventory);
  }
View Full Code Here

    super(id);
  }
 
  @Override
  public Object getClientGui(EntityPlayer player) {
    LogisticsModule module = this.getLogisticsModule(player);
    if(!(module instanceof ModuleModBasedItemSink)) return null;
    return new GuiModBasedItemSink(player.inventory, (ModuleModBasedItemSink) module);
  }
View Full Code Here

    super(id);
  }
 
  @Override
  public Object getClientGui(EntityPlayer player) {
    LogisticsModule module = this.getLogisticsModule(player);
    if(!(module instanceof ModuleOreDictItemSink)) return null;
    return new GuiOreDictItemSink(player.inventory, (ModuleOreDictItemSink) module);
  }
View Full Code Here

    super(id);
  }

  @Override
  public Object getClientGui(EntityPlayer player) {
    LogisticsModule module = this.getLogisticsModule(player);
    if(!(module instanceof ModuleElectricManager)) return null;
    return new GuiElectricManager(player.inventory, (ModuleElectricManager) module);
  }
View Full Code Here

    super(id);
  }

  @Override
  public Object getClientGui(EntityPlayer player) {
    LogisticsModule module = this.getLogisticsModule(player);
    if(!(module instanceof ModuleThaumicAspectSink)) return null;
    return new GuiThaumicAspectSink(player.inventory, (ModuleThaumicAspectSink) module);
  }
View Full Code Here

  }
 
  private boolean moduleBased = false;
  @SuppressWarnings("unchecked")
  public <T> T getLogisticsModule(EntityPlayer player, Class<T> clazz) {
    LogisticsModule module = null;
    if(this.type == ModulePositionType.IN_PIPE) {
      moduleBased = true;
      LogisticsTileGenericPipe pipe = this.getPipe(player.getEntityWorld());
      moduleBased = false;
      if(pipe == null || !(pipe.pipe instanceof CoreRoutedPipe)) {
        targetNotFound("Couldn't find " + clazz.getName() + ", pipe didn't exsist");
        return null;
      }
      module = ((CoreRoutedPipe)pipe.pipe).getLogisticsModule();
    } else if (this.type == ModulePositionType.IN_HAND) {
      if(MainProxy.isServer(player.getEntityWorld())) {
        if(player.openContainer instanceof DummyModuleContainer) {
          DummyModuleContainer dummy = (DummyModuleContainer) player.openContainer;
          module = dummy.getModule();
        } else {
          targetNotFound("Couldn't find " + clazz.getName() + ", container wasn't a DummyModule Container");
          return null;
        }
      } else {
        module = MainProxy.proxy.getModuleFromGui();
        if(module == null) {
          targetNotFound("Couldn't find " + clazz.getName() + ", GUI didn't provide the module");
          return null;
        }
      }
    } else {
      moduleBased = true;
      LogisticsTileGenericPipe pipe = this.getPipe(player.getEntityWorld());
      moduleBased = false;
      if(pipe == null || !(pipe.pipe instanceof CoreRoutedPipe)) {
        targetNotFound("Couldn't find " + clazz.getName() + ", pipe didn't exsist");
        return null;
      }
      if(!(pipe.pipe instanceof PipeLogisticsChassi)) {
        targetNotFound("Couldn't find " + clazz.getName() + ", pipe wasn't a chassi pipe");
        return null;
      }
      module = ((PipeLogisticsChassi)pipe.pipe).getLogisticsModule().getSubModule(positionInt);
    }
    if(module != null) {
      if(!(clazz.isAssignableFrom(module.getClass()))) {
        targetNotFound("Couldn't find " + clazz.getName() + ", found " + module.getClass());
        return null;
      }
    } else {
      targetNotFound("Couldn't find " + clazz.getName());
    }
View Full Code Here

  }
 
  public static SinkReply canSink(IRouter destination, IRouter sourceRouter, boolean excludeSource,ItemIdentifier stack,SinkReply result, boolean activeRequest, boolean allowDefault) {

    SinkReply reply = null;
    LogisticsModule module = destination.getLogisticsModule();
    CoreRoutedPipe crp = destination.getPipe();
    if (module == null) return null;
    if (!(module.recievePassive() || activeRequest))
      return null;
    if (crp == null || !crp.isEnabled()) return null;
    if (excludeSource && sourceRouter !=null) {
      if(destination.getPipe().sharesInventoryWith(sourceRouter.getPipe())) return null;
    }
    if (result== null) {
      reply = module.sinksItem(stack, -1, 0, allowDefault,true);
    } else {
      reply = module.sinksItem(stack, result.fixedPriority.ordinal(), result.customPriority, allowDefault,true);
    }
    return reply;
  }
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.