Reworked IO Port to handle StorageChannels better. (#3284)

* Reworked IO Port to handle custom StorageChannels in a better way.
* Added a transferFactor to `IStorageChannel` to allow addons to speedup the IO Port to transfer faster. E.g. 1000 mB fluid as fast as transfering 1 bucket (item) per operation, not just 1 mB. 
* Also some changes to avoid moving fluids being 1000x as energy expensive as items.
This commit is contained in:
yueh
2017-12-21 19:12:45 +01:00
committed by GitHub
parent e243c8e9a2
commit 7956872d1d
4 changed files with 89 additions and 83 deletions
@@ -160,6 +160,12 @@ public class ApiStorage implements IStorageHelper
private static final class FluidStorageChannel implements IFluidStorageChannel
{
@Override
public int transferFactor()
{
return 1000;
}
@Override
public IItemList<IAEFluidStack> createList()
{
@@ -195,7 +201,7 @@ public class ApiStorage implements IStorageHelper
Preconditions.checkNotNull( request );
Preconditions.checkNotNull( src );
return null;
return Platform.poweredExtraction( energy, cell, request, src );
}
@Override
@@ -206,7 +212,7 @@ public class ApiStorage implements IStorageHelper
Preconditions.checkNotNull( input );
Preconditions.checkNotNull( src );
return input;
return Platform.poweredInsert( energy, cell, input, src );
}
}