Smaller fixes
This commit is contained in:
parent
8c08370220
commit
44984d8987
2 changed files with 18 additions and 9 deletions
|
@ -1,5 +1,8 @@
|
|||
package buttondevteam.chat.commands;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import buttondevteam.lib.chat.TBMCCommandBase;
|
||||
|
@ -21,11 +24,15 @@ public class MWikiCommand extends TBMCCommandBase {
|
|||
for (int i = 0; i < args.length; i++)
|
||||
query += args[i] + " ";
|
||||
query = query.trim();
|
||||
if (args.length == 0)
|
||||
sender.sendMessage("§bMinecraft Wiki link: http://minecraft.gamepedia.com/");
|
||||
else
|
||||
sender.sendMessage("§bMinecraft Wiki link: http://minecraft.gamepedia.com/index.php?search=" + query
|
||||
+ "&title=Special%3ASearch&go=Go");
|
||||
try {
|
||||
if (args.length == 0)
|
||||
sender.sendMessage("§bMinecraft Wiki link: http://minecraft.gamepedia.com/");
|
||||
else
|
||||
sender.sendMessage("§bMinecraft Wiki link: http://minecraft.gamepedia.com/index.php?search="
|
||||
+ URLEncoder.encode(query, "UTF-8") + "&title=Special%3ASearch&go=Go");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,9 +10,12 @@ public class UpdatePlugin extends AdminCommandBase {
|
|||
|
||||
@Override
|
||||
public String[] GetHelpText(String alias) {
|
||||
return new String[] { "§6---- Update plugin ----",
|
||||
"This command downloads the latest version of a TBMC plugin from GitHub",
|
||||
"To update a plugin: /" + alias + " <plugin>", "To list the plugin names: /" + alias };
|
||||
return new String[] { //
|
||||
"§6---- Update plugin ----", //
|
||||
"This command downloads the latest version of a TBMC plugin from GitHub", //
|
||||
"To update a plugin: /" + alias + " <plugin>", //
|
||||
"To list the plugin names: /" + alias //
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -29,7 +32,6 @@ public class UpdatePlugin extends AdminCommandBase {
|
|||
}
|
||||
return true;
|
||||
} else {
|
||||
sender.sendMessage("Updating plugin...");
|
||||
Bukkit.getScheduler().runTaskAsynchronously(PluginMain.Instance, () -> {
|
||||
TBMCCoreAPI.UpdatePlugin(args[0], sender);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue