Guest User

Untitled

a guest
Jun 8th, 2015
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.05 KB | None | 0 0
  1. package selim.omniGoggles.helmet;
  2.  
  3. import selim.omniGoggles.OmniGoggles;
  4. import net.minecraft.init.Blocks;
  5. import net.minecraft.init.Items;
  6. import net.minecraft.inventory.InventoryCrafting;
  7. import net.minecraft.item.ItemStack;
  8. import net.minecraft.item.crafting.IRecipe;
  9. import net.minecraft.world.World;
  10. import cpw.mods.fml.common.registry.GameRegistry;
  11.  
  12. public class GoggleCrafting implements IRecipe {
  13.  
  14. static ItemStack resultantStack = new ItemStack(OmniGoggles.omniGoggles);
  15.  
  16. @Override
  17. public boolean matches(InventoryCrafting p_77569_1_, World p_77569_2_) {
  18. ItemStack stack5 = p_77569_1_.getStackInSlot(4);
  19. if (ItemStack.areItemStacksEqual(stack5, resultantStack)) {
  20. ItemStack stack2 = p_77569_1_.getStackInSlot(1);
  21. resultantStack.stackTagCompound = stack5.stackTagCompound;
  22. if (stack2.getUnlocalizedName().equals("item.ItemGoggles.name")) {
  23. resultantStack.stackTagCompound.setBoolean("gogglesOfRevealing", true);
  24. }
  25. if (stack2.getUnlocalizedName().equals("item.openperipheral.glasses.name")) {
  26. resultantStack.stackTagCompound.setBoolean("terminalGlasses", true);
  27. }
  28. return true;
  29. }
  30. else {
  31. return false;
  32. }
  33. }
  34.  
  35. @Override
  36. public ItemStack getCraftingResult(InventoryCrafting p_77572_1_) {
  37. ItemStack stack5 = p_77572_1_.getStackInSlot(4);
  38. ItemStack result = resultantStack;
  39. if (ItemStack.areItemStacksEqual(stack5, resultantStack)) {
  40. ItemStack stack2 = p_77572_1_.getStackInSlot(1);
  41. resultantStack.stackTagCompound = stack5.stackTagCompound;
  42. if (stack2.getUnlocalizedName().equals("item.ItemGoggles.name")) {
  43. resultantStack.stackTagCompound.setBoolean("gogglesOfRevealing", true);
  44. }
  45. if (stack2.getUnlocalizedName().equals("item.openperipheral.glasses.name")) {
  46. resultantStack.stackTagCompound.setBoolean("terminalGlasses", true);
  47. }
  48. result = resultantStack;
  49. }
  50. else {
  51. result = null;
  52. }
  53. return result;
  54. }
  55.  
  56. @Override
  57. public int getRecipeSize() {
  58. return 3;
  59. }
  60.  
  61. @Override
  62. public ItemStack getRecipeOutput() {
  63. return resultantStack;
  64. }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment