當前位置: 首頁>>代碼示例>>Java>>正文


Java PositionedStack類代碼示例

本文整理匯總了Java中codechicken.nei.PositionedStack的典型用法代碼示例。如果您正苦於以下問題:Java PositionedStack類的具體用法?Java PositionedStack怎麽用?Java PositionedStack使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


PositionedStack類屬於codechicken.nei包,在下文中一共展示了PositionedStack類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getOtherStacks

import codechicken.nei.PositionedStack; //導入依賴的package包/類
@Override
public List<PositionedStack> getOtherStacks() {
	ArrayList<PositionedStack> tmp = new ArrayList<PositionedStack>();
	PositionedStack tmpStack = FurnaceRecipeHandler.afuels
			.get((cycleticks / 48) % FurnaceRecipeHandler.afuels.size()).stack;
	tmpStack.relx = fuelX;
	tmpStack.rely = fuelY;

	tmp.add(tmpStack);

	tmp.add(results.get(1));
	tmp.add(results.get(2));
	tmp.add(results.get(3));

	return tmp;
}
 
開發者ID:CraftedMods,項目名稱:nei-lotr,代碼行數:17,代碼來源:BasicForgeRecipeHandler.java

示例2: CachedTradeRecipe

import codechicken.nei.PositionedStack; //導入依賴的package包/類
public CachedTradeRecipe(LOTRTradeEntry entry, boolean usage) {
	this.entry = entry;
	this.usage = usage;
	if (!usage) {
		this.results.add(new PositionedStack(entry.createTradeItem(), 110, 21));
		this.ingredients
				.add(new PositionedStack(new ItemStack(LOTRMod.silverCoin, getMaxTradeCost(entry)), 50, 21));
		this.ingredients
				.add(new PositionedStack(new ItemStack(LOTRMod.silverCoin, getMinTradeCost(entry)), 22, 21));
	} else {
		this.ingredients.add(new PositionedStack(entry.createTradeItem(), 22, 21, true));
		this.results
				.add(new PositionedStack(new ItemStack(LOTRMod.silverCoin, getMaxTradeCost(entry)), 138, 21));
		this.others
				.add(new PositionedStack(new ItemStack(LOTRMod.silverCoin, getMinTradeCost(entry)), 110, 21));
	}
}
 
開發者ID:CraftedMods,項目名稱:nei-lotr,代碼行數:18,代碼來源:BasicTradeHandler.java

示例3: loadUsageRecipes

import codechicken.nei.PositionedStack; //導入依賴的package包/類
public static void loadUsageRecipes(ItemStack ingredient, Set<CachedRecipe> cachedRecipes,
		Map<Item, Set<CachedRecipe>> usageMap) {
	cachedRecipes.forEach(recipe -> {
		List<PositionedStack> ingreds = recipe.getIngredients();

		if (recipe instanceof CachedShapedRecipe)
			((CachedShapedRecipe) recipe).computeVisuals();

		if (recipe.contains(ingreds, ingredient)) {
			recipe.setIngredientPermutation(ingreds, ingredient);
			if (usageMap.get(ingredient) == null)
				usageMap.put(ingredient.getItem(), new HashSet<>());
			usageMap.get(ingredient.getItem()).add(recipe);
		}
	});
}
 
開發者ID:CraftedMods,項目名稱:nei-lotr,代碼行數:17,代碼來源:NeiLotrUtil.java

示例4: CachedPatternRecipe

import codechicken.nei.PositionedStack; //導入依賴的package包/類
public CachedPatternRecipe(EnumBannerPattern pattern, String[] grid, List<Object> inputs) {
	this.pattern = pattern;

	for (int y = 0; y < 3; y++)
		for (int x = 0; x < 3; x++) {
			char c = grid[y].charAt(x);
			if (c != ' ') {
				Object input = inputs.get(inputs.indexOf(c) + 1);
				if (input instanceof String)
					input = OreDictionary.getOres((String) input);
				PositionedStack stack = new PositionedStack(input, 25 + x * 18, 6 + y * 18);
				stack.setMaxSize(1);
				ingredients.add(stack);
			}
		}
}
 
開發者ID:jm-organization,項目名稱:connor41-etfuturum2,代碼行數:17,代碼來源:BannerPatternHandler.java

示例5: clearIngredients

import codechicken.nei.PositionedStack; //導入依賴的package包/類
private boolean clearIngredients(final GuiContainer gui, final List<PositionedStack> ingreds) {
    for (final PositionedStack pstack : ingreds) {
        for (final Slot slot : (Collection<Slot>) gui.inventorySlots.inventorySlots) {
            if (slot.xDisplayPosition == pstack.relx + this.offsetx && slot.yDisplayPosition == pstack.rely + this.offsety) {
                if (!slot.getHasStack()) {
                    continue;
                }
                FastTransferManager.clickSlot(gui, slot.slotNumber, 0, 1);
                if (slot.getHasStack()) {
                    return false;
                }
                continue;
            }
        }
    }
    return true;
}
 
開發者ID:sameer,項目名稱:ExtraUtilities,代碼行數:18,代碼來源:FMPMicroBlocksOverlayHandler.java

示例6: getRecipes

import codechicken.nei.PositionedStack; //導入依賴的package包/類
public Set<Entry<ArrayList<PositionedStack>, PositionedStack>> getRecipes()
{
    HashMap<ArrayList<PositionedStack>, PositionedStack> recipes = new HashMap<ArrayList<PositionedStack>, PositionedStack>();

    for (Entry<HashMap<Integer, PositionedStack>, PositionedStack> stack : NEIGalacticraftConfig.getRocketBenchRecipes())
    {
        ArrayList<PositionedStack> inputStacks = new ArrayList<PositionedStack>();

        for (Map.Entry<Integer, PositionedStack> input : stack.getKey().entrySet())
        {
            inputStacks.add(input.getValue());
        }

        recipes.put(inputStacks, stack.getValue());
    }

    return recipes.entrySet();
}
 
開發者ID:4Space,項目名稱:4Space-5,代碼行數:19,代碼來源:RocketT1RecipeHandler.java

示例7: mapIngredSlots

import codechicken.nei.PositionedStack; //導入依賴的package包/類
@SuppressWarnings("unchecked")
public Slot[][] mapIngredSlots(GuiContainer gui, List<PositionedStack> ingredients)
{
    Slot[][] recipeSlotList = new Slot[ingredients.size()][];
    for(int i = 0; i < ingredients.size(); i++)//identify slots
    {
        LinkedList<Slot> recipeSlots = new LinkedList<Slot>();
        PositionedStack pstack = ingredients.get(i);
        for(Slot slot : (List<Slot>)gui.inventorySlots.inventorySlots)
        {
            if(slot.xDisplayPosition == pstack.relx+offsetx && slot.yDisplayPosition == pstack.rely+offsety)
            {
                recipeSlots.add(slot);
                break;
            }
        }
        recipeSlotList[i] = recipeSlots.toArray(new Slot[0]);
    }
    return recipeSlotList;
}
 
開發者ID:4Space,項目名稱:4Space-5,代碼行數:21,代碼來源:DefaultOverlayHandler.java

示例8: setIngredientPermutation

import codechicken.nei.PositionedStack; //導入依賴的package包/類
/**
 * Set all variable ingredients to this permutation.
 *
 * @param ingredient
 */
public void setIngredientPermutation(Collection<PositionedStack> ingredients, ItemStack ingredient) {
    for (PositionedStack stack : ingredients) {
        for (int i = 0; i < stack.items.length; i++) {
            if (NEIServerUtils.areStacksSameTypeCrafting(ingredient, stack.items[i])) {
                stack.item = stack.items[i];
                stack.item.setItemDamage(ingredient.getItemDamage());
                if (ingredient.hasTagCompound()) {
                    stack.item.setTagCompound((NBTTagCompound) ingredient.getTagCompound().copy());
                }
                stack.items = new ItemStack[]{stack.item};
                stack.setPermutationToRender(0);
                break;
            }
        }
    }
}
 
開發者ID:SneakyTactician,項目名稱:BIGB,代碼行數:22,代碼來源:TemplateRecipeHandler.java

示例9: cycle

import codechicken.nei.PositionedStack; //導入依賴的package包/類
public void cycle() {
    itemList.clear();
    for (Object obj : baseIngredients)
        itemList.add(obj);
    int extras = (cycleticks / 40) % (10 - itemList.size());
    for (int i = 0; i < extras; i++)
        itemList.add(extraIngred);
    setIngredients(itemList);

    List<PositionedStack> ingreds = getIngredients();
    for (int i = 0; i < 9; i++)
        inventoryCrafting.setInventorySlotContents(i, i < ingreds.size() ? ingreds.get(i).item : null);

    if (!recipeFireworks.matches(inventoryCrafting, null))
        throw new RuntimeException("Invalid Recipe?");
    setResult(recipeFireworks.getCraftingResult(null));
}
 
開發者ID:SneakyTactician,項目名稱:BIGB,代碼行數:18,代碼來源:FireworkRecipeHandler.java

示例10: getCycledResult

import codechicken.nei.PositionedStack; //導入依賴的package包/類
public PositionedStack getCycledResult(int cycle, PositionedStack result) {
	if (cycle != lastCycle) {
		lastCycle = cycle;
		ItemStack stack = NeiLotrReflection.getRandomUnsmelteryResult(ingredient);
		if (stack != null) {
			lastIngredient = new PositionedStack(stack, result.relx, result.rely);
			return lastIngredient;
		} else {
			return lastIngredient == null ? result : lastIngredient;
		}
	}
	return lastIngredient == null ? result : lastIngredient;
}
 
開發者ID:CraftedMods,項目名稱:nei-lotr,代碼行數:14,代碼來源:UnsmelteryRecipeHandler.java

示例11: CachedForgeRecipe

import codechicken.nei.PositionedStack; //導入依賴的package包/類
public CachedForgeRecipe(List<ItemStack> alloyItems, List<ItemStack> forgeItems, ItemStack resultItem) {
	if (alloyItems != null) {
		for (ItemStack tmpStackA : alloyItems) {
			tmpStackA.stackSize = 1;
		}
	}
	
	for (ItemStack tmpStackF : forgeItems) {
		tmpStackF.stackSize = 1;
	}

	if (alloyItems != null) {
		ingredients.add(new PositionedStack(alloyItems, 48, 9, true));
		ingredients.add(new PositionedStack(alloyItems, 66, 9, true));
		ingredients.add(new PositionedStack(alloyItems, 84, 9, true));
		ingredients.add(new PositionedStack(alloyItems, 102, 9, true));
	}

	ingredients.add(new PositionedStack(forgeItems, 48, 27, true));
	ingredients.add(new PositionedStack(forgeItems, 66, 27, true));
	ingredients.add(new PositionedStack(forgeItems, 84, 27, true));
	ingredients.add(new PositionedStack(forgeItems, 102, 27, true));

	this.results.add(new PositionedStack(resultItem, 48, 73));
	this.results.add(new PositionedStack(resultItem, 66, 73));
	this.results.add(new PositionedStack(resultItem, 84, 73));
	this.results.add(new PositionedStack(resultItem, 102, 73));
}
 
開發者ID:CraftedMods,項目名稱:nei-lotr,代碼行數:29,代碼來源:BasicForgeRecipeHandler.java

示例12: getIngredients

import codechicken.nei.PositionedStack; //導入依賴的package包/類
@Override
public List<PositionedStack> getIngredients() {
	// System.out.println("ms");
	super.getIngredients().forEach(ingred -> {
	});
	return super.getIngredients();
}
 
開發者ID:CraftedMods,項目名稱:nei-lotr,代碼行數:8,代碼來源:BasicForgeRecipeHandler.java

示例13: setIngredients

import codechicken.nei.PositionedStack; //導入依賴的package包/類
public void setIngredients(List<?> items) {
	ingredients.clear();
	for (int i = 0; i < items.size(); i++) {
		PositionedStack stack = new PositionedStack(NeiLotrUtil.extractRecipeItems(items.get(i)),
				25 + STACKORDER[i][0] * 18, 6 + STACKORDER[i][1] * 18);
		stack.setMaxSize(1);
		ingredients.add(stack);
	}
}
 
開發者ID:CraftedMods,項目名稱:nei-lotr,代碼行數:10,代碼來源:ExtendedShapelessRecipeHandler.java

示例14: getOtherStacks

import codechicken.nei.PositionedStack; //導入依賴的package包/類
@Override
public List<PositionedStack> getOtherStacks() {
	if (this.getOtherStack() != null) {
		others.add(this.getOtherStack());
	}
	return getCycledOthers(cycleticks / 20, others);
}
 
開發者ID:CraftedMods,項目名稱:nei-lotr,代碼行數:8,代碼來源:ExtendedShapelessRecipeHandler.java

示例15: CachedOvenRecipe

import codechicken.nei.PositionedStack; //導入依賴的package包/類
public CachedOvenRecipe(ItemStack ingredient, ItemStack result) {

			for (int i = 0; i < 9; i++) {
				ingredients.add(new PositionedStack(ingredient, 18 * i + 3, 10));
				results.add(new PositionedStack(result, 18 * i + 3, 56));
			}
		}
 
開發者ID:CraftedMods,項目名稱:nei-lotr,代碼行數:8,代碼來源:HobbitOvenHandler.java


注:本文中的codechicken.nei.PositionedStack類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。