Applied changes

This commit is contained in:
Norbi Peti 2016-12-04 20:07:02 +01:00
parent 44984d8987
commit 57f15694ad
5 changed files with 6 additions and 99 deletions

View file

@ -75,7 +75,7 @@ public class CommandCaller implements CommandExecutor {
}
if (cmd == null) {
if (hadspace) {
sender.sendMessage(TBMCChatAPI.GetSubCommands(path));
sender.sendMessage(TBMCChatAPI.GetSubCommands(path, sender));
return true;
}
String[] errormsg = new String[] { //

View file

@ -3,7 +3,9 @@ package buttondevteam.chat.commands.ucmds;
import java.util.ArrayList;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import buttondevteam.chat.PluginMain;
import buttondevteam.lib.chat.TBMCChatAPI;
import buttondevteam.lib.chat.TBMCCommandBase;
@ -34,7 +36,9 @@ public final class HelpCommand extends UCommandBase {
text.add("§6---- Command list ----");
for (TBMCCommandBase cmd : TBMCChatAPI.GetCommands().values())
if (!cmd.GetCommandPath().contains(" "))
text.add("/" + cmd.GetCommandPath());
if (!cmd.GetModOnly() || PluginMain.permission.has(sender, "tbmc.admin"))
if (!cmd.GetPlayerOnly() || sender instanceof Player)
text.add("/" + cmd.GetCommandPath());
sender.sendMessage(text.toArray(new String[text.size()]));
} else if (args[0].equalsIgnoreCase("colors")) {
sender.sendMessage(new String[] { "§6---- Chat colors/formats ----", //

View file

@ -1,34 +0,0 @@
package buttondevteam.chat.commands.ucmds;
import org.bukkit.command.CommandSender;
import buttondevteam.lib.chat.TBMCChatAPI;
import buttondevteam.lib.chat.TBMCCommandBase;
public final class UCommand extends TBMCCommandBase {
@Override
public String[] GetHelpText(String alias) {
return TBMCChatAPI.GetSubCommands(this);
}
@Override
public boolean OnCommand(CommandSender sender, String alias, String[] args) {
return false;
}
@Override
public String GetCommandPath() {
return "u";
}
@Override
public boolean GetPlayerOnly() {
return false;
}
@Override
public boolean GetModOnly() {
return false;
}
}

View file

@ -1,34 +0,0 @@
package buttondevteam.chat.commands.ucmds.admin;
import org.bukkit.command.CommandSender;
import buttondevteam.chat.commands.ucmds.UCommandBase;
import buttondevteam.lib.chat.TBMCChatAPI;
public final class AdminCommand extends UCommandBase {
@Override
public String[] GetHelpText(String alias) {
return TBMCChatAPI.GetSubCommands(this);
}
@Override
public boolean OnCommand(CommandSender sender, String alias, String[] args) {
return false;
}
@Override
public String GetUCommandPath() {
return "admin";
}
@Override
public boolean GetPlayerOnly() {
return false;
}
@Override
public boolean GetModOnly() {
return true;
}
}

View file

@ -1,29 +0,0 @@
package buttondevteam.chat.commands.ucmds.announce;
import org.bukkit.command.CommandSender;
import buttondevteam.chat.commands.ucmds.UCommandBase;
import buttondevteam.lib.chat.TBMCChatAPI;
public class AnnounceCommand extends UCommandBase {
@Override
public String[] GetHelpText(String alias) {
return TBMCChatAPI.GetSubCommands(this);
}
@Override
public boolean OnCommand(CommandSender sender, String alias, String[] args) {
return false;
}
@Override
public String GetUCommandPath() {
return "announce";
}
@Override
public boolean GetPlayerOnly() {
return false;
}
}