Package appeng.api.integrations.jei
Interface IngredientConverter<T>
public interface IngredientConverter<T>
Implement this interface to provide AE2s JEI integration with a new ingredient type converter for use in:
- Recipe transfers
- Pressing R/U on custom stacks in AE2 user interfaces
- Dragging ghost items of custom types from JEI to AE2 interfaces
ServiceLoader file
(/META-INF/services/appeng.api.integrations.jei.IngredientTypeConverter).-
Method Summary
Modifier and TypeMethodDescriptionConverts a generic stack into one of the ingredient handled by this converter.mezz.jei.api.ingredients.IIngredientType<T>The JEI ingredient type handled by this converter.@Nullable GenericStackgetStackFromIngredient(T ingredient) Converts an ingredient handled by this converter into a generic stack.
-
Method Details
-
getIngredientType
mezz.jei.api.ingredients.IIngredientType<T> getIngredientType()The JEI ingredient type handled by this converter. -
getIngredientFromStack
Converts a generic stack into one of the ingredient handled by this converter. The converter needs to ensure the minimum amount of the returned ingredient is 1 if the resulting ingredient represents amounts of 0 as "empty", since this would not preserve the ingredient type correctly. Example:Math.max(1, Ints.saturatedCast(stack.amount()))(for Item and Fluid stacks).- Returns:
- Null if the converter can't handle the stack.
-
getStackFromIngredient
Converts an ingredient handled by this converter into a generic stack.- Returns:
- Null if the ingredient represents an "empty" ingredient (i.e.
ItemStack.EMPTY.
-