Add filter tooltip to partitioned storage cells

This commit is contained in:
Matej Dipčár committed 2022-10-10 06:17:04 +02:00
1 parent 1a2ba79745
commit 7eb22f8720
3 files changed
+17

No files matched your search

@@ -30,6 +30,7 @@ import com.google.common.base.Optional;
import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
@@ -140,6 +141,14 @@ public class ItemBasicFluidStorageCell extends AEBaseItem implements IStorageFlu
{
final String list = (handler.getIncludeExcludeMode() == IncludeExclude.WHITELIST ? GuiText.Included : GuiText.Excluded).getLocal();
lines.add(GuiText.Partitioned.getLocal() + " - " + list + ' ' + GuiText.Precise.getLocal());
if (GuiScreen.isShiftKeyDown())
{
lines.add(GuiText.Filter.getLocal() + ": ");
for (IAEFluidStack aeFluidStack : handler.getPartitionInv()) {
if (aeFluidStack != null) lines.add(" " + aeFluidStack.getFluidStack().getLocalizedName());
}
}
}
}
}
@@ -54,6 +54,11 @@ public class FluidCellInventoryHandler extends MEInventoryHandler<IAEFluidStack>
return (IFluidCellInventory) ( o instanceof IFluidCellInventory ? o : null );
}
@Override
public Iterable<IAEFluidStack> getPartitionInv() {
return (Iterable<IAEFluidStack>) Ae2Reflect.getPartitionList(this).getItems();
}
@Override
public boolean isPreformatted()
{
@@ -1,11 +1,14 @@
package com.glodblock.github.common.storage;
import appeng.api.config.IncludeExclude;
import appeng.api.storage.data.IAEFluidStack;
public interface IFluidCellInventoryHandler {
IFluidCellInventory getCellInv();
Iterable<IAEFluidStack> getPartitionInv();
boolean isPreformatted();
IncludeExclude getIncludeExcludeMode();