mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-12 00:07:29 +00:00
Fix: Adv blocking card for omni. False positive when getAdaptor() return null. (#231)
* fix_getadaptor * spotless * allow certus tank & buffers * better check * spotless * better blocking behavior --------- Co-authored-by: Martin Robertz <dream-master@gmx.net>
This commit is contained in:
1 parent
f8e7aba55a
commit
25da378a51
1 file changed
+11
-2
@@ -31,7 +31,9 @@ import com.glodblock.github.util.Util;
|
||||
|
||||
import appeng.api.config.FuzzyMode;
|
||||
import appeng.api.config.InsertionMode;
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.api.config.Upgrades;
|
||||
import appeng.api.config.YesNo;
|
||||
import appeng.api.parts.IPart;
|
||||
import appeng.helpers.DualityInterface;
|
||||
import appeng.helpers.IInterfaceHost;
|
||||
@@ -99,11 +101,18 @@ public class FluidConvertingInventoryAdaptor extends InventoryAdaptor {
|
||||
|| Util.getPart(inter, face.getOpposite()) instanceof PartFluidExportBus
|
||||
|| Util.getPart(inter, face.getOpposite()) instanceof PartFluidP2PInterface))
|
||||
return InventoryAdaptor.getAdaptor(capProvider, face);
|
||||
if (InventoryAdaptor.getAdaptor(capProvider, face) == null) {
|
||||
if (capProvider instanceof IFluidHandler tank) {
|
||||
if (!(tank.getTankInfo(face).length > 0)) return null;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
InventoryAdaptor item = InventoryAdaptor.getAdaptor(capProvider, face);
|
||||
IFluidHandler fluid = capProvider instanceof IFluidHandler ? (IFluidHandler) capProvider : null;
|
||||
boolean onmi = false;
|
||||
if (inter instanceof TileInterface) {
|
||||
onmi = ((TileInterface) inter).getTargets().size() > 1;
|
||||
if (inter instanceof TileInterface in) {
|
||||
if (in.getConfigManager().getSetting(Settings.BLOCK) == YesNo.NO) onmi = in.getTargets().size() > 1;
|
||||
}
|
||||
return new FluidConvertingInventoryAdaptor(capProvider, item, fluid, face, new BlockPos(inter), onmi);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user