This commit is contained in:
Jared 2016-08-28 16:16:56 +02:00
parent b548e77eac
commit 4ebb12efe6
3 changed files with 31 additions and 9 deletions

View file

@ -25,7 +25,7 @@ public abstract class ForestryListAddition<T extends IForestryRecipe, C extends
protected abstract String getRecipeInfo(T recipe); protected abstract String getRecipeInfo(T recipe);
@Override @Override
public final void apply() { public void apply() {
for (T recipe : recipes) { for (T recipe : recipes) {
if (recipe != null) { if (recipe != null) {
if (craftingProvider.addRecipe(recipe)) { if (craftingProvider.addRecipe(recipe)) {

View file

@ -20,7 +20,7 @@ public abstract class ForestryListRemoval<T extends IForestryRecipe, C extends I
protected abstract String getRecipeInfo(T recipe); protected abstract String getRecipeInfo(T recipe);
@Override @Override
public final void apply() { public void apply() {
for (T recipe : recipes) { for (T recipe : recipes) {
if (recipe != null) { if (recipe != null) {
if (craftingProvider.removeRecipe(recipe)) { if (craftingProvider.removeRecipe(recipe)) {

View file

@ -4,6 +4,7 @@ import forestry.api.recipes.ICarpenterManager;
import forestry.api.recipes.ICarpenterRecipe; import forestry.api.recipes.ICarpenterRecipe;
import forestry.api.recipes.IDescriptiveRecipe; import forestry.api.recipes.IDescriptiveRecipe;
import forestry.api.recipes.RecipeManagers; import forestry.api.recipes.RecipeManagers;
import forestry.factory.recipes.CarpenterRecipeManager;
import minetweaker.MineTweakerAPI; import minetweaker.MineTweakerAPI;
import minetweaker.api.item.IIngredient; import minetweaker.api.item.IIngredient;
import minetweaker.api.item.IItemStack; import minetweaker.api.item.IItemStack;
@ -69,6 +70,17 @@ public class Carpenter {
recipes.add(recipe); recipes.add(recipe);
} }
@Override
public void apply() {
super.apply();
successful.forEach(ent -> {
if (!CarpenterRecipeManager.getRecipeFluids().contains(ent.getFluidResource().getFluid())) {
CarpenterRecipeManager.getRecipeFluids().add(ent.getFluidResource().getFluid());
}
});
}
@Override @Override
protected String getRecipeInfo(ICarpenterRecipe recipe) { protected String getRecipeInfo(ICarpenterRecipe recipe) {
return LogHelper.getStackDescription(recipe.getCraftingGridRecipe().getRecipeOutput()); return LogHelper.getStackDescription(recipe.getCraftingGridRecipe().getRecipeOutput());
@ -126,6 +138,16 @@ public class Carpenter {
super(Carpenter.name, RecipeManagers.carpenterManager, recipes); super(Carpenter.name, RecipeManagers.carpenterManager, recipes);
} }
@Override
public void apply() {
super.apply();
successful.forEach(ent -> {
if (CarpenterRecipeManager.getRecipeFluids().contains(ent.getFluidResource().getFluid())) {
CarpenterRecipeManager.getRecipeFluids().remove(ent.getFluidResource().getFluid());
}
});
}
@Override @Override
protected String getRecipeInfo(ICarpenterRecipe recipe) { protected String getRecipeInfo(ICarpenterRecipe recipe) {
return LogHelper.getStackDescription(recipe.getCraftingGridRecipe().getRecipeOutput()); return LogHelper.getStackDescription(recipe.getCraftingGridRecipe().getRecipeOutput());