Skip to content

Commit

Permalink
NEI fix, sorta
Browse files Browse the repository at this point in the history
- Added ability to disable NEI registration for #322
- Forgot to add the config option for forcing texture binding last push,
so it's there now.
- Tossed an unnecessary variable.
  • Loading branch information
EternalBlueFlame committed Sep 18, 2017
1 parent 8837415 commit 418e412
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
3 changes: 3 additions & 0 deletions src/main/java/train/common/core/handlers/ConfigHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public class ConfigHandler {
public static boolean RETROGEN_CHUNKS;
public static boolean MAKE_MODPACKS_GREAT_AGAIN;
public static boolean FORCE_TEXTURE_BINDING;
public static boolean DISABLE_NEI_RECIPES;



Expand Down Expand Up @@ -66,7 +67,9 @@ public static void init(File configFile) {
MAKE_MODPACKS_GREAT_AGAIN = cf.getBoolean("MAKE_MODPACKS_GREAT_AGAIN", CATEGORY_GENERAL, false,
"This will disable some of Traincrafts easier recipes to balance Modpacks");
WINDMILL_CHECK_RADIUS = cf.getInt("WINDMILL_CHECK_RADIUS", CATEGORY_GENERAL, 1, -1, 10, "This sets the radius for the can-see-the-sky-check area around the windmill. 0=only location of windmill, 1=3x3, 2=5x5 etc. Use -1 to turn of this check completely. DEFAULT: 1");
FORCE_TEXTURE_BINDING = cf.get(CATEGORY_GENERAL, "Force_Texture_Binding", true, "Enable this if trains and rollingstock are using block/item textures").getBoolean(true);
FORCE_TEXTURE_BINDING = cf.get(CATEGORY_GENERAL, "Force_Texture_Binding", true, "Enable this if trains and rollingstock are using block/item textures").getBoolean(false);
DISABLE_NEI_RECIPES = cf.get(CATEGORY_GENERAL, "DISABLE_NEI_RECIPES", false, "disables our system of registering recipes with NEI, enable this if you have your own crafting system").getBoolean(false);

} catch (Exception e) {
Traincraft.tcLog.fatal("Traincraft had a problem loading its configuration\n" + e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ public static List assemblyListCleaner(List recipeList) {
ArrayList outputList = new ArrayList();
ArrayList cleanedList = new ArrayList();
for (int i = 0; i < recipeList.size(); i++) {
ItemStack output = ((TierRecipe) recipeList.get(i)).getOutput();
//ItemStack output = ((TierRecipe) recipeList.get(i)).getOutput();
if (outputList != null) {
if (!outputList.contains(Item.getIdFromItem(((TierRecipe) recipeList.get(i)).getOutput().getItem()))) {
cleanedList.add(recipeList.get(i));
Expand Down
19 changes: 11 additions & 8 deletions src/main/java/train/common/core/plugins/NEITraincraftConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,22 @@
import codechicken.nei.api.IConfigureNEI;
import cpw.mods.fml.common.Mod;
import train.common.Traincraft;
import train.common.core.handlers.ConfigHandler;

public class NEITraincraftConfig implements IConfigureNEI {

@Override
public void loadConfig() {
API.registerRecipeHandler(new NEITraincraftWorkbenchRecipePlugin());
API.registerUsageHandler(new NEITraincraftWorkbenchRecipePlugin());
API.registerRecipeHandler(new NEIAssemblyTableRecipePlugin());
API.registerUsageHandler(new NEIAssemblyTableRecipePlugin());
API.registerRecipeHandler(new NEIOpenHearthFurnaceRecipePlugin());
API.registerUsageHandler(new NEIOpenHearthFurnaceRecipePlugin());
API.registerRecipeHandler(new NEIDistillationTowerRecipePlugin());
API.registerUsageHandler(new NEIDistillationTowerRecipePlugin());
if (ConfigHandler.DISABLE_NEI_RECIPES) {
API.registerRecipeHandler(new NEITraincraftWorkbenchRecipePlugin());
API.registerUsageHandler(new NEITraincraftWorkbenchRecipePlugin());
API.registerRecipeHandler(new NEIAssemblyTableRecipePlugin());
API.registerUsageHandler(new NEIAssemblyTableRecipePlugin());
API.registerRecipeHandler(new NEIOpenHearthFurnaceRecipePlugin());
API.registerUsageHandler(new NEIOpenHearthFurnaceRecipePlugin());
API.registerRecipeHandler(new NEIDistillationTowerRecipePlugin());
API.registerUsageHandler(new NEIDistillationTowerRecipePlugin());
}
}

@Override
Expand Down

0 comments on commit 418e412

Please sign in to comment.