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