Allow looking up recipes in JEI with non-item slots (#451)

This commit is contained in:
Yang Xizhi
2024-06-18 16:14:20 +08:00
committed by GitHub
parent 1316f035cd
commit 0a7799a664
6 changed files with 69 additions and 2 deletions
@@ -20,11 +20,13 @@ package appeng.client.me;
import appeng.api.storage.data.IAEFluidStack;
import appeng.container.interfaces.ISpecialSlotIngredient;
import appeng.fluids.container.slots.IMEFluidSlot;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraftforge.items.SlotItemHandler;
import org.jetbrains.annotations.Nullable;
import javax.annotation.Nonnull;
@@ -34,7 +36,7 @@ import javax.annotation.Nonnull;
* @version rv6 - 22/05/2018
* @since rv6 22/05/2018
*/
public class SlotFluidME extends SlotItemHandler implements IMEFluidSlot {
public class SlotFluidME extends SlotItemHandler implements IMEFluidSlot, ISpecialSlotIngredient {
private final InternalFluidSlotME slot;
@@ -95,4 +97,11 @@ public class SlotFluidME extends SlotItemHandler implements IMEFluidSlot {
public boolean canTakeStack(final EntityPlayer par1EntityPlayer) {
return false;
}
@Nullable
@Override
public Object getIngredient() {
return this.getAEFluidStack() == null ? null : this.getAEFluidStack().getFluidStack();
}
}