Fixed OpenComputers "unknown error" when using extract item API. Fixes #2049
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
# Refined Storage Changelog
|
# Refined Storage Changelog
|
||||||
|
|
||||||
|
### 1.6.9
|
||||||
|
- Fixed OpenComputers "unknown error" when using extract item API (raoulvdberge)
|
||||||
|
|
||||||
### 1.6.8
|
### 1.6.8
|
||||||
- Fixed Ender IO incompatibility (raoulvdberge)
|
- Fixed Ender IO incompatibility (raoulvdberge)
|
||||||
|
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ public class EnvironmentNetwork extends AbstractManagedEnvironment {
|
|||||||
|
|
||||||
// Simulate extracting the item and get the amount of items that can be extracted
|
// Simulate extracting the item and get the amount of items that can be extracted
|
||||||
ItemStack extractedSim = node.getNetwork().extractItem(stack, count, Action.SIMULATE);
|
ItemStack extractedSim = node.getNetwork().extractItem(stack, count, Action.SIMULATE);
|
||||||
if (extractedSim.isEmpty() || extractedSim.getCount() == 0) {
|
if (extractedSim == null) {
|
||||||
return new Object[]{null, "could not extract the specified item"};
|
return new Object[]{null, "could not extract the specified item"};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -290,7 +290,9 @@ public class EnvironmentNetwork extends AbstractManagedEnvironment {
|
|||||||
|
|
||||||
// Actually do it and return how many items we've inserted
|
// Actually do it and return how many items we've inserted
|
||||||
ItemStack extracted = node.getNetwork().extractItem(stack, count, Action.PERFORM);
|
ItemStack extracted = node.getNetwork().extractItem(stack, count, Action.PERFORM);
|
||||||
ItemHandlerHelper.insertItemStacked(handler, extracted, false);
|
if (extracted != null) {
|
||||||
|
ItemHandlerHelper.insertItemStacked(handler, extracted, false);
|
||||||
|
}
|
||||||
|
|
||||||
return new Object[]{transferableAmount};
|
return new Object[]{transferableAmount};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user