Co-authored-by: yueh <yueh@users.noreply.github.com>
This commit is contained in:
@@ -96,16 +96,15 @@ public class FluidImportBusPart extends SharedFluidBusPart {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final TileEntity te = this.getConnectedTE();
|
final TileEntity te = this.getConnectedTE();
|
||||||
LazyOptional<IFluidHandler> fhOpt = LazyOptional.empty();
|
|
||||||
if (te != null) {
|
if (te != null) {
|
||||||
te.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY, this.getSide().getFacing().getOpposite());
|
LazyOptional<IFluidHandler> fhOpt = te.getCapability(CapabilityFluidHandler.FLUID_HANDLER_CAPABILITY,
|
||||||
}
|
this.getSide().getFacing().getOpposite());
|
||||||
if (fhOpt.isPresent()) {
|
|
||||||
try {
|
if (fhOpt.isPresent()) {
|
||||||
final IFluidHandler fh = fhOpt.orElse(null);
|
try {
|
||||||
final IMEMonitor<IAEFluidStack> inv = this.getProxy().getStorage().getInventory(this.getChannel());
|
final IFluidHandler fh = fhOpt.orElseThrow(() -> new IllegalStateException());
|
||||||
|
final IMEMonitor<IAEFluidStack> inv = this.getProxy().getStorage().getInventory(this.getChannel());
|
||||||
|
|
||||||
if (fh != null) {
|
|
||||||
final FluidStack fluidStack = fh.drain(this.calculateAmountToSend(), FluidAction.SIMULATE);
|
final FluidStack fluidStack = fh.drain(this.calculateAmountToSend(), FluidAction.SIMULATE);
|
||||||
|
|
||||||
if (this.filterEnabled() && !this.isInFilter(fluidStack)) {
|
if (this.filterEnabled() && !this.isInFilter(fluidStack)) {
|
||||||
@@ -128,12 +127,11 @@ public class FluidImportBusPart extends SharedFluidBusPart {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return TickRateModulation.IDLE;
|
return TickRateModulation.IDLE;
|
||||||
|
} catch (GridAccessException e) {
|
||||||
|
// skip
|
||||||
}
|
}
|
||||||
} catch (GridAccessException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return TickRateModulation.SLEEP;
|
return TickRateModulation.SLEEP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user