SHARE
TWEET

Untitled

a guest Aug 17th, 2018 91 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.lezink.lezinkmod.common;
  2.  
  3. import java.util.HashMap;
  4. import java.util.Iterator;
  5. import java.util.Map;
  6. import java.util.Map.Entry;
  7.  
  8. import net.minecraft.block.Block;
  9. import net.minecraft.block.material.Material;
  10. import net.minecraft.init.Blocks;
  11. import net.minecraft.init.Items;
  12. import net.minecraft.item.Item;
  13. import net.minecraft.item.ItemStack;
  14.  
  15. public class CompactorRecipes
  16. {
  17.  
  18. private static final CompactorRecipes smeltingBase = new CompactorRecipes();
  19. private Map smeltingList = new HashMap();
  20. {
  21.     this.addRecipe(Blocks.obsidian, new ItemStack(lezinkmod.obsidian_compacted));
  22.  
  23. }
  24.      private void addRecipe(Block obsidian, ItemStack itemStack)
  25.      {
  26.          
  27.      }
  28.  
  29.     public ItemStack getSmeltingResult(ItemStack[] stack)
  30.         {
  31.             Iterator iterator = this.smeltingList.entrySet().iterator();
  32.             Entry entry;
  33.  
  34.             do
  35.             {
  36.                 if (!iterator.hasNext())
  37.                 {
  38.                     return null;
  39.                 }
  40.             entry = (Entry)iterator.next();
  41.         }
  42.         while (!this.isSameKey(stack, (ItemStack[])entry.getKey()));
  43.  
  44.         return (ItemStack)entry.getValue();
  45.         }
  46.        
  47.        
  48.         private boolean isSameKey(ItemStack[] stackList, ItemStack[] stackList2)
  49.         {
  50.             boolean isSame = false;
  51.             for(int i=0; i<=2; i++)
  52.             {
  53.                 if(stackList.length == stackList2.length)
  54.                 {
  55.                     isSame = true;
  56.                 }
  57.                 else
  58.                 {
  59.                     return false;
  60.                 }
  61.             }
  62.             return isSame;
  63.         }
  64.         public Map getSmeltingList()
  65.         {
  66.             return this.smeltingList;
  67.         }
  68.  
  69.         public static CompactorRecipes smelting()
  70.         {
  71.             return smeltingBase;
  72.         }
  73. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top