public ComparableItemStack(Item item, int metadata, int stackSize) { this.item = item; this.metadata = metadata; this.stackSize = stackSize; this.oreID = ItemHelper.oreProxy.getOreID(this.toItemStack()); this.oreName = ItemHelper.oreProxy.getOreName(oreID); }
public static List<NumismaticFuelWrapper> getRecipes(IGuiHelper guiHelper) { List<NumismaticFuelWrapper> recipes = new ArrayList<>(); for (ComparableItemStack fuel : NumismaticManager.getFuels()) { ItemStack fuelStack = fuel.toItemStack(); recipes.add(new NumismaticFuelWrapper(guiHelper, fuelStack, NumismaticManager.getFuelEnergy(fuelStack))); } return recipes; }
public static List<NumismaticFuelWrapper> getRecipes(IGuiHelper guiHelper) { List<NumismaticFuelWrapper> recipes = new ArrayList<>(); for (ComparableItemStack fuel : NumismaticManager.getGemFuels()) { ItemStack fuelStack = fuel.toItemStack(); recipes.add(new NumismaticFuelWrapper(guiHelper, fuelStack, NumismaticManager.getGemFuelEnergy(fuelStack), RecipeUidsTE.DYNAMO_NUMISMATIC_GEM)); } return recipes; }
@Override public ItemStack toItemStack() { ItemStack ret = super.toItemStack(); if (!ret.isEmpty() && tag != null) { ret.setTagCompound(tag.copy()); } return ret; }
public static void refresh() { Map<BlockWrapper, FluidStack> tempBlockMap = new Object2ObjectOpenHashMap<>(blockMap.size()); Map<ItemWrapper, FluidStack> tempItemMap = new Object2ObjectOpenHashMap<>(itemMap.size()); HashMultimap<BlockWrapper, BlockWrapper> tempLeafMap = HashMultimap.create(leafMap.keySet().size(), leafMap.size() / leafMap.keySet().size()); TObjectIntHashMap<ComparableItemStack> tempFertilizerMap = new TObjectIntHashMap<>(fertilizerMap.size()); for (Entry<BlockWrapper, FluidStack> entry : blockMap.entrySet()) { BlockWrapper tempBlock = new BlockWrapper(entry.getKey().block, entry.getKey().metadata); tempBlockMap.put(tempBlock, entry.getValue()); } for (Entry<ItemWrapper, FluidStack> entry : itemMap.entrySet()) { ItemWrapper tempItem = new ItemWrapper(entry.getKey().item, entry.getKey().metadata); tempItemMap.put(tempItem, entry.getValue()); } for (Entry<BlockWrapper, BlockWrapper> entry : leafMap.entries()) { BlockWrapper tempLeaf = new BlockWrapper(entry.getKey().block, entry.getKey().metadata); tempLeafMap.put(tempLeaf, entry.getValue()); } for (TObjectIntIterator<ComparableItemStack> it = fertilizerMap.iterator(); it.hasNext(); ) { it.advance(); tempFertilizerMap.put(new ComparableItemStack(it.key().toItemStack()), it.value()); } blockMap.clear(); itemMap.clear(); leafMap.clear(); fertilizerMap.clear(); blockMap = tempBlockMap; itemMap = tempItemMap; leafMap = tempLeafMap; fertilizerMap = tempFertilizerMap; }
public static List<SteamFuelWrapper> getRecipes(IModRegistry registry, IGuiHelper guiHelper) { List<SteamFuelWrapper> recipes = new ArrayList<>(); for (ComparableItemStack fuel : SteamManager.getFuels()) { ItemStack fuelStack = fuel.toItemStack(); recipes.add(new SteamFuelWrapper(guiHelper, fuelStack, SteamManager.getFuelEnergy(fuelStack))); } Set specificFuels = SteamManager.getFuels(); for (ItemStack fuel : registry.getIngredientRegistry().getFuels()) { if (specificFuels.contains(new ComparableItemStack(fuel))) { continue; } int energy = SteamManager.getFuelEnergy(fuel); if (energy > 0) { recipes.add(new SteamFuelWrapper(guiHelper, fuel, energy)); } } return recipes; }
ItemStack fuelStack = fuel.toItemStack(); recipes.add(new EnervationFuelWrapper(guiHelper, fuelStack, EnervationManager.getFuelEnergy(fuelStack)));
public static void refresh() { TObjectIntHashMap<ComparableItemStack> tempMap = new TObjectIntHashMap<>(fuelMap.size()); for (TObjectIntIterator<ComparableItemStack> it = fuelMap.iterator(); it.hasNext(); ) { it.advance(); tempMap.put(new ComparableItemStack(it.key().toItemStack()), it.value()); } fuelMap.clear(); fuelMap = tempMap; }
public static void refresh() { TObjectIntHashMap<ComparableItemStack> tempBaitMap = new TObjectIntHashMap<>(baitMap.size()); for (TObjectIntIterator<ComparableItemStack> it = baitMap.iterator(); it.hasNext(); ) { it.advance(); tempBaitMap.put(new ComparableItemStack(it.key().toItemStack()), it.value()); } baitMap.clear(); baitMap = tempBaitMap; }
public static void refresh() { TObjectIntHashMap<ComparableItemStack> tempMap = new TObjectIntHashMap<>(fuelMap.size()); for (TObjectIntIterator<ComparableItemStack> it = fuelMap.iterator(); it.hasNext(); ) { it.advance(); tempMap.put(new ComparableItemStack(it.key().toItemStack()), it.value()); } fuelMap.clear(); fuelMap = tempMap; }
public static void refresh() { TObjectIntHashMap<ComparableItemStack> tempMap = new TObjectIntHashMap<>(fuelMap.size()); for (TObjectIntIterator<ComparableItemStack> it = fuelMap.iterator(); it.hasNext(); ) { it.advance(); tempMap.put(new ComparableItemStack(it.key().toItemStack()), it.value()); } fuelMap.clear(); fuelMap = tempMap; }
public static void refresh() { TObjectIntHashMap<ComparableItemStack> tempAmpMap = new TObjectIntHashMap<>(reagentAmpMap.size()); TObjectIntHashMap<ComparableItemStack> tempDurMap = new TObjectIntHashMap<>(reagentDurMap.size()); for (TObjectIntIterator<ComparableItemStack> it = reagentAmpMap.iterator(); it.hasNext(); ) { it.advance(); tempAmpMap.put(new ComparableItemStack(it.key().toItemStack()), it.value()); } for (TObjectIntIterator<ComparableItemStack> it = reagentDurMap.iterator(); it.hasNext(); ) { it.advance(); tempDurMap.put(new ComparableItemStack(it.key().toItemStack()), it.value()); } reagentAmpMap.clear(); reagentDurMap.clear(); reagentAmpMap = tempAmpMap; reagentDurMap = tempDurMap; }
public static void refresh() { TObjectIntHashMap<ComparableItemStack> tempMap = new TObjectIntHashMap<>(fuelMap.size()); TObjectIntHashMap<ComparableItemStack> tempMap2 = new TObjectIntHashMap<>(gemFuelMap.size()); for (TObjectIntIterator<ComparableItemStack> it = fuelMap.iterator(); it.hasNext(); ) { it.advance(); tempMap.put(new ComparableItemStack(it.key().toItemStack()), it.value()); } for (TObjectIntIterator<ComparableItemStack> it = gemFuelMap.iterator(); it.hasNext(); ) { it.advance(); tempMap2.put(new ComparableItemStack(it.key().toItemStack()), it.value()); } fuelMap.clear(); fuelMap = tempMap; gemFuelMap.clear(); gemFuelMap = tempMap2; }
public static void refresh() { TObjectIntHashMap<ComparableItemStack> tempCatalystMap = new TObjectIntHashMap<>(catalystMap.size()); TObjectIntHashMap<ComparableItemStack> tempCatalystFactorMap = new TObjectIntHashMap<>(catalystFactorMap.size()); for (TObjectIntIterator<ComparableItemStack> it = catalystMap.iterator(); it.hasNext(); ) { it.advance(); tempCatalystMap.put(new ComparableItemStack(it.key().toItemStack()), it.value()); } for (TObjectIntIterator<ComparableItemStack> it = catalystFactorMap.iterator(); it.hasNext(); ) { it.advance(); tempCatalystFactorMap.put(new ComparableItemStack(it.key().toItemStack()), it.value()); } catalystMap.clear(); catalystFactorMap.clear(); catalystMap = tempCatalystMap; catalystFactorMap = tempCatalystFactorMap; }