[Bug] REI interprets tooltip components improperly
emilyploszaj opened this issue ยท 1 comments
It has come to my attention that REI cares about the compatibility with its rendering and other mods' items and reached out to mods that used tooltip components asking them to change what they do. Unfortunately the proposed solution was impossible and clearly untested. The issue is caused by, and can only be fixed by, REI itself.
REI is only compatible with vanilla tooltip components, being only the bundle tooltip component. The only way a mod's custom tooltip component could ever possibly show up is either with an overwrite or by a mixin into REI itself. REI should get tooltip components the same way vanilla does, using the synthetic lambda method method_32635
, which takes a list of tooltip components and a tooltip data to convert into a tooltip component put at index 1 of that list. This is where all mods that add custom handling for their conversion for tooltip data -> tooltip components inject into, and where future fabric and quilt apis will be putting their injections.
This is yarn
@Mixin(Screen.class)
public interface ScreenAccessor {
@Invoker("method_32635")
public static void invokeMethod_32635(List<TooltipComponent> list, TooltipData data) {
throw new AssertionError("Someone has been tampering with the universe");
}
}
List<TooltipComponent> list = Lists.newArrayList((TooltipComponent) null);
BundleTooltipData data = new BundleTooltipData(DefaultedList.of(), 0);
ScreenAccessor.invokeMethod_32635(list, data);
// List now contains tooltip component at index 1