Finally implemented #41 and an event
YEEHAW Oh, and smaller /mwiki changes
This commit is contained in:
parent
bd55c580c9
commit
3aacd07691
2 changed files with 13 additions and 8 deletions
|
@ -25,8 +25,9 @@ public class MWikiCommand extends TBMCCommandBase {
|
||||||
query += args[i] + " ";
|
query += args[i] + " ";
|
||||||
query = query.trim();
|
query = query.trim();
|
||||||
try {
|
try {
|
||||||
if (args.length == 0)
|
if (query.length() == 0)
|
||||||
sender.sendMessage("§bMinecraft Wiki link: http://minecraft.gamepedia.com/");
|
sender.sendMessage(new String[] { "§bMinecraft Wiki link: http://minecraft.gamepedia.com/",
|
||||||
|
"You can also search on it using /mwiki <query>" });
|
||||||
else
|
else
|
||||||
sender.sendMessage("§bMinecraft Wiki link: http://minecraft.gamepedia.com/index.php?search="
|
sender.sendMessage("§bMinecraft Wiki link: http://minecraft.gamepedia.com/index.php?search="
|
||||||
+ URLEncoder.encode(query, "UTF-8") + "&title=Special%3ASearch&go=Go");
|
+ URLEncoder.encode(query, "UTF-8") + "&title=Special%3ASearch&go=Go");
|
||||||
|
|
|
@ -1,27 +1,31 @@
|
||||||
package buttondevteam.chat.commands;
|
package buttondevteam.chat.commands;
|
||||||
|
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import buttondevteam.chat.PluginMain;
|
import buttondevteam.chat.PluginMain;
|
||||||
|
import buttondevteam.lib.TBMCYEEHAWEvent;
|
||||||
import buttondevteam.lib.chat.TBMCCommandBase;
|
import buttondevteam.lib.chat.TBMCCommandBase;
|
||||||
|
|
||||||
public class YeehawCommand extends TBMCCommandBase {
|
public class YeehawCommand extends TBMCCommandBase {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String[] GetHelpText(String alias) {
|
public String[] GetHelpText(String alias) {
|
||||||
return new String[] { "§6---- YEEHAW command ----",
|
return new String[] { "§6---- YEEHAW command ----", "This command makes you YEEHAW." };
|
||||||
"This command makes you YEEHAW." };
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean OnCommand(CommandSender sender, String alias, String[] args) {
|
public boolean OnCommand(CommandSender sender, String alias, String[] args) {
|
||||||
|
final String message = "§b* "
|
||||||
|
+ (sender instanceof Player ? ((Player) sender).getDisplayName() : sender.getName()) + " §bYEEHAWs.";
|
||||||
for (Player p : PluginMain.GetPlayers()) {
|
for (Player p : PluginMain.GetPlayers()) {
|
||||||
p.playSound(p.getLocation(), "tbmc.yeehaw", 1f, 1f);
|
p.playSound(p.getLocation(), "tbmc.yeehaw", 1f, 1f);
|
||||||
p.sendMessage("§b* "
|
p.sendMessage(message);
|
||||||
+ (sender instanceof Player ? ((Player) sender)
|
|
||||||
.getDisplayName() : sender.getName()) + " §bYEEHAWs.");
|
|
||||||
} // Even a cmdblock could yeehaw in theory
|
} // Even a cmdblock could yeehaw in theory
|
||||||
|
// Or anyone from Discord
|
||||||
|
Bukkit.getConsoleSender().sendMessage(message);
|
||||||
|
Bukkit.getPluginManager().callEvent(new TBMCYEEHAWEvent(sender));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue