mirror of
https://github.com/essentials/Essentials.git
synced 2025-08-15 11:04:29 +02:00
Cleanup of KHobbits commit
This commit is contained in:
@@ -31,7 +31,7 @@ public class Commandhelp extends EssentialsCommand
|
|||||||
protected void run(Server server, User user, String commandLabel, String[] args) throws Exception
|
protected void run(Server server, User user, String commandLabel, String[] args) throws Exception
|
||||||
{
|
{
|
||||||
int page = 1;
|
int page = 1;
|
||||||
String match = args[0].toLowerCase();
|
String match = args[0].toLowerCase();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (args.length > 0)
|
if (args.length > 0)
|
||||||
@@ -39,7 +39,7 @@ public class Commandhelp extends EssentialsCommand
|
|||||||
page = Integer.parseInt(args[args.length - 1]);
|
page = Integer.parseInt(args[args.length - 1]);
|
||||||
if (args.length == 1)
|
if (args.length == 1)
|
||||||
{
|
{
|
||||||
match = "";
|
match = "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,10 +69,10 @@ public class Commandhelp extends EssentialsCommand
|
|||||||
private List<String> getHelpLines(User user, String match) throws Exception
|
private List<String> getHelpLines(User user, String match) throws Exception
|
||||||
{
|
{
|
||||||
List<String> retval = new ArrayList<String>();
|
List<String> retval = new ArrayList<String>();
|
||||||
File helpFile = new File(ess.getDataFolder(), "help_"+Util.sanitizeFileName(user.getName()) +".txt");
|
File helpFile = new File(ess.getDataFolder(), "help_" + Util.sanitizeFileName(user.getName()) + ".txt");
|
||||||
if (!helpFile.exists())
|
if (!helpFile.exists())
|
||||||
{
|
{
|
||||||
helpFile = new File(ess.getDataFolder(), "help_"+Util.sanitizeFileName(user.getGroup()) +".txt");
|
helpFile = new File(ess.getDataFolder(), "help_" + Util.sanitizeFileName(user.getGroup()) + ".txt");
|
||||||
}
|
}
|
||||||
if (!helpFile.exists())
|
if (!helpFile.exists())
|
||||||
{
|
{
|
||||||
@@ -81,7 +81,8 @@ public class Commandhelp extends EssentialsCommand
|
|||||||
if (helpFile.exists())
|
if (helpFile.exists())
|
||||||
{
|
{
|
||||||
final BufferedReader bufferedReader = new BufferedReader(new FileReader(helpFile));
|
final BufferedReader bufferedReader = new BufferedReader(new FileReader(helpFile));
|
||||||
try {
|
try
|
||||||
|
{
|
||||||
|
|
||||||
while (bufferedReader.ready())
|
while (bufferedReader.ready())
|
||||||
{
|
{
|
||||||
@@ -107,7 +108,7 @@ public class Commandhelp extends EssentialsCommand
|
|||||||
for (Entry<String, HashMap<String, String>> k : cmds.entrySet())
|
for (Entry<String, HashMap<String, String>> k : cmds.entrySet())
|
||||||
{
|
{
|
||||||
if ((!match.equalsIgnoreCase("")) && (!p.getDescription().getName().toLowerCase().contains(match))
|
if ((!match.equalsIgnoreCase("")) && (!p.getDescription().getName().toLowerCase().contains(match))
|
||||||
&& (!p.getDescription().getDescription().toLowerCase().contains(match)))
|
&& (!p.getDescription().getDescription().toLowerCase().contains(match)))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user