Search in sources :

Example 1 with GuiElementInterface

use of eu.pb4.sgui.api.elements.GuiElementInterface in project ArmorStandEditor by Patbox.

the class EditorGuis method openGui.

public static void openGui(ServerPlayerEntity player) {
    SimpleGui gui = new SimpleGui(ScreenHandlerType.GENERIC_9X5, player, false) {

        @Override
        public boolean onClick(int index, ClickType type, SlotActionType action, GuiElementInterface element) {
            setIcons(player, this);
            return super.onClick(index, type, action, element);
        }
    };
    gui.setTitle(new TranslatableText("armorstandeditor.gui.editor_title"));
    setIcons(player, gui);
    gui.open();
}
Also used : TranslatableText(net.minecraft.text.TranslatableText) ClickType(eu.pb4.sgui.api.ClickType) SlotActionType(net.minecraft.screen.slot.SlotActionType) GuiElementInterface(eu.pb4.sgui.api.elements.GuiElementInterface) SimpleGui(eu.pb4.sgui.api.gui.SimpleGui)

Aggregations

ClickType (eu.pb4.sgui.api.ClickType)1 GuiElementInterface (eu.pb4.sgui.api.elements.GuiElementInterface)1 SimpleGui (eu.pb4.sgui.api.gui.SimpleGui)1 SlotActionType (net.minecraft.screen.slot.SlotActionType)1 TranslatableText (net.minecraft.text.TranslatableText)1