Skip to content

Commit

Permalink
Remove bottler recipes from JEI
Browse files Browse the repository at this point in the history
  • Loading branch information
thedarkcolour committed Sep 4, 2024
1 parent cf714ba commit 1dc2442
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 263 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## Forestry 1.0.8
- Remove bottler recipes from JEI

## Forestry 1.0.7
- Sort products displayed in JEI by their chances
- Fix mating behaviour of unmated queens (ex. from Creative Menu)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@
import forestry.api.recipes.ISqueezerRecipe;
import forestry.api.recipes.IStillRecipe;
import forestry.factory.MachineUIDs;
import forestry.factory.recipes.jei.bottler.BottlerRecipe;
import mezz.jei.api.recipe.RecipeType;

public class ForestryRecipeType {
public static final RecipeType<BottlerRecipe> BOTTLER = create(MachineUIDs.BOTTLER, BottlerRecipe.class);
public static final RecipeType<ICarpenterRecipe> CARPENTER = create(MachineUIDs.CARPENTER, ICarpenterRecipe.class);
public static final RecipeType<ICentrifugeRecipe> CENTRIFUGE = create(MachineUIDs.CENTRIFUGE, ICentrifugeRecipe.class);
public static final RecipeType<IFabricatorRecipe> FABRICATOR = create(MachineUIDs.FABRICATOR, IFabricatorRecipe.class);
Expand Down
60 changes: 11 additions & 49 deletions src/main/java/forestry/factory/recipes/jei/FactoryJeiPlugin.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package forestry.factory.recipes.jei;

import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;

Expand Down Expand Up @@ -30,16 +29,13 @@
import forestry.factory.blocks.BlockTypeFactoryTesr;
import forestry.factory.features.FactoryBlocks;
import forestry.factory.features.FactoryRecipeTypes;
import forestry.factory.gui.GuiBottler;
import forestry.factory.gui.GuiCarpenter;
import forestry.factory.gui.GuiCentrifuge;
import forestry.factory.gui.GuiFabricator;
import forestry.factory.gui.GuiFermenter;
import forestry.factory.gui.GuiMoistener;
import forestry.factory.gui.GuiSqueezer;
import forestry.factory.gui.GuiStill;
import forestry.factory.recipes.jei.bottler.BottlerRecipeCategory;
import forestry.factory.recipes.jei.bottler.BottlerRecipeMaker;
import forestry.factory.recipes.jei.carpenter.CarpenterRecipeCategory;
import forestry.factory.recipes.jei.carpenter.CarpenterRecipeTransferHandler;
import forestry.factory.recipes.jei.centrifuge.CentrifugeRecipeCategory;
Expand All @@ -58,7 +54,6 @@
import mezz.jei.api.helpers.IGuiHelper;
import mezz.jei.api.helpers.IJeiHelpers;
import mezz.jei.api.ingredients.subtypes.IIngredientSubtypeInterpreter;
import mezz.jei.api.recipe.category.IRecipeCategory;
import mezz.jei.api.registration.IGuiHandlerRegistration;
import mezz.jei.api.registration.IRecipeCatalystRegistration;
import mezz.jei.api.registration.IRecipeCategoryRegistration;
Expand All @@ -78,52 +73,22 @@ public void registerCategories(IRecipeCategoryRegistration registry) {
IJeiHelpers jeiHelpers = registry.getJeiHelpers();
IGuiHelper guiHelper = jeiHelpers.getGuiHelper();

List<IRecipeCategory<?>> categories = new ArrayList<>();

if (true) {
categories.add(new BottlerRecipeCategory(guiHelper));
}

if (true) {
categories.add(new CarpenterRecipeCategory(guiHelper));
}

if (true) {
categories.add(new CentrifugeRecipeCategory(guiHelper));
}

if (true) {
categories.add(new FabricatorRecipeCategory(guiHelper));
}

if (true) {
categories.add(new FermenterRecipeCategory(guiHelper));
}

if (true) {
categories.add(new MoistenerRecipeCategory(guiHelper));
}

if (true) {
categories.add(new RainmakerRecipeCategory(guiHelper));
}

if (true) {
categories.add(new SqueezerRecipeCategory(guiHelper));
}

if (true) {
categories.add(new StillRecipeCategory(guiHelper));
}

registry.addRecipeCategories(categories.toArray(new IRecipeCategory[0]));
registry.addRecipeCategories(
new CarpenterRecipeCategory(guiHelper),
new CentrifugeRecipeCategory(guiHelper),
new FabricatorRecipeCategory(guiHelper),
new FermenterRecipeCategory(guiHelper),
new MoistenerRecipeCategory(guiHelper),
new RainmakerRecipeCategory(guiHelper),
new SqueezerRecipeCategory(guiHelper),
new StillRecipeCategory(guiHelper)
);
}

@Override
public void registerRecipes(IRecipeRegistration registry) {
RecipeManager manager = ClientsideCode.getRecipeManager();

registry.addRecipes(ForestryRecipeType.BOTTLER, BottlerRecipeMaker.getBottlerRecipes(registry.getIngredientManager()));
registry.addRecipes(ForestryRecipeType.CARPENTER, RecipeUtils.getRecipes(manager, FactoryRecipeTypes.CARPENTER).toList());
registry.addRecipes(ForestryRecipeType.CENTRIFUGE, RecipeUtils.getRecipes(manager, FactoryRecipeTypes.CENTRIFUGE).toList());
registry.addRecipes(ForestryRecipeType.FABRICATOR, RecipeUtils.getRecipes(manager, FactoryRecipeTypes.FABRICATOR).toList());
Expand All @@ -137,6 +102,7 @@ public void registerRecipes(IRecipeRegistration registry) {

BlockFactoryPlain rainTank = FactoryBlocks.PLAIN.get(BlockTypeFactoryPlain.RAINTANK).block();
JeiUtil.addDescription(registry, rainTank);
JeiUtil.addDescription(registry, FactoryBlocks.TESR.get(BlockTypeFactoryTesr.BOTTLER).block());
}

@Override
Expand All @@ -147,7 +113,6 @@ public void registerRecipeTransferHandlers(IRecipeTransferRegistration registry)

@Override
public void registerRecipeCatalysts(IRecipeCatalystRegistration registry) {
registry.addRecipeCatalyst(new ItemStack(FactoryBlocks.TESR.get(BlockTypeFactoryTesr.BOTTLER).block()), ForestryRecipeType.BOTTLER);
registry.addRecipeCatalyst(new ItemStack(FactoryBlocks.TESR.get(BlockTypeFactoryTesr.CARPENTER).block()), ForestryRecipeType.CARPENTER);
registry.addRecipeCatalyst(new ItemStack(FactoryBlocks.TESR.get(BlockTypeFactoryTesr.CENTRIFUGE).block()), ForestryRecipeType.CENTRIFUGE);
registry.addRecipeCatalyst(new ItemStack(FactoryBlocks.PLAIN.get(BlockTypeFactoryPlain.FABRICATOR).block()), ForestryRecipeType.FABRICATOR);
Expand All @@ -162,9 +127,6 @@ public void registerRecipeCatalysts(IRecipeCatalystRegistration registry) {
public void registerGuiHandlers(IGuiHandlerRegistration registry) {
registry.addGenericGuiContainerHandler(GuiForestry.class, new ForestryAdvancedGuiHandler());

registry.addRecipeClickArea(GuiBottler.class, 107, 33, 26, 22, ForestryRecipeType.BOTTLER);
registry.addRecipeClickArea(GuiBottler.class, 45, 33, 26, 22, ForestryRecipeType.BOTTLER);

registry.addRecipeClickArea(GuiCarpenter.class, 98, 48, 21, 26, ForestryRecipeType.CARPENTER);

registry.addRecipeClickArea(GuiCentrifuge.class, 38, 22, 38, 14, ForestryRecipeType.CENTRIFUGE);
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 1 addition & 0 deletions src/main/resources/assets/forestry/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -2168,6 +2168,7 @@
"for.jei.description.miner_bag": "Extra inventory that automatically picks up ores and valuable mining-related item.",
"for.jei.description.apiarist_bag": "Extra inventory that automatically picks up bees.",
"for.jei.description.lepidopterist_bag": "Extra inventory that automatically picks up butterflies.",
"for.jei.description.bottler": "Used to empty and fill containers with fluids.",
"_comment": "###################",
"_comment": "JEI Recipes",
"_comment": "###################",
Expand Down

0 comments on commit 1dc2442

Please sign in to comment.