"Finished" check now considers the set IO mode (#1709)
* "Finished" check now considers the set IO mode * Fixed behaviour, removed useless code * oops, my branch wasnt up to date apparently * forgot moving drive to output when full * apparently wrong indentation * Update NetworkNodeDiskManipulator.java * changed format * f o r m a t
This commit is contained in:
@@ -195,19 +195,24 @@ public class NetworkNodeDiskManipulator extends NetworkNode implements IComparab
|
|||||||
// We need to check if the stack was inserted
|
// We need to check if the stack was inserted
|
||||||
storage.insert(((extracted == remainder) ? remainder.copy() : remainder), remainder.getCount(), false);
|
storage.insert(((extracted == remainder) ? remainder.copy() : remainder), remainder.getCount(), false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (storage.getStacks().size() == 0) {
|
|
||||||
moveDriveToOutput(slot);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Iterate through disk stacks, if none can be inserted, return that it is done processing and can be output.
|
//Iterate through disk stacks, if none can be inserted, return that it is done processing and can be output.
|
||||||
private boolean checkItemDiskDone(IStorageDisk<ItemStack> storage, int slot) {
|
private boolean checkItemDiskDone(IStorageDisk<ItemStack> storage, int slot) {
|
||||||
if (storage.getStored() == 0) {
|
if (ioMode == IO_MODE_INSERT && storage.getStored() == 0) {
|
||||||
moveDriveToOutput(slot);
|
moveDriveToOutput(slot);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//In Extract mode, we just need to check if the disk is full or not.
|
||||||
|
if (ioMode == IO_MODE_EXTRACT)
|
||||||
|
if (storage.getStored() == storage.getCapacity()) {
|
||||||
|
moveDriveToOutput(slot);
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
List<ItemStack> stacks = new ArrayList<>(storage.getStacks());
|
List<ItemStack> stacks = new ArrayList<>(storage.getStacks());
|
||||||
for (int i = 0; i < stacks.size(); ++i) {
|
for (int i = 0; i < stacks.size(); ++i) {
|
||||||
ItemStack stack = stacks.get(i);
|
ItemStack stack = stacks.get(i);
|
||||||
@@ -226,11 +231,6 @@ public class NetworkNodeDiskManipulator extends NetworkNode implements IComparab
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void extractItemFromNetwork(IStorageDisk<ItemStack> storage, int slot) {
|
private void extractItemFromNetwork(IStorageDisk<ItemStack> storage, int slot) {
|
||||||
if (storage.getStored() == storage.getCapacity()) {
|
|
||||||
moveDriveToOutput(slot);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ItemStack extracted = null;
|
ItemStack extracted = null;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
@@ -298,11 +298,20 @@ public class NetworkNodeDiskManipulator extends NetworkNode implements IComparab
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean checkFluidDiskDone(IStorageDisk<FluidStack> storage, int slot) {
|
private boolean checkFluidDiskDone(IStorageDisk<FluidStack> storage, int slot) {
|
||||||
if (storage.getStored() == 0) {
|
if (ioMode == IO_MODE_INSERT && storage.getStored() == 0) {
|
||||||
moveDriveToOutput(slot);
|
moveDriveToOutput(slot);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//In Extract mode, we just need to check if the disk is full or not.
|
||||||
|
if (ioMode == IO_MODE_EXTRACT)
|
||||||
|
if (storage.getStored() == storage.getCapacity()) {
|
||||||
|
moveDriveToOutput(slot);
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
List<FluidStack> stacks = new ArrayList<>(storage.getStacks());
|
List<FluidStack> stacks = new ArrayList<>(storage.getStacks());
|
||||||
for (int i = 0; i < stacks.size(); ++i) {
|
for (int i = 0; i < stacks.size(); ++i) {
|
||||||
FluidStack stack = stacks.get(i);
|
FluidStack stack = stacks.get(i);
|
||||||
@@ -321,11 +330,6 @@ public class NetworkNodeDiskManipulator extends NetworkNode implements IComparab
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void extractFluidFromNetwork(IStorageDisk<FluidStack> storage, int slot) {
|
private void extractFluidFromNetwork(IStorageDisk<FluidStack> storage, int slot) {
|
||||||
if (storage.getStored() == storage.getCapacity()) {
|
|
||||||
moveDriveToOutput(slot);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
FluidStack extracted = null;
|
FluidStack extracted = null;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user