Skip to content

Interpreters

Tobero edited this page Sep 16, 2023 · 3 revisions

Interpreters

Javadoc ToberoCat - GuiEngine Donate PayPal stars - GuiEngine forks - GuiEngine GitHub release issues - GuiEngine SpigotMain - GuiEngine


Interpreters

Interpreters are the hearth of gui engine. They are the ones responsible for showing the XML in an appropriate gui.

Common interpreter properties

  • All interpreters support components
  • Each interpreter supports the following the load and render functions.

Sizeable interpreter

This interpreter is pretty flexible. It allows creating chest guis of any size

Id: default Attributes:

  • width - Required. Set the width of the component. This will only have effect when the gui is being embedded
  • height - Required. The height of the gui. This sets the row of slots
  • title - Required. The title the gui will have
  • implicit-update - Optional. This defaults to true. When set to true, each time the gui is being rendered, compute functions will be computed again. This might make sense to turn off when your gui doesn't have any compute functions that should change between gui sessions, to save processing power

Anvil Interpreter

Opens a anvil gui

image

Id: anvil Attributes:

  • title - Required. Set the title of the anvil gui.
  • implicit-update - Optional. This defaults to true. When set to true, each time the gui is being rendered, compute functions will be computed again. This might make sense to turn off when your gui doesn't have any compute functions that should change between gui sessions, to save processing power

Chest Interpreter

Opens a chest gui. It will always have a width of 9 and height of 3

Id: chest Attributes:

  • title - Required. Set the title of the gui.
  • implicit-update - Optional. This defaults to true. When set to true, each time the gui is being rendered, compute functions will be computed again. This might make sense to turn off when your gui doesn't have any compute functions that should change between gui sessions, to save processing power

Dispenser Interpreter

Opens a dispenser gui. It will always have a width of 3 and height of 3

image

Id: dispenser Attributes:

  • title - Required. Set the title of the gui.
  • implicit-update - Optional. This defaults to true. When set to true, each time the gui is being rendered, compute functions will be computed again. This might make sense to turn off when your gui doesn't have any compute functions that should change between gui sessions, to save processing power

Example:

<gui interpreter="dispenser" title="§eDispenser Interpreter">
    <component type="item" material="IRON_BLOCK" name="§eBack">
        <on-click type="action">[container:previous]</on-click>
    </component>
</gui>

Enchanting Interpreter

Opens a enchanting gui

Id: enchanting Attributes:

  • title - Required. Set the title of the gui.
  • implicit-update - Optional. This defaults to true. When set to true, each time the gui is being rendered, compute functions will be computed again. This might make sense to turn off when your gui doesn't have any compute functions that should change between gui sessions, to save processing power

Furnace Interpreter

Opens a furnace gui

image

Id: furnace Attributes:

  • title - Required. Set the title of the gui.
  • implicit-update - Optional. This defaults to true. When set to true, each time the gui is being rendered, compute functions will be computed again. This might make sense to turn off when your gui doesn't have any compute functions that should change between gui sessions, to save processing power

Workbench Interpreter

Opens a workbench gui

image

Id: workbench Attributes:

  • title - Required. Set the title of the gui.
  • implicit-update - Optional. This defaults to true. When set to true, each time the gui is being rendered, compute functions will be computed again. This might make sense to turn off when your gui doesn't have any compute functions that should change between gui sessions, to save processing power