Smaller fixes

This commit is contained in:
Norbi Peti 2016-12-04 19:06:18 +01:00
parent 8c08370220
commit 44984d8987
2 changed files with 18 additions and 9 deletions

View file

@ -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;
}

View file

@ -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);
});