use of logisticspipes.interfaces.ILegacyActiveModule in project LogisticsPipes by RS485.
the class PipeLogisticsChassi method getAllItems.
@Override
public void getAllItems(Map<ItemIdentifier, Integer> list, List<IFilter> filter) {
if (!isEnabled()) {
return;
}
for (int i = 0; i < getChassiSize(); i++) {
LogisticsModule x = _module.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 PipeLogisticsChassi method fullFill.
@Override
public LogisticsOrder fullFill(LogisticsPromise promise, IRequestItems destination, IAdditionalTargetInformation info) {
if (!isEnabled()) {
return null;
}
for (int i = 0; i < getChassiSize(); i++) {
LogisticsModule x = _module.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;
}
use of logisticspipes.interfaces.ILegacyActiveModule in project LogisticsPipes by RS485.
the class PipeLogisticsChassis method onAllowedRemoval.
@Override
public void onAllowedRemoval() {
_moduleInventory.removeListener(this);
if (MainProxy.isServer(getWorld())) {
for (int i = 0; i < getChassisSize(); i++) {
LogisticsModule x = 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 stack = ms.makeNormalStack();
ItemModuleInformationManager.saveInformation(stack, getSubModule(i));
_moduleInventory.setInventorySlotContents(i, stack);
}
}
_moduleInventory.dropContents(getWorld(), getX(), getY(), getZ());
for (int i = 0; i < getChassisSize(); i++) {
getModuleUpgradeManager(i).dropUpgrades();
}
}
}
Aggregations