add BuildCraft support

This commit is contained in:
vfyjxf committed 2021-08-18 18:15:42 +08:00
1 parent ae0e23eac5
commit 52d3059e43
8 files changed
+61 -7

No files matched your search

+2 -1
View File
@@ -17,7 +17,7 @@ This mod removes that functionality and allows the player to use NEI's transfer
- Combine like stacks in processing patterns.
- Support Processing Pattern Terminal(16 -> 4 mode).
- Allow you to add item blackList and item priority list, if item in them, it will not be transferred / transfer it first.(use /nee RecipeProcessor to get RecipeProcessor and identifier in log)
- Allow you to add mod priority list,if it's the mod's item,it will be use first.
- Allow you to add mod priority list,if the mod's has this item,it will be use first.
## Compatible Modslist as followed:
@@ -35,6 +35,7 @@ This mod removes that functionality and allows the player to use NEI's transfer
- [x] ImmersiveEngineering
- [x] Mekanism
- [x] BloodMagic
- [x] BuildCraft
If you want other Mod support,see [RecipeProcessor](./src/main/java/com/github/vfyjxf/nee/processor/RecipeProcessor.java) and [Mod support Issue](https://github.com/vfyjxf/NotEnoughEnergistics/issues/1)
+1
View File
@@ -30,6 +30,7 @@ NotEnoughEnergistics 是[Just Enough Energistics](https://www.curseforge.com/min
- [x] ImmersiveEngineering
- [x] Mekanism
- [x] BloodMagic
- [x] BuildCraft
如果你想要别的Mod的支持,请看[RecipeProcessor](./src/main/java/com/github/vfyjxf/nee/processor/RecipeProcessor.java) 或者[模组支持处理区](https://github.com/vfyjxf/NotEnoughEnergistics/issues/1)
+1 -1
View File
@@ -6,7 +6,7 @@ org.gradle.daemon=false
mc_version=1.7.10
nei_version=2.1.6-GTNH
ae2_version=rv3-beta-52-GTNH
mod_version=1.2.4
mod_version=1.2.5
forge_version=10.13.4.1614
mod_group=com.github.vfyjxf.neenergistics
mod_id=neenergistics
Binary file not shown.
Binary file not shown.
@@ -73,14 +73,13 @@ public class NEECraftingHandler implements IOverlayHandler {
tInputs.add(positionedStack);
}
}
for (PositionedStack positionedStack : tInputs) {
ItemStack currentStack = positionedStack.item;
currentStack.stackSize = positionedStack.items[0].stackSize;
ItemStack currentStack = positionedStack.items[0];
ItemStack preferModItem = ItemUtils.getPreferModItem(positionedStack.items);
if (preferModItem != null) {
currentStack = preferModItem;
currentStack.stackSize = positionedStack.items[0].stackSize;
}
for (ItemStack stack : positionedStack.items) {
@@ -138,7 +137,7 @@ public class NEECraftingHandler implements IOverlayHandler {
}
private void knowledgeInscriberHandler(GuiContainer firstGui, IRecipeHandler recipe, int recipeIndex) {
Class<?> knowledgeInscriberClz = null;
Class<?> knowledgeInscriberClz;
try {
knowledgeInscriberClz = Class.forName("thaumicenergistics.client.gui.GuiKnowledgeInscriber");
} catch (ClassNotFoundException e) {
@@ -0,0 +1,49 @@
package com.github.vfyjxf.nee.processor;
import buildcraft.compat.nei.RecipeHandlerAssemblyTable;
import buildcraft.compat.nei.RecipeHandlerIntegrationTable;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.IRecipeHandler;
import java.util.Collections;
import java.util.List;
/**
* @author vfyjxf
*/
public class BuildCraftRecipeProcessor implements IRecipeProcessor {
@Override
public String getRecipeProcessorId() {
return "BuildCraft";
}
@Override
public List<PositionedStack> getRecipeInput(IRecipeHandler recipe, int recipeIndex, String identifier) {
if (recipe instanceof RecipeHandlerAssemblyTable) {
return handlerAssemblyTableRecipe((RecipeHandlerAssemblyTable) recipe, recipeIndex, true);
} else if (recipe instanceof RecipeHandlerIntegrationTable) {
return handlerIntegrationTableRecipe((RecipeHandlerIntegrationTable) recipe, recipeIndex, true);
}
return null;
}
@Override
public List<PositionedStack> getRecipeOutput(IRecipeHandler recipe, int recipeIndex, String identifier) {
if (recipe instanceof RecipeHandlerAssemblyTable) {
return handlerAssemblyTableRecipe((RecipeHandlerAssemblyTable) recipe, recipeIndex, false);
} else if (recipe instanceof RecipeHandlerIntegrationTable) {
return handlerIntegrationTableRecipe((RecipeHandlerIntegrationTable) recipe, recipeIndex, false);
}
return null;
}
private List<PositionedStack> handlerAssemblyTableRecipe(RecipeHandlerAssemblyTable recipe, int recipeIndex, boolean getInput) {
return getInput ? recipe.getIngredientStacks(recipeIndex) : Collections.singletonList(recipe.getResultStack(recipeIndex));
}
private List<PositionedStack> handlerIntegrationTableRecipe(RecipeHandlerIntegrationTable recipe, int recipeIndex, boolean getInput) {
return getInput ? recipe.getIngredientStacks(recipeIndex) : Collections.singletonList(recipe.getResultStack(recipeIndex));
}
}
@@ -58,6 +58,10 @@ public class RecipeProcessor {
NotEnoughEnergistics.logger.info("Found BloodMagic, install BloodMagic support");
recipeProcessors.add(new BloodMagicRecipeProcessor());
}
if(Loader.isModLoaded("BuildCraft|Compat")){
NotEnoughEnergistics.logger.info("Found BuildCraft-Compat, install BuildCraft-Compat support");
recipeProcessors.add(new BuildCraftRecipeProcessor());
}
if (Loader.isModLoaded("appliedenergistics2")) {
NotEnoughEnergistics.logger.info("Applied Energistics 2 will not be supported");
}