Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package fer22f.mods.satcom;
- import java.util.ArrayList;
- import java.util.List;
- import net.minecraft.inventory.InventoryCrafting;
- import net.minecraft.item.Item;
- import net.minecraft.item.ItemStack;
- import net.minecraft.item.crafting.IRecipe;
- import net.minecraft.item.crafting.ShapelessRecipes;
- import net.minecraft.world.World;
- public class RecipeSeeds extends ShapelessRecipes implements IRecipe {
- public static List items = new ArrayList();
- static
- {
- items.add(new ItemStack(Item.sugar));
- items.add(new ItemStack(Item.seeds));
- }
- public RecipeSeeds()
- {
- super(new ItemStack(Item.seeds), items);
- }
- public boolean matches(InventoryCrafting matri, World world) {
- if (matri.getSizeInventory() != 4)
- return false;
- boolean foundSeed = false;
- boolean foundSugar = false;
- for (int i = 0; i < matri.getSizeInventory(); i++) {
- if (matri.getStackInSlot(i) == null)
- continue;
- if (matri.getStackInSlot(i).itemID == Item.seeds.itemID)
- {
- foundSeed = true;
- } else
- if (matri.getStackInSlot(i).itemID == Item.sugar.itemID)
- {
- foundSugar = true;
- }
- }
- return (foundSeed && foundSugar);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement