0.0.2: Bug Fixing about the previous Update

This commit is contained in:
unurled 2021-12-15 19:12:37 +01:00
parent 8741eecad4
commit 8aac201d7f
10 changed files with 191 additions and 37 deletions

View file

@ -0,0 +1,79 @@
package gq.unurled.raxen.commands;
import gq.unurled.raxen.Raxen;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.TextComponent;
import net.kyori.adventure.text.event.ClickEvent;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabExecutor;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.List;
import static gq.unurled.raxen.utils.Utils.color;
import static gq.unurled.raxen.utils.Utils.msgPlayer;
public class RaxenCommand implements TabExecutor {
private Raxen main;
public RaxenCommand(Raxen main) {
this.main = main;
}
@Override
public boolean onCommand(@NotNull CommandSender sender, @NotNull Command cmd, @NotNull String msg, @NotNull String[] args) {
if(sender instanceof Player) {
Player player = (Player) sender;
if(!(player.hasPermission("raxen."))) {
msgPlayer(player, Raxen.getPrefix() + color("&cYou can't execute this command. Insufficient permission."));
}
switch (args.length) {
case 0:
msgPl(player, 0);
case 1:
switch (args[0]) {
case "mongodb":
case "mongo":
case "MONGODB":
case "MONGO":
//print info about connection
case "v":
case "version":
case "ver":
//print case 0?
case "hemlp":
case "?":
case "h":
//print plugin help
}
}
}
return false;
}
public void msgPl(Player player, Integer in) {
switch(in) {
case 0:
msgPlayer(player, Raxen.getPrefix() + color("&6Printing About Raxen..."),
color("&6---------------------------------------------"),
color("&3 Raxen "),
color("&3 - Version: " + Raxen.getVersion()),
color("&3 - Author: &l&cU&6n&eu&2r&al&be&3d&r"),
color("&3 - Website: https://unurled.gq"));
TextComponent txt = Component.text(color("&3 - Website: https://unurled.gq"));
txt.clickEvent(ClickEvent.openUrl("https://unurled.gq"));
player.sendMessage(txt);
msgPlayer(player, "", color("&6---------------------------------------------"));
}
}
@Override
public @Nullable List<String> onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, @NotNull String[] args) {
return null;
}
}