use of logisticspipes.interfaces.ILegacyActiveModule in project LogisticsPipes by RS485.
the class PipeLogisticsChassi method onAllowedRemoval.
@Override
public void onAllowedRemoval() {
_moduleInventory.removeListener(this);
if (MainProxy.isServer(getWorld())) {
for (int i = 0; i < getChassiSize(); i++) {
LogisticsModule x = _module.getSubModule(i);
if (x instanceof ILegacyActiveModule) {
ILegacyActiveModule y = (ILegacyActiveModule) x;
y.onBlockRemoval();
}
}
for (int i = 0; i < _moduleInventory.getSizeInventory(); i++) {
ItemIdentifierStack ms = _moduleInventory.getIDStackInSlot(i);
if (ms != null) {
ItemStack s = ms.makeNormalStack();
ItemModuleInformationManager.saveInfotmation(s, getLogisticsModule().getSubModule(i));
_moduleInventory.setInventorySlotContents(i, s);
}
}
_moduleInventory.dropContents(getWorld(), getX(), getY(), getZ());
}
}
use of logisticspipes.interfaces.ILegacyActiveModule in project LogisticsPipes by RS485.
the class PipeLogisticsChassi method canProvide.
/*** IProvideItems ***/
@Override
public void canProvide(RequestTreeNode tree, RequestTree root, List<IFilter> filters) {
if (!isEnabled()) {
return;
}
for (IFilter filter : filters) {
if (filter.isBlocked() == filter.isFilteredItem(tree.getRequestType()) || filter.blockProvider()) {
return;
}
}
for (int i = 0; i < getChassiSize(); i++) {
LogisticsModule x = _module.getSubModule(i);
if (x instanceof ILegacyActiveModule) {
ILegacyActiveModule y = (ILegacyActiveModule) x;
y.canProvide(tree, root, filters);
}
}
}
use of logisticspipes.interfaces.ILegacyActiveModule in project LogisticsPipes by RS485.
the class PipeLogisticsChassis method canProvide.
/**
* IProvideItems **
*/
@Override
public void canProvide(RequestTreeNode tree, RequestTree root, List<IFilter> filters) {
if (!isEnabled()) {
return;
}
for (IFilter filter : filters) {
if (filter.isBlocked() == filter.isFilteredItem(tree.getRequestType()) || filter.blockProvider()) {
return;
}
}
for (int i = 0; i < getChassisSize(); i++) {
LogisticsModule x = getSubModule(i);
if (x instanceof ILegacyActiveModule) {
ILegacyActiveModule y = (ILegacyActiveModule) x;
y.canProvide(tree, root, filters);
}
}
}
use of logisticspipes.interfaces.ILegacyActiveModule in project LogisticsPipes by RS485.
the class PipeLogisticsChassis method getAllItems.
@Override
public void getAllItems(Map<ItemIdentifier, Integer> list, List<IFilter> filter) {
if (!isEnabled()) {
return;
}
for (int i = 0; i < getChassisSize(); i++) {
LogisticsModule x = getSubModule(i);
if (x instanceof ILegacyActiveModule) {
ILegacyActiveModule y = (ILegacyActiveModule) x;
y.getAllItems(list, filter);
}
}
}
use of logisticspipes.interfaces.ILegacyActiveModule in project LogisticsPipes by RS485.
the class PipeLogisticsChassis method fullFill.
@Override
public LogisticsOrder fullFill(LogisticsPromise promise, IRequestItems destination, IAdditionalTargetInformation info) {
if (!isEnabled()) {
return null;
}
for (int i = 0; i < getChassisSize(); i++) {
LogisticsModule x = getSubModule(i);
if (x instanceof ILegacyActiveModule) {
ILegacyActiveModule y = (ILegacyActiveModule) x;
LogisticsOrder result = y.fullFill(promise, destination, info);
if (result != null) {
spawnParticle(Particles.WhiteParticle, 2);
return result;
}
}
}
return null;
}
Aggregations