Less error messages, channel and command changes applied #66

Merged
NorbiPeti merged 6 commits from dev into master 2017-05-15 00:38:33 +00:00
7 changed files with 18 additions and 34 deletions
Showing only changes of commit 8f69e40d8b - Show all commits

View file

@ -168,7 +168,8 @@ public class PluginMain extends JavaPlugin { // Translated to Java: 2015.07.15.
errorcount++;
if (errorcount >= 10) {
errorcount = 0;
TBMCCoreAPI.SendException("Error while getting flairs from Reddit!", e);
if (!e.getMessage().contains("Server returned HTTP response code"))
TBMCCoreAPI.SendException("Error while getting flairs from Reddit!", e);
}
}
}

View file

@ -15,7 +15,7 @@ import buttondevteam.lib.chat.OptionallyPlayerCommandClass;
import buttondevteam.lib.player.TBMCPlayer;
@CommandClass(modOnly = false)
@OptionallyPlayerCommandClass(playerOnly = false)
@OptionallyPlayerCommandClass(playerOnly = true)
public class AcceptCommand extends UCommandBase {
@Override

View file

@ -8,6 +8,8 @@ import buttondevteam.chat.PluginMain;
import buttondevteam.lib.chat.*;
import buttondevteam.lib.player.TBMCPlayer;
@CommandClass(modOnly = false)
@OptionallyPlayerCommandClass(playerOnly = true)
public class CCommand extends UCommandBase {
@Override

View file

@ -6,9 +6,11 @@ import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import buttondevteam.chat.PluginMain;
import buttondevteam.lib.chat.CommandClass;
import buttondevteam.lib.chat.TBMCChatAPI;
import buttondevteam.lib.chat.TBMCCommandBase;
@CommandClass(modOnly = false)
public final class HelpCommand extends UCommandBase {
@Override
@ -35,8 +37,8 @@ public final class HelpCommand extends UCommandBase {
ArrayList<String> text = new ArrayList<String>();
text.add("§6---- Command list ----");
for (TBMCCommandBase cmd : TBMCChatAPI.GetCommands().values())
if (!cmd.GetModOnly() || PluginMain.permission.has(sender, "tbmc.admin"))
if (!cmd.GetPlayerOnly() || sender instanceof Player)
if (!cmd.getClass().getAnnotation(CommandClass.class).modOnly() || PluginMain.permission.has(sender, "tbmc.admin"))
if (!cmd.isPlayerOnly() || sender instanceof Player)
if (!cmd.GetCommandPath().contains(" "))
text.add("/" + cmd.GetCommandPath());
else {
@ -79,14 +81,4 @@ public final class HelpCommand extends UCommandBase {
return true;
}
@Override
public String GetUCommandPath() {
return "help";
}
@Override
public boolean GetPlayerOnly() {
return false;
}
}

View file

@ -5,8 +5,12 @@ import org.bukkit.entity.Player;
import buttondevteam.chat.ChatPlayer;
import buttondevteam.chat.FlairStates;
import buttondevteam.lib.chat.CommandClass;
import buttondevteam.lib.chat.OptionallyPlayerCommandClass;
import buttondevteam.lib.player.TBMCPlayer;
@CommandClass(modOnly = false)
@OptionallyPlayerCommandClass(playerOnly = true)
public final class IgnoreCommand extends UCommandBase {
@Override
@ -38,9 +42,4 @@ public final class IgnoreCommand extends UCommandBase {
return true;
}
@Override
public String GetUCommandPath() {
return "ignore";
}
}

View file

@ -3,10 +3,12 @@ package buttondevteam.chat.commands.ucmds;
import org.bukkit.command.CommandSender;
import buttondevteam.lib.TBMCCoreAPI;
import buttondevteam.lib.chat.CommandClass;
import buttondevteam.lib.player.TBMCPlayer;
import buttondevteam.lib.player.ChromaGamerBase.InfoTarget;
import buttondevteam.lib.player.TBMCPlayerBase;
@CommandClass(modOnly = false)
public class InfoCommand extends UCommandBase {
@Override
@ -18,11 +20,6 @@ public class InfoCommand extends UCommandBase {
};
}
@Override
public String GetUCommandPath() {
return "info";
}
@Override
public boolean OnCommand(CommandSender sender, String alias, String[] args) {
if (args.length == 0)
@ -44,9 +41,4 @@ public class InfoCommand extends UCommandBase {
}
return true;
}
@Override
public boolean GetPlayerOnly() {
return false;
}
}

View file

@ -2,6 +2,9 @@ package buttondevteam.chat.commands.ucmds;
import org.bukkit.command.CommandSender;
import buttondevteam.lib.chat.CommandClass;
@CommandClass(modOnly = false)
public class OpmeCommand extends UCommandBase {
@Override
@ -15,9 +18,4 @@ public class OpmeCommand extends UCommandBase {
return true;
}
@Override
public String GetUCommandPath() {
return "opme";
}
}