diff options
| author | Danielshe <shekwancheung0528@gmail.com> | 2019-11-03 19:02:00 +0800 |
|---|---|---|
| committer | Danielshe <shekwancheung0528@gmail.com> | 2019-11-03 19:02:00 +0800 |
| commit | ad7f945d6f724d51ee843b334838fda84c6197f2 (patch) | |
| tree | b67cd5a1b95826435ef54813e4221ff3fda39212 /src/main/java/me/shedaniel/rei/plugin/autocrafting/DefaultRecipeBookHandler.java | |
| parent | 9f5a9eae9a7863412cc5eb433bf15e5ee71da616 (diff) | |
| download | RoughlyEnoughItems-ad7f945d6f724d51ee843b334838fda84c6197f2.tar.gz RoughlyEnoughItems-ad7f945d6f724d51ee843b334838fda84c6197f2.tar.bz2 RoughlyEnoughItems-ad7f945d6f724d51ee843b334838fda84c6197f2.zip | |
API Changes
Diffstat (limited to 'src/main/java/me/shedaniel/rei/plugin/autocrafting/DefaultRecipeBookHandler.java')
| -rw-r--r-- | src/main/java/me/shedaniel/rei/plugin/autocrafting/DefaultRecipeBookHandler.java | 33 |
1 files changed, 3 insertions, 30 deletions
diff --git a/src/main/java/me/shedaniel/rei/plugin/autocrafting/DefaultRecipeBookHandler.java b/src/main/java/me/shedaniel/rei/plugin/autocrafting/DefaultRecipeBookHandler.java index fcfdc7b28..564a6e449 100644 --- a/src/main/java/me/shedaniel/rei/plugin/autocrafting/DefaultRecipeBookHandler.java +++ b/src/main/java/me/shedaniel/rei/plugin/autocrafting/DefaultRecipeBookHandler.java @@ -10,6 +10,7 @@ import me.shedaniel.rei.api.RecipeDisplay; import me.shedaniel.rei.impl.ScreenHelper; import me.shedaniel.rei.listeners.RecipeBookGuiHooks; import me.shedaniel.rei.plugin.blasting.DefaultBlastingDisplay; +import me.shedaniel.rei.plugin.cooking.DefaultCookingDisplay; import me.shedaniel.rei.plugin.crafting.DefaultCraftingDisplay; import me.shedaniel.rei.plugin.smelting.DefaultSmeltingDisplay; import me.shedaniel.rei.plugin.smoking.DefaultSmokingDisplay; @@ -54,36 +55,8 @@ public class DefaultRecipeBookHandler implements AutoTransferHandler { context.getMinecraft().interactionManager.clickRecipe(container.syncId, recipe, Screen.hasShiftDown()); ScreenHelper.getLastOverlay().init(); } - } else if (display instanceof DefaultSmeltingDisplay) { - DefaultSmeltingDisplay defaultDisplay = (DefaultSmeltingDisplay) display; - if (defaultDisplay.getOptionalRecipe().isPresent()) { - Recipe<?> recipe = (defaultDisplay).getOptionalRecipe().get(); - if (!context.getMinecraft().player.getRecipeBook().contains(recipe)) - return Result.createFailed(I18n.translate("error.rei.recipe.not.unlocked")); - if (!context.isActuallyCrafting()) - return Result.createSuccessful(); - context.getMinecraft().openScreen(context.getContainerScreen()); - if (context.getContainerScreen() instanceof RecipeBookProvider) - ((RecipeBookGuiHooks) ((RecipeBookProvider) context.getContainerScreen()).getRecipeBookGui()).rei_getGhostSlots().reset(); - context.getMinecraft().interactionManager.clickRecipe(container.syncId, recipe, Screen.hasShiftDown()); - ScreenHelper.getLastOverlay().init(); - } - } else if (display instanceof DefaultSmokingDisplay) { - DefaultSmokingDisplay defaultDisplay = (DefaultSmokingDisplay) display; - if (defaultDisplay.getOptionalRecipe().isPresent()) { - Recipe<?> recipe = (defaultDisplay).getOptionalRecipe().get(); - if (!context.getMinecraft().player.getRecipeBook().contains(recipe)) - return Result.createFailed(I18n.translate("error.rei.recipe.not.unlocked")); - if (!context.isActuallyCrafting()) - return Result.createSuccessful(); - context.getMinecraft().openScreen(context.getContainerScreen()); - if (context.getContainerScreen() instanceof RecipeBookProvider) - ((RecipeBookGuiHooks) ((RecipeBookProvider) context.getContainerScreen()).getRecipeBookGui()).rei_getGhostSlots().reset(); - context.getMinecraft().interactionManager.clickRecipe(container.syncId, recipe, Screen.hasShiftDown()); - ScreenHelper.getLastOverlay().init(); - } - } else if (display instanceof DefaultBlastingDisplay) { - DefaultBlastingDisplay defaultDisplay = (DefaultBlastingDisplay) display; + } else if (display instanceof DefaultCookingDisplay) { + DefaultCookingDisplay defaultDisplay = (DefaultCookingDisplay) display; if (defaultDisplay.getOptionalRecipe().isPresent()) { Recipe<?> recipe = (defaultDisplay).getOptionalRecipe().get(); if (!context.getMinecraft().player.getRecipeBook().contains(recipe)) |
