Package appeng.api.integrations.emi
Interface EmiStackConverter
public interface EmiStackConverter
Implement this interface to provide AE2s EMI integration with a new way to convert between AE2
GenericStack
and EmiStack
.
- Recipe transfers
- Pressing R/U on custom stacks in AE2 user interfaces
- Dragging ghost items of custom types from EMI to AE2 interfaces
EmiStackConverters
.-
Method Summary
Modifier and TypeMethodDescriptionClass
<?> The EMIkey type
handled by this converter.@Nullable dev.emi.emi.api.stack.EmiStack
toEmiStack
(GenericStack stack) Converts a generic stack into an EmiStack subtype handled by this converter.@Nullable GenericStack
toGenericStack
(dev.emi.emi.api.stack.EmiStack stack) Converts an EmiStack handled by this converter into a generic stack.
-
Method Details
-
getKeyType
Class<?> getKeyType()The EMIkey type
handled by this converter. AE2 handlesFluid
andItem
already. -
toEmiStack
Converts a generic stack into an EmiStack subtype 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.
-
toGenericStack
Converts an EmiStack handled by this converter into a generic stack.- Returns:
- Null if the ingredient represents an "empty" ingredient (i.e.
EmiStack.EMPTY
.
-