Skip to content
/ toolbar Public

A Minecraft library that facilitates the creation of bundled items for player's hotbar.

License

Notifications You must be signed in to change notification settings

Tofpu/toolbar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Toolbar

A Minecraft library that facilitates the creation of bundled items for player's hotbar.

WARNING: The project is still under active development. Expect breaking changes to occur.

Usage

    private final ToolbarAPI toolbarAPI = new ToolbarAPI(this);

    @Override
    public void onEnable() {
        toolbarAPI.enable();
        registerToolbars();
    }

    private void registerToolbars() {
        // a list of staff tools, consisting of a kick and ban based tools
        List<StaffTool> staffTools = Arrays.asList(
            new StaffKickTool(),
            new StaffBanTool()
        );
        // constructs a staff-based toolbar consisting of the staff tools above
        StaffToolbar staffToolbar = new StaffToolbar("moderator-staff-bar", staffTools.toArray(new StaffTool[0]));
        // registers the staff-based toolbar to the registry for later use
        toolbarAPI.registerToolbar(staffToolbar);
        System.out.println("registerToolbars() called");
    }

    public void equipModTools(Player player) {
        // equips a toolbar that goes with the 
        // identifier "moderator-staff-bar" to the given player
        toolbarAPI.equip("moderator-staff-bar", player);
    }

    @Override
    public void onDisable() {
        if (toolbarAPI != null) {
            toolbarAPI.disable();
        }
    }

About

A Minecraft library that facilitates the creation of bundled items for player's hotbar.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages