Config Tabs
MyoConfigTab is the record used to describe a tab in the Myotus terminal settings UI.
What a config tab contains
Section titled “What a config tab contains”- a title component
- either a texture blitter or an
ItemStackicon - a
stylePathpointing to the active screen style JSON - a
MyoConfigTabScreenimplementation used to build the tab UI - a
MyoConfigTabVisibilitypredicate used to decide whether the tab should render for the current terminal
Example
Section titled “Example”MyotusAPI.configRegistrar().registerTerminalConfigTab(new MyoConfigTab( Component.literal("Example"), Icon.COG, "example_terminal.json", new ExampleConfigScreen()) .visibleWhen(context -> context.isItemHost()));Icon options
Section titled “Icon options”MyoConfigTab supports multiple icon shapes:
- AE2
Icon - Myotus
MyoIcon - plain
ItemStack
Visibility helpers
Section titled “Visibility helpers”1.21.1 adds a first-class visibility layer:
MyoConfigTabVisibility.ALWAYS_VISIBLEMyoConfigTab.visibleWhen(...)MyoConfigTabContext.from(menu)
MyoConfigTabContext lets a visibility check inspect the current terminal host.
Useful helpers include:
isItemHost()getHostItemStack()isHostItem(Item)isHostItem(ResourceLocation)isHostItemFrom(String namespace)
That means addon tabs can be shown only for specific portable terminals or host item families without manually duplicating host-inspection code in the UI layer.
Style path
Section titled “Style path”The stylePath should point at the relevant screen style JSON. In the inspected source trees, Myotus itself registers a tab backed by:
assets/ae2/screens/config/myotus.jsonWhat Myotus registers for itself
Section titled “What Myotus registers for itself”Both lines call MyotusConfigTab.initialize() during common setup and register the built-in terminal settings tab with:
- translated title text
- the Myotus icon set
myotus.jsonas the style pathMyotusConfigScreenas the screen implementation
Registrar helpers
Section titled “Registrar helpers”IConfigRegistrar in 1.21.1 also adds fluent helpers:
registerTerminalConfigTab(tab)registerTerminalConfigTabs(iterable)
Those helpers are not present in the older 1.20.1 line.