mirror of
https://github.com/GTNewHorizons/StorageDrawers.git
synced 2026-11-21 04:32:37 +00:00
Fix recipes; make sure fallback recipes take lower precedence
This commit is contained in:
1 parent
d22ffc2b46
commit
89e94a97ea
4 files changed
+49
-18
No files matched your search
@@ -146,6 +146,8 @@ storageDrawers.config.prop.enableSidedOutput=Enable Sided Output
|
||||
storageDrawers.config.prop.enableSidedOutput.tooltip=Other blocks can extract items from drawers.
|
||||
storageDrawers.config.prop.enableItemConversion=Enable Item Conversion
|
||||
storageDrawers.config.prop.enableItemConversion.tooltip=Drawers auto-convert ore dictionary compatible items.
|
||||
storageDrawers.config.prop.enableFallbackRecipes=Enable Fallback Recipes
|
||||
storageDrawers.config.prop.enableFallbackRecipes.tooltip=Any valid plank wood can craft oak drawers.
|
||||
storageDrawers.config.prop.invertShift=Invert Shift
|
||||
storageDrawers.config.prop.invertShift.tooltip=Inverts click and shift+click behavior.
|
||||
storageDrawers.config.prop.enableDebugLogging=Enable Debug Logging
|
||||
|
||||
@@ -73,6 +73,7 @@ public class ConfigManager
|
||||
public boolean enableMineTweakerIntegration;
|
||||
public boolean enableRefinedRelocationIntegration;
|
||||
public boolean enableTape;
|
||||
public boolean enableFallbackRecipes;
|
||||
public boolean invertShift;
|
||||
public boolean debugTrace;
|
||||
|
||||
@@ -232,6 +233,7 @@ public class ConfigManager
|
||||
cache.enableSidedInput = config.get(Configuration.CATEGORY_GENERAL, "enableSidedInput", true).setLanguageKey(LANG_PREFIX + "prop.enableSidedInput").getBoolean();
|
||||
cache.enableSidedOutput = config.get(Configuration.CATEGORY_GENERAL, "enableSidedOutput", true).setLanguageKey(LANG_PREFIX + "prop.enableSidedOutput").getBoolean();
|
||||
cache.enableItemConversion = config.get(Configuration.CATEGORY_GENERAL, "enableItemConversion", true).setLanguageKey(LANG_PREFIX + "prop.enableItemConversion").getBoolean();
|
||||
cache.enableFallbackRecipes = config.get(Configuration.CATEGORY_GENERAL, "enableFallbackRecipes", true).setLanguageKey(LANG_PREFIX + "prop.enableFallbackRecipes").setRequiresMcRestart(true).getBoolean();
|
||||
cache.invertShift = config.get(Configuration.CATEGORY_GENERAL, "invertShift", false,
|
||||
"Inverts how shift works with drawers. If this is true, shifting will only give one item, where regular clicks will give a full stack. Leave false for default behavior.")
|
||||
.setLanguageKey(LANG_PREFIX + "prop.invertShift").getBoolean();
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.jaquadro.minecraft.storagedrawers.core;
|
||||
import com.jaquadro.minecraft.storagedrawers.StorageDrawers;
|
||||
import com.jaquadro.minecraft.storagedrawers.block.BlockDrawers;
|
||||
import com.jaquadro.minecraft.storagedrawers.config.ConfigManager;
|
||||
import com.jaquadro.minecraft.storagedrawers.core.recipe.FallbackShapedOreRecipe;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import minetweaker.mc1710.recipes.ShapedRecipeOre;
|
||||
import net.minecraft.block.BlockWood;
|
||||
@@ -10,12 +11,15 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.RecipeSorter;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
|
||||
public class ModRecipes
|
||||
{
|
||||
public void init () {
|
||||
OreDictionary.registerOre("chestWood", new ItemStack(Blocks.chest)); // Remove when porting to 1.8
|
||||
|
||||
RecipeSorter.register("StorageDrawers:FallbackShapedOreRecipe", FallbackShapedOreRecipe.class, RecipeSorter.Category.SHAPED, "after:minecraft:shapedore");
|
||||
|
||||
ConfigManager config = StorageDrawers.config;
|
||||
|
||||
@@ -42,24 +46,26 @@ public class ModRecipes
|
||||
}
|
||||
|
||||
// Fallback recipes
|
||||
if (config.isBlockEnabled("fulldrawers1"))
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.fullDrawers1, config.getBlockRecipeOutput("fulldrawers1"), 0), "xxx", " y ", "xxx",
|
||||
'x', "plankWood", 'y', "chestWood"));
|
||||
if (config.isBlockEnabled("fulldrawers2"))
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.fullDrawers2, config.getBlockRecipeOutput("fulldrawers2"), 0), "xyx", "xxx", "xyx",
|
||||
'x', "plankWood", 'y', "chestWood"));
|
||||
if (config.isBlockEnabled("halfdrawers2"))
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.halfDrawers2, config.getBlockRecipeOutput("halfdrawers2"), 0), "xyx", "xxx", "xyx",
|
||||
'x', "plankWood", 'y', "chestWood"));
|
||||
if (config.isBlockEnabled("fulldrawers4"))
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.fullDrawers4, config.getBlockRecipeOutput("fulldrawers4"), 0), "yxy", "xxx", "yxy",
|
||||
'x', "slabWood", 'y', "chestWood"));
|
||||
if (config.isBlockEnabled("halfdrawers4"))
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.halfDrawers4, config.getBlockRecipeOutput("halfdrawers4"), 0), "yxy", "xxx", "yxy",
|
||||
'x', "slabWood", 'y', "chestWood"));
|
||||
if (config.isBlockEnabled("trim"))
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.trim, config.getBlockRecipeOutput("trim"), 0), "xyx", "yyy", "xyx",
|
||||
'x', "stickWood", 'y', "plankWood"));
|
||||
if (config.cache.enableFallbackRecipes) {
|
||||
if (config.isBlockEnabled("fulldrawers1"))
|
||||
GameRegistry.addRecipe(new FallbackShapedOreRecipe(new ItemStack(ModBlocks.fullDrawers1, config.getBlockRecipeOutput("fulldrawers1"), 0), "xxx", " y ", "xxx",
|
||||
'x', "plankWood", 'y', "chestWood"));
|
||||
if (config.isBlockEnabled("fulldrawers2"))
|
||||
GameRegistry.addRecipe(new FallbackShapedOreRecipe(new ItemStack(ModBlocks.fullDrawers2, config.getBlockRecipeOutput("fulldrawers2"), 0), "xyx", "xxx", "xyx",
|
||||
'x', "plankWood", 'y', "chestWood"));
|
||||
if (config.isBlockEnabled("halfdrawers2"))
|
||||
GameRegistry.addRecipe(new FallbackShapedOreRecipe(new ItemStack(ModBlocks.halfDrawers2, config.getBlockRecipeOutput("halfdrawers2"), 0), "xyx", "xxx", "xyx",
|
||||
'x', "slabWood", 'y', "chestWood"));
|
||||
if (config.isBlockEnabled("fulldrawers4"))
|
||||
GameRegistry.addRecipe(new FallbackShapedOreRecipe(new ItemStack(ModBlocks.fullDrawers4, config.getBlockRecipeOutput("fulldrawers4"), 0), "yxy", "xxx", "yxy",
|
||||
'x', "plankWood", 'y', "chestWood"));
|
||||
if (config.isBlockEnabled("halfdrawers4"))
|
||||
GameRegistry.addRecipe(new FallbackShapedOreRecipe(new ItemStack(ModBlocks.halfDrawers4, config.getBlockRecipeOutput("halfdrawers4"), 0), "yxy", "xxx", "yxy",
|
||||
'x', "slabWood", 'y', "chestWood"));
|
||||
if (config.isBlockEnabled("trim"))
|
||||
GameRegistry.addRecipe(new FallbackShapedOreRecipe(new ItemStack(ModBlocks.trim, config.getBlockRecipeOutput("trim"), 0), "xyx", "yyy", "xyx",
|
||||
'x', "stickWood", 'y', "plankWood"));
|
||||
}
|
||||
|
||||
if (config.isBlockEnabled("compdrawers"))
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(ModBlocks.compDrawers, config.getBlockRecipeOutput("compdrawers")), "xxx", "zwz", "xyx",
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.jaquadro.minecraft.storagedrawers.core.recipe;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
|
||||
public class FallbackShapedOreRecipe extends ShapedOreRecipe
|
||||
{
|
||||
public FallbackShapedOreRecipe (Block result, Object... recipe) {
|
||||
super(result, recipe);
|
||||
}
|
||||
|
||||
public FallbackShapedOreRecipe (Item result, Object... recipe) {
|
||||
super(result, recipe);
|
||||
}
|
||||
|
||||
public FallbackShapedOreRecipe (ItemStack result, Object... recipe) {
|
||||
super(result, recipe);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user