Skip to content

net.kernelpanicsoft.archie.gui

Types

AUIScopeManager

Global registry of active CoroutineScopes created by open GUI screens.

ComposeBlockContainerMenu

abstract class ComposeBlockContainerMenu<T : BlockEntity, SELF : ComposeBlockContainerMenu<T, SELF>>(
    type: MenuType<SELF>, 
    id: Int, 
    playerInventory: Inventory, 
    tile: T
) : ComposeContainerMenuBase<SELF> 

Base class for BlockEntity-backed Compose container menus.

ComposeContainerMenuBase

abstract class ComposeContainerMenuBase<SELF : ComposeContainerMenuBase<SELF>>(
    type: MenuType<SELF>, 
    id: Int, 
    playerInventory: Inventory
) : AbstractContainerMenu

Holder-agnostic base for Compose-backed container menus: everything about slot layout, registration, and vanilla-menu plumbing that doesn't care whether the menu is backed by a net.minecraft.world.level.block.entity.BlockEntity (ComposeBlockContainerMenu) or an net.minecraft.world.item.ItemStack (net.kernelpanicsoft.archie.gui.item.ComposeItemContainerMenu).

ComposeContainerScreen

abstract class ComposeContainerScreen<T : ComposeContainerMenuBase<T>>(
    menu: T, 
    playerInventory: Inventory, 
    title: Component, 
    val asynchronous: Boolean = true
) : AbstractContainerScreen<T> , CoroutineScope, SlotLayerDepthProvider, SlotHighlightClipProvider, ScreenOverlayDeferral, ComposeIdleAware, LayerManagerProvider

A Compose-driven AbstractContainerScreen with layer support, async recomposition, and vanilla Slot rendering kept in sync with the Compose-reported SlotGroup layout.

ComposeIdleAware

interface ComposeIdleAware

Implemented by Compose-driven screens that recompose asynchronously, so test harnesses can poll for a settled frame (no pending or in-flight recomposition) before asserting on rendered output - e.g. before taking a screenshot right after simulating a click.

ComposeScreen

abstract class ComposeScreen(title: Component, val asynchronous: Boolean = true) : Screen, CoroutineScope, ComposeIdleAware, LayerManagerProvider

A Compose-driven Minecraft Screen base class with layer support, async recomposition, and full pointer/keyboard input dispatch.

ComposeTestClockOverride

Test-only override, installed by the client GameTest harness (AClientGameTestHarness.kt), that swaps ComposeScreen's real-time coroutine dispatcher for a virtual one so a composable's delay(...) (e.g. a dialog's close animation) resolves deterministically against a scheduler the harness drives itself, instead of racing real wall-clock time, real thread scheduling, and the harness's tick-based polling - the same class of flakiness Jetpack Compose's own test tooling (ComposeTestRule/runComposeUiTest) avoids by construction, backing composition with a virtual clock/dispatcher that waitForIdle() drives forward instead of polling real concurrency. null unless a client GameTest explicitly installs one; the running game never touches this.

LayerManagerProvider

Implemented by hosts (screens) that own a LayerStackManager for their layer stack.

SlotClipSource

A layout-synchronous (non-Compose-state) holder for a Scrollable's current clip bounds.

SlotData

@Serializable



data class SlotData(
    val groups: MutableMap<String, SlotGroup> = mutableMapOf(), 
    val playerGroup: SlotGroup = SlotGroup(size = IntSize(9, 3))
)

Aggregated slot layout data for an entire ComposeContainerScreen.

SlotGroup

@Serializable



data class SlotGroup(
    var pos: IntCoordinates = IntCoordinates(0, 0), 
    var size: IntSize = IntSize(0, 0), 
    var enabled: Boolean = true, 
    var layerDepth: Int = 0, 
    var slots: MutableSet<IntCoordinates> = mutableSetOf(), 
    var clip: IntRect? = null
)

Per-slot-group layout data reported back from the Compose layout to ComposeContainerMenuBase.

Properties

LocalContainerMenu

val LocalContainerMenu: ProvidableCompositionLocal<ComposeContainerMenuBase<*>>

Provides the current ComposeContainerMenuBase to any composable in its tree.

LocalContainerScreen

val LocalContainerScreen: ProvidableCompositionLocal<ComposeContainerScreen<*>>

Provides the current ComposeContainerScreen to any composable in its tree.

LocalScreen

val LocalScreen: ProvidableCompositionLocal<ComposeScreen>

Provides the current ComposeScreen to any composable in its tree.

LocalSlotClipBounds

val LocalSlotClipBounds: ProvidableCompositionLocal<SlotClipSource?>

Provides the active SlotClipSource (if any) from the nearest ancestor scroll/clip container.

LocalSlotData

val LocalSlotData: ProvidableCompositionLocal<SlotData>

Provides the SlotData to all composables within a ComposeContainerScreen.

LocalSlotGroup

val LocalSlotGroup: ProvidableCompositionLocal<SlotGroup>

Provides the current SlotGroup to Slot composables inside a Slots container.

LocalVanillaScreen

val LocalVanillaScreen: ProvidableCompositionLocal<Screen>

Provides the hosting vanilla Screen, regardless of whether it's a ComposeScreen or a ComposeContainerScreen - unlike LocalScreen/LocalContainerScreen, which are mutually exclusive depending on the screen type, this is provided by both.

Functions

PlayerSlots

@Composable



fun PlayerSlots()

Renders the standard 4-row player inventory (3 main rows + hotbar) as Slot composables.

Slot

@Composable



fun Slot(texture: String = "slot", modifier: Modifier = Modifier)

Renders a single inventory slot graphic and records its absolute screen position.

Slots

@Composable



fun Slots(
    id: String, 
    width: Int = 1, 
    height: Int = 1, 
    content: @Composable



 () -> Unit = {
        Column {
            repeat(height) {
                Row {
                    repeat(width) {
                        Slot()
                    }
                }
            }
        }
    }
): SlotGroup

Defines a named region of inventory slots within a ComposeContainerScreen.