use of top.theillusivec4.polymorph.mixin.integration.cyclic.AccessorTileCrafter in project Polymorph by TheIllusiveC4.
the class CyclicModule method selectRecipe.
@SuppressWarnings("ConstantConditions")
@Override
public boolean selectRecipe(BlockEntity tileEntity, Recipe<?> recipe) {
if (tileEntity instanceof TileCrafter) {
AccessorTileCrafter tileCrafter = (AccessorTileCrafter) tileEntity;
tileCrafter.setLastValidRecipe(recipe);
tileCrafter.setRecipeOutput(recipe.getResultItem());
LazyOptional<IItemHandler> preview = tileCrafter.getPreview();
if (preview != null) {
tileCrafter.callSetPreviewSlot(preview.orElse(null), recipe.getResultItem());
}
return true;
}
return false;
}
Aggregations