Vydělávej až 160.000 Kč měsíčně! Akreditované rekvalifikační kurzy s garancí práce od 0 Kč. Více informací.
Hledáme nové posily do ITnetwork týmu. Podívej se na volné pozice a přidej se do nejagilnější firmy na trhu - Více informací.
Avatar
Adam "Nero" Chudomel:9.2.2014 15:33

Mohl by jste mi prosím někdo pomoci? Kde je zde chyba -

/* / package ic2.core.uu;
/
/
/
/ import ic2.core.AdvRecipe;
/
/ import ic2.core.util­.StackUtil;
/
/ import java.util.Arra­yList;
/
/ import java.util.Arrays;
/
/ import java.util.List;
/
/ import net.minecraft­.item.ItemStac­k;
/
/ import net.minecraft­.item.craftin­g.CraftingMana­ger;
/
/ import net.minecraft­.item.craftin­g.IRecipe;
/
/ import net.minecraftfor­ge.oredict.Sha­pedOreRecipe;
/
/ import net.minecraftfor­ge.oredict.Sha­pelessOreReci­pe;
/
/
/
/ public class ForgeCraftingRe­solver
/
/ implements IRecipeResolver
/
/ {
/
/ public List<RecipeTran­sformation> getTransforma­tions(ItemStack output)
/
/ {
/
22 / assert (output.field_77994_a == 1) : output;
/
23 / List<RecipeTran­sformation> ret = new ArrayList();
/
25 / for (IRecipe irecipe : CraftingManager­.func_77594_a()­.func_77592_b()) {
/
26 / if ((irecipe instanceof ShapedOreRecipe))
/
/ {
/
27 / ShapedOreRecipe recipe = (ShapedOreReci­pe)irecipe;
/
29 / if (matches(reci­pe.func_77571_b(), output)) {
/
32 / ret.add(new RecipeTransfor­mation(fixSize(Ad­vRecipe.expan­dArray(recipe­.getInput())), recipe.func_77571_b())­);
/
/ }
/
/ }
/
35 / else if ((irecipe instanceof ShapelessOreRe­cipe))
/
/ {
/
36 / ShapelessOreRecipe recipe = (ShapelessOre­Recipe)irecipe;
/
38 / if (matches(reci­pe.func_77571_b(), output)) {
/
41 / ret.add(new RecipeTransfor­mation(fixSize(Ad­vRecipe.expan­dArray(recipe­.getInput().to­Array())), recipe.func_77571_b())­);
/
/ }
/
/ }
/
/ }
/
47 / return ret;
/
/ }
/
/
/
/ private boolean matches(ItemStack offer, ItemStack requirement)
/
/ {
/
51 / return (offer.field_77993_c == requirement.fi­eld_77993_c) && ((requirement­.func_77960_j() == 32767) || (offer.func_77960_j() == requirement.fun­c_77960_j()));
/
/ }
/
/
/
/ private List<List<Item­Stack>> fixSize(List<I­temStack>[] x)
/
/ {
/
57 / List<ItemStack>[] ret = new ArrayList[x.len­gth];
/
59 / for (int i = 0; i < x.length; i++)
/
/ {
/
60 / ret[i] = new ArrayList();
/
62 / for (ItemStack stack : x[i]) {
/
63 / if (stack.field_77994_a == 1) {
/
64 / ret[i].add(stack);
/
/ } else {
/
66 / ret[i].add(Stac­kUtil.copyWit­hSize(stack, 1));
/
/ }
/
/ }
/
/ }
/
71 / return Arrays.asList(ret);
/
/ }
/
*/ }

/* Location: C:\Users\Admin\Des­ktop\
* Qualified Name: ic2.core.uu.For­geCraftingResol­ver
* JD-Core Version: 0.7.0.1
*/

Odpovědět
9.2.2014 15:33
Nihil est, aut totum licet consistere
Avatar
Odpovídá na Adam "Nero" Chudomel
Neaktivní uživatel:9.2.2014 15:35

Zkus to znovu a přes tlačítko vložit kód :)

Nahoru Odpovědět
9.2.2014 15:35
Neaktivní uživatelský účet
Avatar
Nahoru Odpovědět
9.2.2014 15:36
Nihil est, aut totum licet consistere
Avatar
Adam "Nero" Chudomel:9.2.2014 15:37
/* / package ic2.core.uu;
/ /
/ / import ic2.core.AdvRecipe;
/ / import ic2.core.util.StackUtil;
/ / import java.util.ArrayList;
/ / import java.util.Arrays;
/ / import java.util.List;
/ / import net.minecraft.item.ItemStack;
/ / import net.minecraft.item.crafting.CraftingManager;
/ / import net.minecraft.item.crafting.IRecipe;
/ / import net.minecraftforge.oredict.ShapedOreRecipe;
/ / import net.minecraftforge.oredict.ShapelessOreRecipe;
/ /
/ / public class ForgeCraftingResolver
/ / implements IRecipeResolver
/ / {
/ / public List<RecipeTransformation> getTransformations(ItemStack output)
/ / {
/ 22 / assert (output.field_77994_a == 1) : output;
/ 23 / List<RecipeTransformation> ret = new ArrayList();
/ 25 / for (IRecipe irecipe : CraftingManager.func_77594_a().func_77592_b()) {
/ 26 / if ((irecipe instanceof ShapedOreRecipe))
/ / {
/ 27 / ShapedOreRecipe recipe = (ShapedOreRecipe)irecipe;
/ 29 / if (matches(recipe.func_77571_b(), output)) {
/ 32 / ret.add(new RecipeTransformation(fixSize(AdvRecipe.expandArray(recipe.getInput())), recipe.func_77571_b()));
/ / }
/ / }
/ 35 / else if ((irecipe instanceof ShapelessOreRecipe))
/ / {
/ 36 / ShapelessOreRecipe recipe = (ShapelessOreRecipe)irecipe;
/ 38 / if (matches(recipe.func_77571_b(), output)) {
/ 41 / ret.add(new RecipeTransformation(fixSize(AdvRecipe.expandArray(recipe.getInput().toArray())), recipe.func_77571_b()));
/ / }
/ / }
/ / }
/ 47 / return ret;
/ / }
/ /
/ / private boolean matches(ItemStack offer, ItemStack requirement)
/ / {
/ 51 / return (offer.field_77993_c == requirement.field_77993_c) && ((requirement.func_77960_j() == 32767) || (offer.func_77960_j() == requirement.func_77960_j()));
/ / }
/ /
/ / private List<List<ItemStack>> fixSize(List<ItemStack>[] x)
/ / {
/ 57 / List<ItemStack>[] ret = new ArrayList[x.length];
/ 59 / for (int i = 0; i < x.length; i++)
/ / {
/ 60 / ret[i] = new ArrayList();
/ 62 / for (ItemStack stack : x[i]) {
/ 63 / if (stack.field_77994_a == 1) {
/ 64 / ret[i].add(stack);
/ / } else {
/ 66 / ret[i].add(StackUtil.copyWithSize(stack, 1));
/ / }
/ / }
/ / }
/ 71 / return Arrays.asList(ret);
/ / }
/ */ }

/* Location: C:\Users\Admin\Desktop\
* Qualified Name: ic2.core.uu.ForgeCraftingResolver
* JD-Core Version: 0.7.0.1
*/
Nahoru Odpovědět
9.2.2014 15:37
Nihil est, aut totum licet consistere
Děláme co je v našich silách, aby byly zdejší diskuze co nejkvalitnější. Proto do nich také mohou přispívat pouze registrovaní členové. Pro zapojení do diskuze se přihlas. Pokud ještě nemáš účet, zaregistruj se, je to zdarma.

Zobrazeno 4 zpráv z 4.