Search in sources :

Example 1 with IBufferItems

use of logisticspipes.interfaces.IBufferItems in project LogisticsPipes by RS485.

the class PipeLogisticsChassi method addToBuffer.

@Override
public int addToBuffer(ItemIdentifierStack item, IAdditionalTargetInformation info) {
    if (MainProxy.isServer(getWorld())) {
        if (info instanceof ChassiTargetInformation) {
            ChassiTargetInformation target = (ChassiTargetInformation) info;
            LogisticsModule module = _module.getSubModule(target.moduleSlot);
            if (module instanceof IBufferItems) {
                return ((IBufferItems) module).addToBuffer(item, info);
            }
        } else {
            if (LPConstants.DEBUG) {
                System.out.println(item);
                new RuntimeException("[AddToBuffer] Information weren't ment for a chassi pipe").printStackTrace();
            }
        }
    }
    return item.getStackSize();
}
Also used : IBufferItems(logisticspipes.interfaces.IBufferItems) LogisticsModule(logisticspipes.modules.abstractmodules.LogisticsModule)

Example 2 with IBufferItems

use of logisticspipes.interfaces.IBufferItems in project LogisticsPipes by RS485.

the class PipeLogisticsChassis method addToBuffer.

@Override
public int addToBuffer(ItemIdentifierStack item, IAdditionalTargetInformation info) {
    if (MainProxy.isServer(getWorld())) {
        if (info instanceof ChassiTargetInformation) {
            ChassiTargetInformation target = (ChassiTargetInformation) info;
            LogisticsModule module = getSubModule(target.moduleSlot);
            if (module instanceof IBufferItems) {
                return ((IBufferItems) module).addToBuffer(item, info);
            }
        } else {
            if (LogisticsPipes.isDEBUG()) {
                System.out.println(item);
                new RuntimeException("[AddToBuffer] Information weren't ment for a chassi pipe").printStackTrace();
            }
        }
    }
    return item.getStackSize();
}
Also used : IBufferItems(logisticspipes.interfaces.IBufferItems) LogisticsModule(logisticspipes.modules.LogisticsModule)

Aggregations

IBufferItems (logisticspipes.interfaces.IBufferItems)2 LogisticsModule (logisticspipes.modules.LogisticsModule)1 LogisticsModule (logisticspipes.modules.abstractmodules.LogisticsModule)1