All source projects

MrUltimateLibrary Source

Standalone source project / 68 files

MrUltimateLibrary is the backbone of all my plugins; it offers features that facilitate plugin creation, maintenance, and updates.

java

MrUltimateLibrary/src/main/java/eu/mrneznamy/mrultimatelibrary/utils/MrLibHelperExample.java

JAVA · Read-only source

package eu.mrneznamy.mrultimatelibrary.utils;

import org.bukkit.plugin.java.JavaPlugin;
import java.util.ArrayList;
import java.util.List;

/**
 * Example plugin showing how to use MrLibHelper system
 * 
 * This is just an example - copy the code to your actual plugin's onEnable() method
 */
public class MrLibHelperExample extends JavaPlugin {

    @Override
    public void onEnable() {
        registerHelpCommands();
    }

    private void registerHelpCommands() {
        List<MrLibHelper.CommandInfo> commands = new ArrayList<>();
        
        
        commands.add(new MrLibHelper.CommandInfo(
            "/myplugin create <name>", 
            "Create a new item with specified name", 
            "/myplugin create MyAwesomeItem"
        ));
        
        commands.add(new MrLibHelper.CommandInfo(
            "/myplugin delete <id>", 
            "Delete item by ID", 
            "/myplugin delete 123"
        ));
        
        commands.add(new MrLibHelper.CommandInfo(
            "/myplugin list", 
            "List all items", 
            "/myplugin list"
        ));
        
        commands.add(new MrLibHelper.CommandInfo(
            "/myplugin edit <id> <name>", 
            "Edit item name", 
            "/myplugin edit 123 NewName"
        ));
        
        commands.add(new MrLibHelper.CommandInfo(
            "/myplugin reload", 
            "Reload plugin configuration", 
            "/myplugin reload"
        ));
        
        commands.add(new MrLibHelper.CommandInfo(
            "/myplugin version", 
            "Show plugin version", 
            "/myplugin version"
        ));
        
        
        
        MrLibHelper.registerPluginCommands(this, "MyPlugin", commands);
        
        getLogger().info("MyPlugin commands registered with MrLibHelper!");
    }
}
66 linesGNU GENERAL PUBLIC LICENSE · Version 3, 29 June 2007 · UTF-8 · Read only