Choose an item panel style

On the client, panel_style(mod_id, style) chooses how the mod's panel_items panel looks. It is a WorldOnly operation: call it through the client host while a world is open, not from server code or a title-screen callback. The choice is kept for the session even while the panel is hidden; it is not a saved player preference.

From Sunrise's modding bookead8a1e

In every style the mouse wheel pages the panel while the pointer is over it: one page per notch, down to the next page and up to the previous one, stopping at the first and last page (it does not wrap, even in Classic). Recipe pages shown in the panel's place turn the same way, and the mod hears the turn as it does from the arrows. A notch over the panel does not reach the screen underneath; scrolling anywhere else is unchanged. No hook is needed for this.

PanelStyle has three variants:

  • RecipeBook (the default) uses recipe-book page arrows and a plain search field.
  • Viewer uses square page buttons on a bar and the Recipes panel's search field. It changes drawing, not layout.
  • Classic { centred_search, window_width } also changes layout: an 18 px ingredient grid sits 2 px from the screen's right edge below an always-visible page row with wrapping navigation. The gap from the container window can exceed 2 px when the free width is not divisible by 18. The search field ends 4 px above the screen bottom by default. With centred_search and room under the window, it moves under the window and ends 2 px above the screen bottom instead. Nonempty searches with no matches are red; other Classic search text is white.

For Classic, window_width: 0 uses the container's own bounds. A positive value reserves at least that much width for a centred recipe window. This width option is Sunrise's own, not a JEI 1.12 setting. The Classic wrench opens the owning mod's page in Options > Mods, not a shared viewer configuration screen. Only the page arrows are tinted; the wrench retains its own colours.

Switching back to RecipeBook or Viewer restores the normal search text colour, including after a failed Classic search. Changing the style does not replace the panel's item list or its event handling.

Edit this page on GitHub · Spotted something wrong? Open an issue or ask on Discord.