Small fixes
This commit is contained in:
@@ -56,7 +56,7 @@ public class CraftingTaskProcessing extends CraftingTask {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!isReadyToInsert()) {
|
if (!hasTakenInputs()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,10 +78,10 @@ public class CraftingTaskProcessing extends CraftingTask {
|
|||||||
tileInUse = null;
|
tileInUse = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return isReady();
|
return hasReceivedOutputs();
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isReady() {
|
private boolean hasReceivedOutputs() {
|
||||||
for (boolean item : satisfiedInsertion) {
|
for (boolean item : satisfiedInsertion) {
|
||||||
if (!item) {
|
if (!item) {
|
||||||
return false;
|
return false;
|
||||||
@@ -91,7 +91,7 @@ public class CraftingTaskProcessing extends CraftingTask {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isReadyToInsert() {
|
private boolean hasTakenInputs() {
|
||||||
for (boolean item : satisfied) {
|
for (boolean item : satisfied) {
|
||||||
if (!item) {
|
if (!item) {
|
||||||
return false;
|
return false;
|
||||||
@@ -102,11 +102,9 @@ public class CraftingTaskProcessing extends CraftingTask {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean isTileInUse(INetworkMaster network) {
|
private boolean isTileInUse(INetworkMaster network) {
|
||||||
if (tileInUse == null) {
|
for (ICraftingTask task : network.getCraftingTasks()) {
|
||||||
for (ICraftingTask task : network.getCraftingTasks()) {
|
if (isTileInUse(task)) {
|
||||||
if (isTileInUse(task)) {
|
return true;
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,22 +132,16 @@ public class CraftingTaskProcessing extends CraftingTask {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean onInserted(ItemStack stack) {
|
public boolean onInserted(ItemStack stack) {
|
||||||
if (isReady()) {
|
if (!hasReceivedOutputs() && hasTakenInputs()) {
|
||||||
return false;
|
for (int i = 0; i < pattern.getOutputs().size(); ++i) {
|
||||||
}
|
ItemStack output = pattern.getOutputs().get(i);
|
||||||
|
|
||||||
for (int i = 0; i < pattern.getOutputs().size(); ++i) {
|
if (!satisfiedInsertion[i]) {
|
||||||
ItemStack output = pattern.getOutputs().get(i);
|
if (CompareUtils.compareStackNoQuantity(output, stack)) {
|
||||||
|
satisfiedInsertion[i] = true;
|
||||||
|
|
||||||
if (!satisfiedInsertion[i]) {
|
return true;
|
||||||
if (CompareUtils.compareStackNoQuantity(output, stack)) {
|
|
||||||
satisfiedInsertion[i] = true;
|
|
||||||
|
|
||||||
if (isReady()) {
|
|
||||||
tileInUse = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -206,7 +198,7 @@ public class CraftingTaskProcessing extends CraftingTask {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isReadyToInsert()) {
|
if (hasTakenInputs()) {
|
||||||
builder.append("I=gui.refinedstorage:crafting_monitor.items_processing\n");
|
builder.append("I=gui.refinedstorage:crafting_monitor.items_processing\n");
|
||||||
|
|
||||||
for (int i = 0; i < pattern.getInputs().size(); ++i) {
|
for (int i = 0; i < pattern.getInputs().size(); ++i) {
|
||||||
|
|||||||
@@ -556,7 +556,7 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (checkProcessing(stack, task)) {
|
if (onInserted(stack, task)) {
|
||||||
inserted--;
|
inserted--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -566,9 +566,9 @@ public class TileController extends TileBase implements INetworkMaster, IEnergyR
|
|||||||
return remainder;
|
return remainder;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean checkProcessing(ItemStack stack, ICraftingTask task) {
|
private boolean onInserted(ItemStack stack, ICraftingTask task) {
|
||||||
if (task.getChild() != null) {
|
if (task.getChild() != null) {
|
||||||
return checkProcessing(stack, task.getChild());
|
return onInserted(stack, task.getChild());
|
||||||
}
|
}
|
||||||
|
|
||||||
return task instanceof CraftingTaskProcessing && ((CraftingTaskProcessing) task).onInserted(stack);
|
return task instanceof CraftingTaskProcessing && ((CraftingTaskProcessing) task).onInserted(stack);
|
||||||
|
|||||||
Reference in New Issue
Block a user