Guest User

Untitled

a guest
Apr 27th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. package dovahofkiin.brewery;
  2.  
  3. import java.util.ArrayList;
  4. import java.util.List;
  5.  
  6. import net.minecraft.block.Block;
  7. import net.minecraft.init.Blocks;
  8. import net.minecraft.init.Items;
  9. import net.minecraft.init.PotionTypes;
  10. import net.minecraft.item.ItemStack;
  11. import net.minecraft.potion.PotionUtils;
  12.  
  13. public class BreweryRecipeHelper {
  14. private static List<ArrayList<Object>> recipeList = new ArrayList<ArrayList<Object>>();
  15.  
  16. public static void init() {
  17. ArrayList<Object> swiftPot = new ArrayList<Object>();
  18. swiftPot.add(Blocks.glowstone);
  19. swiftPot.add(Blocks.dirt);
  20. swiftPot.add(PotionUtils.addPotionToItemStack(new ItemStack(Items.potionitem, 1),
  21. PotionTypes.swiftness));
  22.  
  23. ArrayList<Object> slowPot = new ArrayList<Object>();
  24. slowPot.add(Blocks.dirt);
  25. slowPot.add(Blocks.obsidian);
  26. slowPot.add(PotionUtils.addPotionToItemStack(new ItemStack(Items.potionitem, 1),
  27. PotionTypes.slowness));
  28. recipeList.add(swiftPot);
  29. recipeList.add(slowPot);
  30. }
  31.  
  32. public static ItemStack checkIfRecipeExists(Block a, Block b) {
  33. for (ArrayList<Object> al : recipeList) {
  34. if (((Block) al.get(0) == a && (Block) al.get(1) == b) || ((Block) al.get(0) == b && (Block) al.get(1) == a)) {
  35. return (ItemStack) al.get(2);
  36. }
  37. }
  38. return null;
  39. }
  40.  
  41. }
Add Comment
Please, Sign In to add comment