Skip to content

Commit

Permalink
added support for Thermal Dynamics covers
Browse files Browse the repository at this point in the history
  • Loading branch information
crazysnailboy committed Jul 5, 2017
1 parent 3157ccc commit 2261e27
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import java.util.List;
import org.jglrxavpok.mods.decraft.item.uncrafting.handlers.NBTSensitiveRecipeHandlers.FireworksRecipeHandler;
import org.jglrxavpok.mods.decraft.item.uncrafting.handlers.NBTSensitiveRecipeHandlers.TippedArrowRecipeHandler;
import org.jglrxavpok.mods.decraft.item.uncrafting.handlers.external.CoFHRecipeHandlers;
import org.jglrxavpok.mods.decraft.item.uncrafting.handlers.external.IC2RecipeHandlers.ShapedIC2RecipeHandler;
import org.jglrxavpok.mods.decraft.item.uncrafting.handlers.external.IC2RecipeHandlers.ShapelessIC2RecipeHandler;
import org.jglrxavpok.mods.decraft.item.uncrafting.handlers.external.IGCMRecipeHandlers.ShapedIGCMRecipeHandler;
Expand Down Expand Up @@ -74,6 +75,9 @@ private static void buildHandlerMap()
HANDLERS.put(ShapedOreRecipe.class, new ShapedOreRecipeHandler());
HANDLERS.put(ShapelessOreRecipe.class, new ShapelessOreRecipeHandler());

// cofh recipe handlers
if (CoFHRecipeHandlers.CoverRecipeHandler.recipeClass != null) HANDLERS.put(CoFHRecipeHandlers.CoverRecipeHandler.recipeClass, new CoFHRecipeHandlers.CoverRecipeHandler());

// industrialcraft 2 recipe handlers
if (ShapedIC2RecipeHandler.recipeClass != null) HANDLERS.put(ShapedIC2RecipeHandler.recipeClass, new ShapedIC2RecipeHandler());
if (ShapelessIC2RecipeHandler.recipeClass != null) HANDLERS.put(ShapelessIC2RecipeHandler.recipeClass, new ShapelessIC2RecipeHandler());
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package org.jglrxavpok.mods.decraft.item.uncrafting.handlers.external;

import org.jglrxavpok.mods.decraft.item.uncrafting.handlers.NBTSensitiveRecipeHandlers.INBTSensitiveRecipeHandler;
import org.jglrxavpok.mods.decraft.item.uncrafting.handlers.RecipeHandlers.RecipeHandler;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.NonNullList;
import net.minecraft.util.ResourceLocation;

public class CoFHRecipeHandlers
{
public static class CoverRecipeHandler extends RecipeHandler implements INBTSensitiveRecipeHandler
{

private ItemStack inputStack;

public static Class<? extends IRecipe> recipeClass;

static
{
try
{
recipeClass = Class.forName("cofh.thermaldynamics.util.RecipeCover").asSubclass(IRecipe.class);
}
catch(ClassNotFoundException ex) { }
}

@Override
public NonNullList<ItemStack> getCraftingGrid(IRecipe r)
{
NonNullList<ItemStack> recipeStacks = NonNullList.<ItemStack>withSize(9, ItemStack.EMPTY);

recipeStacks.set(0, new ItemStack(Item.REGISTRY.getObject(new ResourceLocation("thermaldynamics:thermaldynamics_48")), 1));

NBTTagCompound tag = this.inputStack.getTagCompound();
recipeStacks.set(1, new ItemStack(Block.REGISTRY.getObject(new ResourceLocation(tag.getString("Block"))), 1, tag.getInteger("Meta")));

return recipeStacks;
}

@Override
public void setInputStack(ItemStack stack) { this.inputStack = stack; }

@Override
public ItemStack getInputStack() { return this.inputStack; }

}
}
3 changes: 2 additions & 1 deletion update.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"homepage": "https://minecraft.curseforge.com/projects/jglrxavpoks-uncrafting-table/files/",
"promos": {
"1.11.2-latest": "1.7.3-beta1",
"1.11.2-latest": "1.7.3",
"1.11.2-recommended": "1.7.2"
},
"1.11.2": {
"1.7.3": "Improved CraftTweaker scripting, added support for Thermal Dynamics Covers",
"1.7.3-beta1": "Support for Mekanism recipes, CraftTweaker scripting support (experimental)",
"1.7.2": "Added support for Tinker's Construct and InGameConfigManager",
"1.7.1": "Full release version of 1.7.1-pre15",
Expand Down

0 comments on commit 2261e27

Please sign in to comment.