From e150175b3d35020199ceae0d4f18bae1a7aea022 Mon Sep 17 00:00:00 2001 From: koolkrafter5 Date: Fri, 20 Mar 2026 18:25:07 -0400 Subject: [PATCH] Clean up floating flower handler and let it work with the inventory crafting grid --- .../recipe/RecipeHandlerFloatingFlowers.java | 97 ++++++++++--------- 1 file changed, 51 insertions(+), 46 deletions(-) diff --git a/src/main/java/vazkii/botania/client/integration/nei/recipe/RecipeHandlerFloatingFlowers.java b/src/main/java/vazkii/botania/client/integration/nei/recipe/RecipeHandlerFloatingFlowers.java index 2c3a3a832..e3dd9daf1 100644 --- a/src/main/java/vazkii/botania/client/integration/nei/recipe/RecipeHandlerFloatingFlowers.java +++ b/src/main/java/vazkii/botania/client/integration/nei/recipe/RecipeHandlerFloatingFlowers.java @@ -17,65 +17,70 @@ import codechicken.nei.recipe.TemplateRecipeHandler; public class RecipeHandlerFloatingFlowers extends TemplateRecipeHandler { - public class CachedFloatingFlowerRecipe extends CachedRecipe { + public class CachedFloatingFlowerRecipe extends CachedRecipe { - public List inputs = new ArrayList<>(); - public PositionedStack output; + public List inputs = new ArrayList<>(); + public PositionedStack output; - public CachedFloatingFlowerRecipe(ItemStack floatingFlower, ItemStack specialFlower, ItemStack output) { - inputs.add(new PositionedStack(floatingFlower, 25, 6)); - inputs.add(new PositionedStack(specialFlower, 43, 6)); - this.output = new PositionedStack(output, 119, 24); - this.output.setMaxSize(1); - } + public CachedFloatingFlowerRecipe(ItemStack floatingFlower, ItemStack specialFlower, ItemStack output) { + inputs.add(new PositionedStack(floatingFlower, 25, 6)); + inputs.add(new PositionedStack(specialFlower, 43, 6)); + this.output = new PositionedStack(output, 119, 24); + this.output.setMaxSize(1); + } - @Override - public List getIngredients() { - return inputs; - } + @Override + public List getIngredients() { + return inputs; + } - @Override - public PositionedStack getResult() { - return output; - } + @Override + public PositionedStack getResult() { + return output; + } - } + } + + @Override + public String getRecipeName() { + return StatCollector.translateToLocal("botania.nei.floatingFlowers"); + } @Override - public String getRecipeName() { - return StatCollector.translateToLocal("botania.nei.floatingFlowers"); + public String getOverlayIdentifier() { + return "crafting2x2"; } - @Override - public void loadTransferRects() { - transferRects.add(new RecipeTransferRect(new Rectangle(84, 23, 24, 18), "crafting")); - } + @Override + public void loadTransferRects() { + transferRects.add(new RecipeTransferRect(new Rectangle(84, 23, 24, 18), "crafting")); + } - @Override - public String getGuiTexture() { - return "textures/gui/container/crafting_table.png"; - } + @Override + public String getGuiTexture() { + return "textures/gui/container/crafting_table.png"; + } - @Override - public void loadCraftingRecipes(ItemStack result) { - if(Block.getBlockFromItem(result.getItem()) instanceof BlockFloatingSpecialFlower) { - ItemStack floatingFlower = new ItemStack(ModBlocks.floatingFlower, 1, OreDictionary.WILDCARD_VALUE); - ItemStack specialFlower = new ItemStack(ModBlocks.specialFlower); - specialFlower.setTagCompound((NBTTagCompound) result.getTagCompound().copy()); + @Override + public void loadCraftingRecipes(ItemStack result) { + if (Block.getBlockFromItem(result.getItem()) instanceof BlockFloatingSpecialFlower) { + ItemStack floatingFlower = new ItemStack(ModBlocks.floatingFlower, 1, OreDictionary.WILDCARD_VALUE); + ItemStack specialFlower = new ItemStack(ModBlocks.specialFlower); + specialFlower.setTagCompound((NBTTagCompound) result.getTagCompound().copy()); - arecipes.add(new CachedFloatingFlowerRecipe(floatingFlower, specialFlower, result.copy())); - } - } + arecipes.add(new CachedFloatingFlowerRecipe(floatingFlower, specialFlower, result.copy())); + } + } - @Override - public void loadUsageRecipes(ItemStack ingredient) { - if(Block.getBlockFromItem(ingredient.getItem()) instanceof BlockSpecialFlower) { - ItemStack floatingFlower = new ItemStack(ModBlocks.floatingFlower, 1, OreDictionary.WILDCARD_VALUE); - ItemStack result = new ItemStack(ModBlocks.floatingSpecialFlower); - result.setTagCompound((NBTTagCompound) ingredient.getTagCompound().copy()); + @Override + public void loadUsageRecipes(ItemStack ingredient) { + if (Block.getBlockFromItem(ingredient.getItem()) instanceof BlockSpecialFlower) { + ItemStack floatingFlower = new ItemStack(ModBlocks.floatingFlower, 1, OreDictionary.WILDCARD_VALUE); + ItemStack result = new ItemStack(ModBlocks.floatingSpecialFlower); + result.setTagCompound((NBTTagCompound) ingredient.getTagCompound().copy()); - arecipes.add(new CachedFloatingFlowerRecipe(floatingFlower, ingredient.copy(), result)); - } - } + arecipes.add(new CachedFloatingFlowerRecipe(floatingFlower, ingredient.copy(), result)); + } + } }