本文整理匯總了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;
}
示例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));
}
}
示例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);
}
});
}
示例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);
}
}
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
}
}
}
示例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));
}
示例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;
}
示例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));
}
示例12: getIngredients
import codechicken.nei.PositionedStack; //導入依賴的package包/類
@Override
public List<PositionedStack> getIngredients() {
// System.out.println("ms");
super.getIngredients().forEach(ingred -> {
});
return super.getIngredients();
}
示例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);
}
}
示例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);
}
示例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));
}
}