do the same for fluid storage bus
This commit is contained in:
@@ -25,6 +25,7 @@ import java.util.Iterator;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import appeng.api.config.AccessRestriction;
|
||||||
import appeng.api.config.Settings;
|
import appeng.api.config.Settings;
|
||||||
import appeng.api.config.StorageFilter;
|
import appeng.api.config.StorageFilter;
|
||||||
import appeng.me.GridAccessException;
|
import appeng.me.GridAccessException;
|
||||||
@@ -64,6 +65,8 @@ public class FluidHandlerAdapter implements IMEInventory<IAEFluidStack>, IBaseMo
|
|||||||
private final IGridProxyable proxyable;
|
private final IGridProxyable proxyable;
|
||||||
private final FluidHandlerAdapter.InventoryCache cache;
|
private final FluidHandlerAdapter.InventoryCache cache;
|
||||||
private StorageFilter mode;
|
private StorageFilter mode;
|
||||||
|
private AccessRestriction access;
|
||||||
|
|
||||||
|
|
||||||
FluidHandlerAdapter( IFluidHandler fluidHandler, IGridProxyable proxy )
|
FluidHandlerAdapter( IFluidHandler fluidHandler, IGridProxyable proxy )
|
||||||
{
|
{
|
||||||
@@ -73,6 +76,7 @@ public class FluidHandlerAdapter implements IMEInventory<IAEFluidStack>, IBaseMo
|
|||||||
{
|
{
|
||||||
PartStorageBus partStorageBus = (PartStorageBus) this.proxyable;
|
PartStorageBus partStorageBus = (PartStorageBus) this.proxyable;
|
||||||
this.mode = ( (StorageFilter) partStorageBus.getConfigManager().getSetting( Settings.STORAGE_FILTER ) );
|
this.mode = ( (StorageFilter) partStorageBus.getConfigManager().getSetting( Settings.STORAGE_FILTER ) );
|
||||||
|
this.access = ( (AccessRestriction) partStorageBus.getConfigManager().getSetting( Settings.ACCESS ) );
|
||||||
}
|
}
|
||||||
this.cache = new FluidHandlerAdapter.InventoryCache( this.fluidHandler, this.mode);
|
this.cache = new FluidHandlerAdapter.InventoryCache( this.fluidHandler, this.mode);
|
||||||
}
|
}
|
||||||
@@ -141,7 +145,7 @@ public class FluidHandlerAdapter implements IMEInventory<IAEFluidStack>, IBaseMo
|
|||||||
public TickRateModulation onTick()
|
public TickRateModulation onTick()
|
||||||
{
|
{
|
||||||
List<IAEFluidStack> changes = this.cache.update();
|
List<IAEFluidStack> changes = this.cache.update();
|
||||||
if( !changes.isEmpty() )
|
if( !changes.isEmpty() && access.hasPermission( AccessRestriction.READ ) )
|
||||||
{
|
{
|
||||||
this.postDifference( changes );
|
this.postDifference( changes );
|
||||||
return TickRateModulation.URGENT;
|
return TickRateModulation.URGENT;
|
||||||
|
|||||||
Reference in New Issue
Block a user