![EasierCrafting](https://media.forgecdn.net/avatars/thumbnails/282/282/256/256/637288588396029855.png)
Crash client on opening inventory
APolarBaer opened this issue ยท 6 comments
Now im almost positive this is going to be some kind of conflict, i just kinda need help finding which mod >w< if you dont have time to look through it please dont worry but any help i can get is much appreciated
1.11.2
Hm. This produced when my code checks a recipe for the components it needs, here:
private boolean canCraftOre(IRecipe recipe, List<Object>input, Container inventory) {
List<ItemStack>neededList=new ArrayList<ItemStack>();
for (Object o: input) {
if (o==null)
continue;
if (o instanceof ItemStack)
neededList.add((ItemStack)o);
else if (o instanceof NonNullList) {
neededList.add(((NonNullList<ItemStack>)o).get(0)); **<-- this is the line that crashes**
}
else {
//System.out.println("Can't do "+recipe.getRecipeOutput().getDisplayName()+" as it needs a "+o+" ("+o.getClass().getCanonicalName()+")");
return false;
}
}
return canCraft(recipe, neededList, inventory);
}
Basically, a grid position can have 3 states: empty, distinct item, or one of several item choices. The line that crashes is invoked when there are several choices - MC tells me there are alternatives, I ask MC for the first one of them, and MC tells me "oops, the number of alternatives is 0, so there is no first one".
I agree this is probably due to a different mod, since I used the 1.11.2 version of EasierCrafting a lot without any crashes. And it seems to be a mod that adds recipes, and does that in an unusual manner. Unfortunately, that's all I can say.
I just added a bit of code to detect this situation, write an error to the log file when it happens, and assume that this recipe can't be crafted. This should at least stop MC from crashing (no guarantees that the problematic recipe doesn't cause another crash somewhere else!), and tell you which recipe has the problem. I won't upload that to curse or something as it's a very specific situation, but you can download the release from github here.
This probably means you messed with GUI element positions. The mod computes how many columns of items fit between the left side of the crafting gui and the left screen edge, and that division by zero means there was no space at all.
The slight overlap between the search box and whatever tab some mod added -- sorry, I won't do anything about it; you can still click that tab, and there are just too many mods to account for them all.
Btw, your log file should have one or more lines that say "has an empty component alternatives list" next to an item name. That should help tell you which mod is adding an incompatible recipe.