emilyploszaj / emi

A featureful and accessible item and recipe viewer
MIT License
220 stars 46 forks source link

Chance based output tooltip is confusing #484

Closed pupnewfster closed 3 months ago

pupnewfster commented 3 months ago

When hovering over an output that has a chance set the tooltip is "Consumption chance: x%", which sounds like it is meant for chance based inputs. But when viewing the recipe in the recipe tree, it shows that it displays that it is properly left over and what the rough amount is.

Version: 1.1.1+1.20.4

MrRedstoneToGo commented 3 months ago

Yea, EMI's recipe tree is very buggy when dealing with chances. Which mod do these recipes come from?

pupnewfster commented 3 months ago

They will be coming from Mekanism https://github.com/mekanism/Mekanism/pull/8035

Abbie5 commented 3 months ago

I can't reproduce this issue on the latest versions of EMI and Modern Industrialization on NeoForge 20.4.210.

2024-03-21_21 29 17

Did you set .recipeContext(this) on your output slots?

emilyploszaj commented 3 months ago

Abbie's on the right track here. Chance tooltips are based on whether EMI can tell if a recipe is an input or an output. Logical output slots should be defining their recipe context with .recipeContext(this) as Abbie said, which enables a handful of things in the slot hover, like changing consumption chance to production chance and displaying cost per batch of recipes utilizing recipe defaults. It's a bit of a confusingly named party of the API I will admit.

pupnewfster commented 3 months ago

Yeah, it works now, I was missing the recipe context. Thanks