Make fluid autocrafting work correctly with buckets
This commit is contained in:
@@ -88,11 +88,21 @@ public class CraftingTask implements ICraftingTask {
|
|||||||
|
|
||||||
if (fluidInStorage == null || fluidInStorage.amount < fluidInItem.amount) {
|
if (fluidInStorage == null || fluidInStorage.amount < fluidInItem.amount) {
|
||||||
missing.add(input);
|
missing.add(input);
|
||||||
} else if (network.getItemStorage().getList().get(RSUtils.EMPTY_BUCKET) == null) {
|
|
||||||
missing.add(RSUtils.EMPTY_BUCKET.copy());
|
|
||||||
} else {
|
} else {
|
||||||
toTake.add(RSUtils.EMPTY_BUCKET.copy());
|
boolean hasBucket = network.getItemStorage().getList().get(RSUtils.EMPTY_BUCKET) != null;
|
||||||
toTakeFluids.add(fluidInItem.copy());
|
ICraftingPattern bucketPattern = network.getPattern(RSUtils.EMPTY_BUCKET);
|
||||||
|
|
||||||
|
if (!hasBucket) {
|
||||||
|
if (bucketPattern == null) {
|
||||||
|
missing.add(RSUtils.EMPTY_BUCKET.copy());
|
||||||
|
} else {
|
||||||
|
calculate(list, bucketPattern, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hasBucket || bucketPattern != null) {
|
||||||
|
toTakeFluids.add(fluidInItem.copy());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
missing.add(input);
|
missing.add(input);
|
||||||
|
|||||||
Reference in New Issue
Block a user