-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Balanced clay crafting recipes.
- Loading branch information
Showing
4 changed files
with
42 additions
and
5 deletions.
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
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
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
37 changes: 37 additions & 0 deletions
37
src/main/java/com/headfishindustries/clay/proxy/CraftDerper.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,37 @@ | ||
package com.headfishindustries.clay.proxy; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import net.minecraft.block.Block; | ||
import net.minecraft.block.BlockClay; | ||
import net.minecraft.init.Blocks; | ||
import net.minecraft.init.Items; | ||
import net.minecraft.item.Item; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.item.crafting.CraftingManager; | ||
import net.minecraft.item.crafting.IRecipe; | ||
import net.minecraftforge.fml.common.registry.GameRegistry; | ||
|
||
public class CraftDerper { | ||
@SuppressWarnings({ "unchecked", "rawtypes" }) | ||
public static void removeRecipes(){ | ||
List<IRecipe>rlist = new ArrayList(CraftingManager.getInstance().getRecipeList()); | ||
for (IRecipe r : rlist){ | ||
net.minecraft.item.ItemStack out = r.getRecipeOutput(); | ||
System.out.println(out.toString()); | ||
Item outItem = out.getItem(); | ||
Block outBlock = Block.getBlockFromItem(outItem); | ||
if (outBlock != null && outBlock instanceof BlockClay){ | ||
//if(ItemStack.areItemStacksEqual(out, new ItemStack(outBlock, 2))) | ||
CraftingManager.getInstance().getRecipeList().remove(r); | ||
|
||
} | ||
} | ||
addRecipes(); | ||
} | ||
public static void addRecipes(){ | ||
//Unfortunately, we can't craft with half a dragon egg. Not yet. | ||
GameRegistry.addRecipe(new ItemStack(Blocks.CLAY, 2), "AAA", "ABA", "AAA", 'A', Items.CLAY_BALL, 'B', Blocks.DRAGON_EGG); | ||
} | ||
} |