HomeJavaModsLibraries for Pinki
Libraries for Pinki
A library blessed by pinki that facilitates many things 7u7

Features:
* simple system to create advanced commands .

Spoiler: Create Commands
Spoiler: SingleCommand
Single command:
Create a class extending PLIBCommand and implement the methods.
Code (Java):
public class CustomCmd extends PLIBCommand {

    @Override
    public boolean execute (CommandSender sender, String label, String [ ] args ) {
        // TODO Auto-generated method stub
        return false ;
    }

    @Override
    public String [ ] setAliases ( ) {
        // TODO Auto-generated method stub
        return null ;
    }

    @Override
    public String setDescription ( ) {
        // TODO Auto-generated method stub
        return null ;
    }

    @Override
    public int setMaxArgs ( ) {
        // TODO Auto-generated method stub
        return 0 ;
    }

    @Override
    public int setMinArgs ( ) {
        // TODO Auto-generated method stub
        return 0 ;
    }

    @Override
    public String setFewArgumentsMessage ( ) {
        // TODO Auto-generated method stub
        return null ;
    }

    @Override
    public String setTooManyArgumentsMessage ( ) {
        // TODO Auto-generated method stub
        return null ;
    }

    @Override
    public String setPermission ( ) {
        // TODO Auto-generated method stub
        return null ;
    }

    @Override
    public String setNotPermissionMessage ( ) {
        // TODO Auto-generated method stub
        return null ;
    }

    @Override
    public SenderType onlyFor ( ) {
        // TODO Auto-generated method stub
        return null ;
    }

    @Override
    public String setOnlyForMessage ( ) {
        // TODO Auto-generated method stub
        return null ;
    }

}
The execute method will be who executes the command.
Code (Java):
@Override
    public boolean execute (CommandSender sender, String label, String [ ] args ) {
        sender. sendMessage ( "custom command" ) ;
        return true ;
    }
The other methods are to adjust the parameters of the command, leaving them as null will make them return to the default value.

Set onlyFor:
Set sender type with SenderType:
Code (Java):
@Override
    public SenderType onlyFor ( ) {
        return SenderType. PLAYER ;
    }
There are three types of sender: PLAYER, CONSOLE and ALL.
Returning it null will be the same as returning it ALL

To register, in the onEnable method place:
Code (Java):
@Override
public void onEnable ( )   {
   
    PLIBCommandAPI comandAPI = PLIB. CommandCreatorAPI ;

    commandAPI. newCommand (YourPlugin, "NameOfCommand", new CustomCmd ( ) ) ;
   
}
change "new CustomCmd()" for the class you created.
Spoiler: RootCommand
Code (Java):
public class CustomCmd extends PLIBSubCommandRoot {

    @Override
    public boolean execute (CommandSender sender, String Label ) {
        // TODO Auto-generated method stub
        return false ;
    }

    @Override
    public String [ ] setAliases ( ) {
        // TODO Auto-generated method stub
        return null ;
    }

    @Override
    public String setDescription ( ) {
        // TODO Auto-generated method stub
        return null ;
    }

    @Override
    public String setNoSubcommandExistMessage ( ) {
        // TODO Auto-generated method stub
        return null ;
    }

    @Override
    public String setPermission ( ) {
        // TODO Auto-generated method stub
        return null ;
    }

    @Override
    public String setNotPermissionMessage ( ) {
        // TODO Auto-generated method stub
        return null ;
    }

    @Override
    public SenderType onlyFor ( ) {
        // TODO Auto-generated method stub
        return null ;
    }

    @Override
    public String setOnlyForMessage ( ) {
        // TODO Auto-generated method stub
        return null ;
    }

}
Root Command and SubCommand:
To create a root command create a class and extend PLIBSubCommandRoot and follow the same steps as with the single command.


To create subcommands is the same but extending PLIBSubCommand.
Code (Java):
public class SubCustomCmd extends PLIBSubCommand {

    public CustomCmd ( String name ) {
        super (name ) ;
        // TODO Auto-generated constructor stub
    }

    @Override
    public boolean execute (CommandSender sender, String label, String [ ] args ) {
        // TODO Auto-generated method stub
        return false ;
    }

    @Override
    public int setMaxArgs ( ) {
        // TODO Auto-generated method stub
        return 0 ;
    }

    @Override
    public int setMinArgs ( ) {
        // TODO Auto-generated method stub
        return 0 ;
    }

    @Override
    public String setPermission ( ) {
        // TODO Auto-generated method stub
        return null ;
    }

    @Override
    public String setNotPermissionMessage ( ) {
        // TODO Auto-generated method stub
        return null ;
    }

    @Override
    public String setFewArgumentsMessage ( ) {
        // TODO Auto-generated method stub
        return null ;
    }

    @Override
    public String setTooManyArgumentsMessage ( ) {
        // TODO Auto-generated method stub
        return null ;
    }

    @Override
    public SenderType onlyFor ( ) {
        // TODO Auto-generated method stub
        return null ;
    }

    @Override
    public String setOnlyForMessage ( ) {
        // TODO Auto-generated method stub
        return null ;
    }

}
the difference is that this has a constructor.

To register a root command and its respective subcommands, in onEnable () place:
Code (Java):
@Override
public void onEnable ( )   {
 
    PLIBCommandAPI comandAPI = PLIB. CommandCreatorAPI ;

    commandAPI. newCommand (YourPlugin, "NameOfRootCommand", new CustomCmd ( ), new PLIBSubCommand [ ] { new SubCustomCmd ( "NameOfSubCommand" ) } ) ;
 
}
change "new CustomCmd()" for the the root command class that you created, in PLIBSubCommand[] put all the subcommand classes you want.

Planned features:
*
packet interceptor
* reflection util
* NMS implementation
* give ideas uwu


This library will be updated when one of my plugins so requires, or suggest an idea for this that facilitates the construction of plugins.

Hail Pinki!

Plugin details

Read from the plugin's own plugin.yml.

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

Libraries for Pinki is a free Minecraft Java mod. Compatible with Minecraft 1.13. Downloaded 224 times (via Spigot). Download it and open it directly in the game.

Explore more