Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import cpw.mods.fml.common.registry.GameRegistry;
- import net.minecraft.init.Blocks;
- import net.minecraft.init.Items;
- import net.minecraft.inventory.InventoryCrafting;
- import net.minecraft.item.Item;
- import net.minecraft.item.ItemStack;
- import net.minecraft.item.crafting.IRecipe;
- import net.minecraft.world.World;
- public class RainbowWoolRecipe implements IRecipe{
- @Override
- public boolean matches(InventoryCrafting ic, World world) {
- if(!ic.getInventoryName().equals("Crafting")) {
- return false;
- }
- ItemStack topLeft = ic.getStackInRowAndColumn(0, 0);
- if(topLeft.getItem() == Item.getItemFromBlock(Blocks.wool)) {
- ItemStack topCentre = ic.getStackInRowAndColumn(0, 1);
- ItemStack topRight = ic.getStackInRowAndColumn(0, 2);
- ItemStack centreLeft = ic.getStackInRowAndColumn(1, 0);
- ItemStack centreCentre = ic.getStackInRowAndColumn(1, 1);
- ItemStack centreRight = ic.getStackInRowAndColumn(1, 2);
- ItemStack bottomLeft = ic.getStackInRowAndColumn(2, 0);
- ItemStack bottomCentre = ic.getStackInRowAndColumn(2, 1);
- ItemStack bottomRight = ic.getStackInRowAndColumn(2, 2);
- ItemStack[] items = new ItemStack[]{topCentre, topRight, centreLeft, centreCentre, centreRight, bottomLeft, bottomCentre, bottomRight};
- for(ItemStack itemstack : items) {
- if(itemstack.getItem() != Items.dye) {
- return false;
- }
- return true;
- }
- }
- return false;
- }
- @Override
- public ItemStack getCraftingResult(InventoryCrafting p_77572_1_) {
- return new ItemStack(GameRegistry.findBlock(Reference.MOD_ID, "RainbowWool"), 1);
- }
- @Override
- public int getRecipeSize() {
- // TODO Auto-generated method stub
- return 9;
- }
- @Override
- public ItemStack getRecipeOutput() {
- return new ItemStack(GameRegistry.findBlock(Reference.MOD_ID, "RainbowWool"), 1);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement