aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/plugin/crafting
diff options
context:
space:
mode:
authorUnknown <shekwancheung0528@gmail.com>2019-01-07 13:33:08 +0800
committerUnknown <shekwancheung0528@gmail.com>2019-01-07 13:33:08 +0800
commitea9421a3b7c7eec1fbe829ebe749acccdb4ef495 (patch)
tree47f78f2b117fe9e1383bc2845775bfed5cca7761 /src/main/java/me/shedaniel/plugin/crafting
parent1eefa6a30341086d50858aa4faa88eade408149a (diff)
downloadRoughlyEnoughItems-ea9421a3b7c7eec1fbe829ebe749acccdb4ef495.tar.gz
RoughlyEnoughItems-ea9421a3b7c7eec1fbe829ebe749acccdb4ef495.tar.bz2
RoughlyEnoughItems-ea9421a3b7c7eec1fbe829ebe749acccdb4ef495.zip
Tooltip
Diffstat (limited to 'src/main/java/me/shedaniel/plugin/crafting')
-rwxr-xr-xsrc/main/java/me/shedaniel/plugin/crafting/VanillaCraftingCategory.java8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/me/shedaniel/plugin/crafting/VanillaCraftingCategory.java b/src/main/java/me/shedaniel/plugin/crafting/VanillaCraftingCategory.java
index 50fa4ad1e..6b858f456 100755
--- a/src/main/java/me/shedaniel/plugin/crafting/VanillaCraftingCategory.java
+++ b/src/main/java/me/shedaniel/plugin/crafting/VanillaCraftingCategory.java
@@ -139,7 +139,13 @@ public class VanillaCraftingCategory implements DisplayCategoryCraftable<Vanilla
@Override
public void registerAutoCraftButton(List<Control> control, RecipeGui recipeGui, Gui parentGui, VanillaCraftingRecipe recipe, int number) {
- SmallButton button = new SmallButton(78, 75 + 6 + 36 + number * 75, 10, 10, "+");
+ SmallButton button = new SmallButton(78, 75 + 6 + 36 + number * 75, 10, 10, "+", enabled -> {
+ if (!(parentGui instanceof CraftingTableGui || parentGui instanceof PlayerInventoryGui))
+ return I18n.translate("text.auto_craft.wrong_gui");
+ if (parentGui instanceof PlayerInventoryGui && !(recipe.getHeight() < 3 && recipe.getWidth() < 3))
+ return I18n.translate("text.auto_craft.crafting.too_small");
+ return "";
+ });
button.setOnClick(mouse -> {
recipeGui.close();
MinecraftClient.getInstance().openGui(parentGui);