Skip to Content

最小构建示例

import link.botwmcs.fizzy.ui.background.BgType; import link.botwmcs.fizzy.ui.background.FizzyBg; import link.botwmcs.fizzy.ui.behind.BlurBehind; import link.botwmcs.fizzy.ui.core.FizzyGui; import link.botwmcs.fizzy.ui.core.FizzyGuiBuilder; import link.botwmcs.fizzy.ui.core.HostType; import link.botwmcs.fizzy.ui.element.background.FizzyBackgroundElement; import link.botwmcs.fizzy.ui.element.slot.SlotElement; import link.botwmcs.fizzy.ui.frame.FizzyFrame; import net.minecraft.network.chat.Component; FizzyGui gui = FizzyGuiBuilder.start() .host(HostType.SCREEN) .sizeSlots(6) // 9x6 .frame(new FizzyFrame(Component.literal("Demo"))) .background(new FizzyBg(BgType.STONE)) .behind(new BlurBehind()) .padByFrame() .element(new FizzyBackgroundElement(BgType.BARRIER_BLUE)) .done() .pad(1, 1, 6, 9) .element(new SlotElement()) .done() .build();

打开 Screen:

Minecraft.getInstance().setScreen(new FizzyScreenHost(gui));

打开 Menu Screen:

var screen = new FizzyMenuScreenHost<>(menu, inv, Component.literal("Title"), gui); Minecraft.getInstance().setScreen(screen);
Last updated on