Implement basic command
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
b7becec073
commit
6789c757e1
@ -3,6 +3,7 @@ package wtf.beatrice.nounspicker;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.plugin.PluginManager;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import wtf.beatrice.nounspicker.commands.NounsCommand;
|
||||
import wtf.beatrice.nounspicker.objects.PAPIManager;
|
||||
import wtf.beatrice.nounspicker.utils.ConsoleLogger;
|
||||
|
||||
@ -31,6 +32,10 @@ public class NounsPicker extends JavaPlugin
|
||||
return;
|
||||
}
|
||||
|
||||
logger.log("Registering commands...");
|
||||
getCommand("nouns").setExecutor(new NounsCommand(this));
|
||||
logger.log("Commands registered!");
|
||||
|
||||
logger.log("Plugin loaded!");
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,34 @@
|
||||
package wtf.beatrice.nounspicker.commands;
|
||||
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import wtf.beatrice.nounspicker.NounsPicker;
|
||||
|
||||
public class NounsCommand implements CommandExecutor
|
||||
{
|
||||
|
||||
private NounsPicker plugin;
|
||||
public NounsCommand(NounsPicker plugin)
|
||||
{
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onCommand(@NotNull CommandSender sender,
|
||||
@NotNull Command cmd,
|
||||
@NotNull String label,
|
||||
@NotNull String[] args)
|
||||
{
|
||||
|
||||
if(args.length == 0)
|
||||
{
|
||||
sender.sendMessage("Please specify an argument!");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user