mirror of
https://github.com/GTNewHorizons/AE2FluidCraft-Rework.git
synced 2026-11-23 05:19:49 +00:00
cells
This commit is contained in:
1 parent
24d30ef078
commit
ebd42852ff
38 files changed
+211
-2351
No files matched your search
@@ -22,7 +22,6 @@ import net.minecraftforge.fluids.FluidStack;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.glodblock.github.common.item.ItemFluidDrop;
|
||||
import com.glodblock.github.common.storage.FluidCellInventoryHandler;
|
||||
import com.glodblock.github.util.ModAndClassUtil;
|
||||
import com.mitchej123.hodgepodge.textures.IPatchedTextureAtlasSprite;
|
||||
|
||||
@@ -33,6 +32,7 @@ import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IAEStack;
|
||||
import appeng.client.render.StackSizeRenderer;
|
||||
import appeng.core.localization.GuiText;
|
||||
import appeng.me.storage.FluidCellInventoryHandler;
|
||||
import appeng.util.Platform;
|
||||
import appeng.util.item.FluidList;
|
||||
import codechicken.nei.PositionedStack;
|
||||
|
||||
@@ -6,19 +6,17 @@ import java.util.regex.Pattern;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
import com.glodblock.github.common.storage.IFluidCellInventory;
|
||||
import com.glodblock.github.common.storage.IFluidCellInventoryHandler;
|
||||
import com.glodblock.github.common.storage.IStorageFluidCell;
|
||||
|
||||
import appeng.api.AEApi;
|
||||
import appeng.api.implementations.items.IStorageCell;
|
||||
import appeng.api.storage.ICellInventory;
|
||||
import appeng.api.storage.IMEInventoryHandler;
|
||||
import appeng.api.storage.StorageChannel;
|
||||
import appeng.api.storage.data.IAEFluidStack;
|
||||
import appeng.api.storage.data.IAEItemStack;
|
||||
import appeng.api.storage.data.IAEStack;
|
||||
import appeng.api.storage.data.IItemList;
|
||||
import appeng.items.AEBaseCell;
|
||||
import appeng.me.storage.CellInventoryHandler;
|
||||
import appeng.me.storage.FluidCellInventoryHandler;
|
||||
import appeng.util.IterationCounter;
|
||||
import codechicken.nei.SearchField;
|
||||
import codechicken.nei.SearchTokenParser;
|
||||
@@ -57,15 +55,15 @@ public class NEISearchFilter implements SearchTokenParser.ISearchParserProvider
|
||||
|
||||
@Override
|
||||
public boolean matches(ItemStack itemStack) {
|
||||
if (itemStack.getItem() instanceof IStorageFluidCell) {
|
||||
if (itemStack.getItem() instanceof AEBaseCell<?>) {
|
||||
final IMEInventoryHandler<?> inventory = AEApi.instance().registries().cell()
|
||||
.getCellInventory(itemStack, null, StorageChannel.FLUIDS);
|
||||
if (inventory instanceof final IFluidCellInventoryHandler handler) {
|
||||
final IFluidCellInventory cellInventory = handler.getCellInv();
|
||||
if (inventory instanceof final FluidCellInventoryHandler handler) {
|
||||
final ICellInventory<IAEFluidStack> cellInventory = handler.getCellInv();
|
||||
if (cellInventory != null) {
|
||||
final ArrayList<IAEFluidStack> out = new ArrayList<>();
|
||||
handler.getPartitionInv().forEach(out::add);
|
||||
out.addAll(cellInventory.getContents());
|
||||
//handler.getPartitionInv().forEach(out::add);
|
||||
//out.addAll(cellInventory.getContents());
|
||||
for (IAEFluidStack fluid : out) {
|
||||
boolean result = pattern.matcher(fluid.getFluidStack().getLocalizedName().toLowerCase())
|
||||
.find();
|
||||
@@ -82,12 +80,12 @@ public class NEISearchFilter implements SearchTokenParser.ISearchParserProvider
|
||||
if (inventory instanceof final CellInventoryHandler handler) {
|
||||
final ICellInventory cellInventory = handler.getCellInv();
|
||||
if (cellInventory != null) {
|
||||
final IItemList<IAEItemStack> out = AEApi.instance().storage().createItemFilterList();
|
||||
for (IAEItemStack item : handler.getPartitionList().getItems())
|
||||
out.add(item);
|
||||
final IItemList<IAEStack<?>> out = AEApi.instance().storage().createAEStackList();
|
||||
for (Object item : handler.getPartitionList().getItems())
|
||||
out.add((IAEStack<?>) item);
|
||||
cellInventory.getAvailableItems(out, IterationCounter.fetchNewId());
|
||||
for ( IAEItemStack item : out) {
|
||||
boolean result = pattern.matcher(item.getItemStack().getDisplayName().toLowerCase())
|
||||
for (IAEStack<?> item : out) {
|
||||
boolean result = pattern.matcher(item.getDisplayName().toLowerCase())
|
||||
.find();
|
||||
if (result) return true;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user