Add NEI handler for upgrade template recipe

This commit is contained in:
Justin Aquadro committed 2016-10-05 01:45:41 -04:00
1 parent b33a6be9cb
commit 79ba52a0d5
3 files changed
+36 -1

No files matched your search

+1 -1
View File
@@ -17,7 +17,7 @@ buildscript {
apply plugin: 'forge'
version = "1.7.10-1.10.3"
version = "1.7.10-1.10.4"
group= "com.jaquadro.minecraft.storagedrawers" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "StorageDrawers"
@@ -25,6 +25,8 @@ public class NEIStorageDrawersConfig implements IConfigureNEI
for (ItemStack stack : pendingHide)
API.hideItem(stack);
API.registerRecipeHandler(new UpgradeItemRecipeHandler());
pendingHide.clear();
loaded = true;
}
@@ -0,0 +1,33 @@
package com.jaquadro.minecraft.storagedrawers.integration.notenoughitems;
import codechicken.nei.recipe.ShapedRecipeHandler;
import com.jaquadro.minecraft.storagedrawers.core.ModItems;
import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary;
import java.util.List;
public class UpgradeItemRecipeHandler extends ShapedRecipeHandler
{
@Override
public void loadCraftingRecipes(String outputId, Object... results) {
if (outputId.equals("item"))
loadCraftingRecipes((ItemStack) results[0]);
}
@Override
public void loadCraftingRecipes (ItemStack result) {
ItemStack itemTemplate = new ItemStack(ModItems.upgradeTemplate);
List<ItemStack> sticks = OreDictionary.getOres("stickWood");
List<ItemStack> drawers = OreDictionary.getOres("drawerBasic");
if (result.isItemEqual(itemTemplate)) {
arecipes.add(new CachedShapedRecipe(3, 3, new Object[] {
sticks, sticks, sticks,
sticks, drawers, sticks,
sticks, sticks, sticks
}, result));
}
super.loadCraftingRecipes(result);
}
}