SimpleGuiApi icon

SimpleGuiApi -----

A simple to use gui api!



Description
Simple Gui Api is as its name implies a simple gui api. The aim is to aid developer in the creation of custom GUIs and menus. Its simplistic design makes it easy to get a gui up and running quickly
Features
  • Easy to learn
  • Simple to understand
  • Clean code
  • Documention
JavaDocs
ExampleGuiPlugin
Code (Text):

package com.aim.coltonjgriswold.egp;

import org.bukkit.Material;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.inventory.ClickType;
import org.bukkit.event.player.PlayerInteractEvent;
import org.bukkit.plugin.java.JavaPlugin;

import com.aim.coltonjgriswold.sga.api.SimpleGui;
import com.aim.coltonjgriswold.sga.api.gui.ISimpleAction;
import com.aim.coltonjgriswold.sga.api.gui.ISimpleGuiPage;

public class ExampleGuiPlugin extends JavaPlugin implements Listener {

    private static ExampleGuiPlugin plugin;
    private SimpleGui gui;

    public void onEnable() {
        plugin = this;
        gui = new SimpleGui();
        ISimpleGuiPage page = gui.createPage("Test 0", 9);
        page.addSimpleButton(Material.RED_CONCRETE, "&6Secret Message", new ISimpleAction() {

            @Override
            public void run(Player player, ClickType click) {
                player.sendMessage("STOP THAT!");
            }
        });
        page.addSimpleButton(Material.GREEN_CONCRETE, "Say hi.", new ExampleAction());
        gui.addPages(page);
        getServer().getPluginManager().registerEvents(this, this);
    }

    @EventHandler
    public void OnClickAir(PlayerInteractEvent event) {
        if (event.getAction().equals(Action.LEFT_CLICK_AIR)) {
            Player player = event.getPlayer();
            gui.open(player, 0);
        }
    }

    public static ExampleGuiPlugin instance() {
        return plugin;
    }
}
 
Code (Text):
package com.aim.coltonjgriswold.egp;

import org.bukkit.entity.Player;
import org.bukkit.event.inventory.ClickType;

import com.aim.coltonjgriswold.sga.api.gui.ISimpleAction;

public class ExampleAction implements ISimpleAction {
 
    @Override
    public void run(Player player, ClickType click) {
        player.sendMessage("The Cake Is A Lie!");
        player.closeInventory();
    }
}
Code (Text):

name: ExampleGuiPlugin
author: 'Colton Griswold'
main: com.aim.coltonjgriswold.egp.ExampleGuiPlugin
version: 0.0.1
depend: [SimpleGuiApi]
api-version: 1.14
 
Resource Information
Author:
----------
Total Downloads: 1,796
First Release: Feb 18, 2018
Last Update: Jul 3, 2022
Category: ---------------
All-Time Rating:
1 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings