mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-17 02:45:08 +00:00
fix inventory check of gt machine
This commit is contained in:
1 parent
0e774f4e66
commit
fb003da0a3
3 files changed
+24
-6
No files matched your search
@@ -28,7 +28,7 @@ import cpw.mods.fml.common.network.NetworkRegistry;
|
||||
modid = FluidCraft.MODID,
|
||||
version = FluidCraft.VERSION,
|
||||
name = FluidCraft.MODNAME,
|
||||
dependencies = "required-after:appliedenergistics2;required-after:CoFHCore;after:waila;after:thaumicenergistics;after:ae2wct")
|
||||
dependencies = "required-after:appliedenergistics2;required-after:CoFHCore;required-after:Baubles;after:waila;after:thaumicenergistics;after:ae2wct")
|
||||
public class FluidCraft {
|
||||
|
||||
public static final String MODID = "GRADLETOKEN_MODID";
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package com.glodblock.github.inventory;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@@ -291,6 +288,24 @@ public class FluidConvertingInventoryAdaptor extends InventoryAdaptor {
|
||||
return item;
|
||||
}
|
||||
|
||||
private int gtMachineCircuitCheck(InventoryAdaptor ad) {
|
||||
if (ad == null) {
|
||||
return 0;
|
||||
}
|
||||
for (ItemSlot i : ad) {
|
||||
ItemStack is = i.getItemStack();
|
||||
if (is == null || Objects.requireNonNull(is.getItem()).getUnlocalizedName().equals("gt.integrated_circuit"))
|
||||
continue;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
private boolean isGTMachine(Object o) {
|
||||
return o instanceof TileEntity
|
||||
&& ((TileEntity) o).getBlockType().getUnlocalizedName().equals("gt.blockmachines");
|
||||
}
|
||||
|
||||
private boolean isConduit(TileEntity te) {
|
||||
return ModAndClassUtil.COFH && te instanceof IItemDuct;
|
||||
}
|
||||
@@ -353,6 +368,9 @@ public class FluidConvertingInventoryAdaptor extends InventoryAdaptor {
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
if (isGTMachine(tank)) {
|
||||
return gtMachineCircuitCheck(inv);
|
||||
}
|
||||
return inv != null && inv.containsItems() ? 1 : 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user