Improvement
This commit is contained in:
@@ -50,7 +50,7 @@ public class TileInterface extends TileMachine implements ICompareConfig {
|
|||||||
if (slot == null) {
|
if (slot == null) {
|
||||||
currentSlot++;
|
currentSlot++;
|
||||||
} else if (ticks % RefinedStorageUtils.getSpeed(upgrades) == 0) {
|
} else if (ticks % RefinedStorageUtils.getSpeed(upgrades) == 0) {
|
||||||
int size = RefinedStorageUtils.hasUpgrade(upgrades, ItemUpgrade.TYPE_STACK) ? 64 : 1;
|
int size = Math.min(slot.stackSize, RefinedStorageUtils.hasUpgrade(upgrades, ItemUpgrade.TYPE_STACK) ? 64 : 1);
|
||||||
|
|
||||||
ItemStack remainder = controller.push(slot, size, false);
|
ItemStack remainder = controller.push(slot, size, false);
|
||||||
|
|
||||||
|
|||||||
@@ -413,9 +413,6 @@ public class TileController extends TileBase implements IEnergyReceiver, ISynchr
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We copy here because push can not modify the stack
|
|
||||||
// if we return the remainder (that will not be copied if there are no storages)
|
|
||||||
// user code can do something with the uncopied remainder.
|
|
||||||
if (storages.isEmpty()) {
|
if (storages.isEmpty()) {
|
||||||
return ItemHandlerHelper.copyStackWithSize(stack, size);
|
return ItemHandlerHelper.copyStackWithSize(stack, size);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user