use of top.theillusivec4.polymorph.mixin.core.AccessorCraftingScreenHandler in project Polymorph by TheIllusiveC4.
the class FastBenchModule method selectRecipe.
@Override
public boolean selectRecipe(ScreenHandler screenHandler, Recipe<?> recipe) {
if (recipe instanceof CraftingRecipe) {
CraftingResultInventory result = null;
if (screenHandler instanceof CraftingScreenHandler) {
AccessorCraftingScreenHandler accessor = (AccessorCraftingScreenHandler) screenHandler;
result = accessor.getResult();
} else if (screenHandler instanceof PlayerScreenHandler) {
AccessorPlayerScreenHandler accessor = (AccessorPlayerScreenHandler) screenHandler;
result = accessor.getCraftingResult();
}
if (result != null) {
result.setLastRecipe(recipe);
}
}
return false;
}
Aggregations