Easily create and manage inventories for the Spigot API.
Clone or download
Latest commit 984703a Oct 23, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/main async Oct 13, 2018
.gitignore async Oct 13, 2018
CODE_OF_CONDUCT.md
LICENSE Create LICENSE Oct 13, 2018
README.md
pom.xml initial commit Oct 13, 2018

README.md

Oblique

Oblique-Logo

Introduction

Oblique is a fast and reliable menu API.

As a lightweight api, it should support almost all versions above 1.7.x on Spigot. If you find any bugs, feel free to open an Issue or a Pull Request

Contributing

If you do make a contribution, please try to be sure to comment/document all of the changes and/or additions you made to the project.

Build

Requirements

  • Java (JDK) 8 or above
  • Maven

Dependencies

  • Spigot API

Compile

mvn clean install

Usage

Examples

    @Override
    public void onEnable() {
        //Get the oblique instance
        Oblique oblique = Oblique.getInstance(this);
    }
public class ExampleMenu extends CommonMenu {

    public ExampleMenu() {
        super("Example", 3);
        //name, rows
    }

    @Override
    public Provider<Player, Table<Integer, ItemStack, MenuAction>> itemProvider() {
        return player -> {
            Table<Integer, ItemStack, MenuAction> toReturn = HashBasedTable.create();

            /* Fill redstone blocks around the menu */
            fill(toReturn, new ItemStack(Material.REDSTONE_BLOCK), RowType.AROUND);

            /* Put an gold_axe in the middle of the menu */
            toReturn.put(13, new ItemStack(Material.GOLD_AXE), clickType -> {
                /* Send a message with a random chatcolor by the clickTypes enum-ordinal incremented by one */
                player.sendMessage(ChatColor.values()[clickType.ordinal() + 1] + "You clicked: " + clickType);
                player.closeInventory();
                return true;
            });

            return toReturn;
        };
    }
}

Contact

  • Telegram - crunesmh
  • Discord - jesper#6242