本文整理匯總了Java中codechicken.nei.PositionedStack.setPermutationToRender方法的典型用法代碼示例。如果您正苦於以下問題:Java PositionedStack.setPermutationToRender方法的具體用法?Java PositionedStack.setPermutationToRender怎麽用?Java PositionedStack.setPermutationToRender使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類codechicken.nei.PositionedStack
的用法示例。
在下文中一共展示了PositionedStack.setPermutationToRender方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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;
}
}
}
}
示例2: getIngredients
import codechicken.nei.PositionedStack; //導入方法依賴的package包/類
@Override
public List<PositionedStack> getIngredients() {
if (randomPermutations)
return getCycledIngredients(cycleticks / 20, ingredients);
for (PositionedStack stack : ingredients)
if (stack.items.length > 1)
stack.setPermutationToRender(cycleticks / 20 % stack.items.length);
return ingredients;
}
示例3: getIngredients
import codechicken.nei.PositionedStack; //導入方法依賴的package包/類
@Override
public List<PositionedStack> getIngredients() {
for (PositionedStack inputPositionStack: listInput)
inputPositionStack.setPermutationToRender((cycleticks / 20) % inputPositionStack.items.length);
listInput.addAll(listOutput);
return listInput;
}
示例4: 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());
stack.items = new ItemStack[]{stack.item};
stack.setPermutationToRender(0);
break;
}
}
}
}
示例5: randomRenderPermutation
import codechicken.nei.PositionedStack; //導入方法依賴的package包/類
public void randomRenderPermutation(final PositionedStack stack, final long cycle) {
stack.setPermutationToRender(0);
}
示例6: randomRenderPermutation
import codechicken.nei.PositionedStack; //導入方法依賴的package包/類
public void randomRenderPermutation(PositionedStack stack, long cycle) {
Random rand = new Random(cycle + offset);
stack.setPermutationToRender(Math.abs(rand.nextInt()) % stack.items.length);
}