-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added support for Thermal Dynamics covers
- Loading branch information
1 parent
3157ccc
commit 2261e27
Showing
3 changed files
with
57 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 51 additions & 0 deletions
51
...ava/org/jglrxavpok/mods/decraft/item/uncrafting/handlers/external/CoFHRecipeHandlers.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; } | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters