Calculator

Calculator

6M Downloads

health processor nei crash

pabluuz opened this issue ยท 7 comments

commented

http://pastebin.com/XJMiKTvT
Crash happend after I've clicked on recipes arrow in health processor GUI. There's no problem at all in hunger processor, just health is broken.

I've updated to newest version today. Previously there was no problem at all.

Interesting thing: Clicking U ("usage") on any mob drop product like rotten flesh or egg, don't give me any information like in hunger processor. Also, when I put mob drops in health processor, they don't work at all.

Tell me if You need any more logs or something, I'd gladly help as much as I can. It's very good mod besides that bug, thank You!

commented

Seeing as the creator is on an indefinite hiatus, and I suck at minecraft coding, I have no idea what to do. I tried taking a look at the code and noticed the version number is off, but other than that, there's nothing I can actually fix.

commented

Hmm, as far as I see from crashlog it's NEI method override:

@OverRide
public void loadCraftingRecipes(String outputId, Object... results) {
if ((outputId.equals("healthvalue")) && (getClass() == HealthProcessorRecipeHandler.class)) {
Map<ItemStack, Integer> recipes = HealthProcessorRecipes.instance().getRecipes();
for (Map.Entry<ItemStack, Integer> recipe : recipes.entrySet())
this.arecipes.add(new ChancePair(recipe.getKey(), recipe.getValue()));
this.transferRects.clear();
} else {
super.loadCraftingRecipes(outputId, results);
}
}

It produces:
java.lang.ClassCastException: [Lnet.minecraft.item.ItemStack; cannot be cast to net.minecraft.item.ItemStack

what's the deal with this "[L" ? looks like it shouldn't be here :)

Well, I've got 0 experience with java, so I can't help anymore.

Some more information : When I click "u" on items that are used by hunger processor, they don't show hunger processor usage as well, and there's no option to click "recipes" on hunger processor, but he works just fine with any food.
Looks like it's NEI integration problem with health processor, but than, why it can't process items that are inside, are mystery to me. I'll look into server logs, maybe I'll find something helpful there.

commented

I noticed the L but there's no L or even minecraft.whatever in the code.

commented

i bet that it's like this:
itemStack is member of item class
item is a member of minecraft class
minecraft is member of net class (?)
if it was PHP, i'd bet that something added to string, I'll see what I can do later on

commented

Issue is found. How to fix? I'll check it out and see what I can do. Issue is in the ValueHelper in SonarCore.

commented

Ill post fix on Saturday, the problem is casting an Array of ItemStacks to a single ItemStack

commented

Fixed in dev