Giter Club home page Giter Club logo

honeycomb's Introduction

Honeycomb

A dead simple and easy to use Spigot GUI Menu library.

License Discord

Honeycomb was designed to be as easy to use as possible, allowing easy creation of GUI menus that doesn't involve hacky shit with listeners and consistently works. Creating and opening a menu is as simple as this:

๐Ÿšฉ Creating + Opening a Menu

GUI Example

Here's the code used to make that menu:

// Define the menu and add borders and fills.
Menu menu = new Menu(player, "Honeycomb Menu", 27);
menu.fill(Material.WHITE_STAINED_GLASS_PANE);
menu.fillBorderAlternating(
    Material.PINK_STAINED_GLASS_PANE,
    Material.MAGENTA_STAINED_GLASS_PANE);

// This is the ItemStack we'll use to represent the button.
ItemStack buttonItem = new ItemStack(Material.HONEYCOMB);
ItemMeta buttonMeta = buttonItem.getItemMeta();
buttonMeta.setDisplayName(ChatColor.translateAlternateColorCodes('&', "&6&lHoneycomb"));
buttonMeta.setLore(Arrays.asList(
    ChatColor.GRAY + "A simple menu button.",
    ChatColor.YELLOW + "Click me!"
));
buttonItem.setItemMeta(buttonMeta);

// Add a clickable button to the menu.
menu.addButton(new MenuButton(menu, buttonItem, 13, (button, clickType) -> {
    // Stuff in here runs when the button is pressed.
    // Use ClickType to check for left-, right-, and shift-click.
    // button.setMaterial(Material.HONEY_BOTTLE);
    menu.getPlayer().playSound(menu.getPlayer().getLocation(), Sound.BLOCK_NOTE_BLOCK_BIT, 1.0f, 1.f);
    openOtherMenu(player);
}));

// Finally, open the menu to the player.
menu.open();

๐Ÿ”จ Using the Library

Don't shade Honeycomb into your plugin- instead, add it as a dependency in your plugin.yml and install it on your server. Latest builds are available over at the releases page.

depend: ['Honeycomb']

You can directly chuck Honeycomb into Maven using the latest hosted version on JitPack.

<repository>
    <id>jitpack.io</id>
    <url>https://jitpack.io</url>
</repository>
<dependency>
    <groupId>com.github.nkomarn</groupId>
    <artifactId>Honeycomb</artifactId>
    <version>Version tag from JitPack</version>
    <scope>provided</scope>
</dependency>

๐Ÿ™Œ It's as easy as that.

Creating GUI menus has never been simpler. All registration and handling is automatically taken care of for you, allowing you to focus on realizing your idea rather than figuring out how to do it- and that's the philosophy behind Honeycomb.

Honeycomb is a standalone version of the GUI library from Kerosene. I always struggled with clunky GUI solutions when making plugins for Firestarter, and after stumbling across the GUI system of PlayerParticles, I was heavily inspired to create this system. I hope you enjoy using it as much as I do. โœจ

honeycomb's People

Contributors

nkomarn avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.