Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package wintercraft.helper.gui;
- import java.util.Arrays;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
- import net.minecraft.block.Block;
- import net.minecraft.item.Item;
- import net.minecraft.item.ItemStack;
- public class FreezerRecipes
- {
- private static final FreezerRecipes smeltingBase = new FreezerRecipes();
- private HashMap<List<Integer>, ItemStack> metaSmeltingList = new HashMap<List<Integer>, ItemStack>();
- private Map smeltingList = new HashMap();
- private HashMap<List<Integer>, Float> metaExperience = new HashMap<List<Integer>, Float>();
- /**
- * Used to call methods addInscribing and getInscribingResult.
- */
- public static final FreezerRecipes smelting() {
- return smeltingBase;
- }
- /**
- * Adds all recipes to the HashMap
- */
- private FreezerRecipes()
- {
- //this.addSmelting(Arrays.asList(Item.sugar.itemID, 0, Item.bucketMilk.itemID, 0), new ItemStack(Items.commonItem.itemID, 4, 1), 0.3F);
- //this.addSmelting(Arrays.asList(Items.commonItem.itemID, 1, Item.dyePowder.itemID, 3), new ItemStack(Items.commonItem.itemID, 1, 2), 0.3F);
- this.addSmelting(Arrays.asList(Item.bucketWater.itemID, 0, Item.bucketWater.itemID, 0), new ItemStack(Block.ice.blockID, 4, 0), 0.2F);
- //this.addSmelting(Arrays.asList(Items.commonItem.itemID, 1, Item.dyePowder.itemID, 1), new ItemStack(Items.commonItem.itemID, 1, 3), 0.3F);
- //this.addSmelting(Arrays.asList(Items.commonItem.itemID, 1, Item.cookie.itemID, 0), new ItemStack(Items.commonItem.itemID, 1, 4), 0.3F);
- //this.addSmelting(Arrays.asList(Items.commonItem.itemID, 1, Item.magmaCream.itemID, 0), new ItemStack(Items.commonItem.itemID, 1, 5), 0.3F);
- //this.addSmelting(Arrays.asList(Items.rockySnowball.itemID, 0, Items.rockySnowball.itemID, 0), new ItemStack(Items.iceBall.itemID, 2, 0), 0.2F);
- //this.addSmelting(Arrays.asList(Items.iceChunk.itemID, 0, Items.iceGem.itemID, 0), new ItemStack(Items.iceGem.itemID, 1, 1), 0.7F);
- //this.addSmelting(Arrays.asList(Items.iceChunk.itemID, 0, Block.stone.blockID, 0), new ItemStack(Blocks.icedStone.blockID, 1, 0), 0.4F);
- //this.addSmelting(Arrays.asList(Items.iceChunk.itemID, 0, Item.ingotIron.itemID, 0), new ItemStack(Items.iceIngot.itemID, 1, 0), 0.4F);
- //this.addSmelting(Arrays.asList(Items.iceChunk.itemID, 0, Item.diamond.itemID, 0), new ItemStack(Items.iceCrystal.itemID, 1, 0), 0.4F);
- }
- public void addSmelting(List<Integer> items, ItemStack out, float experience)
- {
- metaSmeltingList.put(items, out);
- metaExperience.put(Arrays.asList(out.itemID, out.getItemDamage()), experience);
- }
- /**
- * Used to get the resulting ItemStack form a source ItemStack
- * @param item The Source ItemStack
- * @return The result ItemStack
- */
- public ItemStack getSmeltingResult(ItemStack item, ItemStack item2)
- {
- if (item==null||item2==null)
- {
- return null;
- }
- ItemStack ret = (ItemStack)metaSmeltingList.get(Arrays.asList(item.itemID, item.getItemDamage(), item2.itemID, item2.getItemDamage()));
- if (ret != null)
- {
- return ret;
- }
- return (ItemStack)smeltingList.get(Integer.valueOf(item.itemID));
- }
- /**
- * Grabs the amount of base experience for this item to give when pulled from the furnace slot.
- */
- public float getExperience(ItemStack item)
- {
- if (item == null || item.getItem() == null)
- {
- return 0;
- }
- float ret = -1; // value returned by "item.getItem().getSmeltingExperience(item);" when item doesn't specify experience to give
- if (ret < 0 && metaExperience.containsKey(Arrays.asList(item.itemID, item.getItemDamage())))
- {
- ret = metaExperience.get(Arrays.asList(item.itemID, item.getItemDamage()));
- }
- return (ret < 0 ? 0 : ret);
- }
- public Map<List<Integer>, ItemStack> getMetaInscribingList()
- {
- return metaSmeltingList;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment