Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: nightpool/VoxelUpdate
base: 598fff791b
...
head fork: nightpool/VoxelUpdate
compare: 718f2a19eb
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Showing with 27 additions and 17 deletions.
  1. +10 −1 pom.xml
  2. +17 −16 src/main/java/com/thevoxelbox/voxelupdate/VoxelUpdate.java
View
11 pom.xml
@@ -12,13 +12,22 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
+
+ <repositories>
+
+ <!-- Bukkit -->
+ <repository>
+ <id>bukkit-repo</id>
+ <url>http://repo.bukkit.org/content/groups/public</url>
+ </repository>
+ </repositories>
<dependencies>
<!-- Bukkit -->
<dependency>
<groupId>org.bukkit</groupId>
- <artifactId>craftbukkit</artifactId>
+ <artifactId>bukkit</artifactId>
<version>1.1-R4</version>
<type>jar</type>
</dependency>
View
33 src/main/java/com/thevoxelbox/voxelupdate/VoxelUpdate.java
@@ -18,6 +18,8 @@
import org.bukkit.Server;
import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
+import org.bukkit.command.ConsoleCommandSender;
+import org.bukkit.command.RemoteConsoleCommandSender;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
@@ -84,14 +86,13 @@ public void onEnable() {
@Override
public boolean onCommand(CommandSender sender, Command command, String commandLabel, String[] args) {
- Player p = (Player) sender;
String[] trimmedArgs = args;
List<String> voxelplugins = updateManager.getListofPlugins();
String comm = command.getName().toLowerCase();
- if (admns.contains(p.getName())) {
+ if (admns.contains(sender.getName()) || sender instanceof ConsoleCommandSender || sender instanceof RemoteConsoleCommandSender) {
if (comm.equalsIgnoreCase("voxelplugins")) {
- p.sendMessage(ChatColor.WHITE + "[" + ChatColor.AQUA + "Voxel" + ChatColor.LIGHT_PURPLE + "Update" + ChatColor.WHITE + "] - Plugin List");
+ sender.sendMessage(ChatColor.WHITE + "[" + ChatColor.AQUA + "Voxel" + ChatColor.LIGHT_PURPLE + "Update" + ChatColor.WHITE + "] - Plugin List");
for (String plugin : voxelplugins) {
boolean isEnabled = s.getPluginManager().isPluginEnabled(plugin);
boolean isInstalled = updateManager.isInstalled(plugin);
@@ -100,56 +101,56 @@ public boolean onCommand(CommandSender sender, Command command, String commandLa
if (isEnabled) {
if (updateManager.needsUpdate(plugin)) {
- p.sendMessage("* " + plugin + ": " + ((updateManager.isBeta(plugin)) ? ("\u00a76Beta available \u00a7c[WARNING: Potentially buggy]") : ("\u00a76Update available")));
+ sender.sendMessage("* " + plugin + ": " + ((updateManager.isBeta(plugin)) ? ("\u00a76Beta available \u00a7c[WARNING: Potentially buggy]") : ("\u00a76Update available")));
} else {
- p.sendMessage("* " + plugin + ": " + ChatColor.GREEN + "Installed");
+ sender.sendMessage("* " + plugin + ": " + ChatColor.GREEN + "Installed");
}
} else {
- p.sendMessage("* " + plugin + ": " + ChatColor.GRAY + "Disabled");
+ sender.sendMessage("* " + plugin + ": " + ChatColor.GRAY + "Disabled");
}
} else {
- p.sendMessage("* " + plugin + ": " + ChatColor.RED + "Available");
+ sender.sendMessage("* " + plugin + ": " + ChatColor.RED + "Available");
}
}
return true;
} else if (comm.equalsIgnoreCase("voxelinstall")) {
if (args.length == 0) {
- p.sendMessage(ChatColor.GOLD + "Use: /voxelinstall <plugin>");
+ sender.sendMessage(ChatColor.GOLD + "Use: /voxelinstall <plugin>");
} else {
if (!updateManager.getListofPlugins().contains(trimmedArgs[0])) {
- p.sendMessage(ChatColor.RED + "Could not find plugin \"" + trimmedArgs[0] + "\"");
+ sender.sendMessage(ChatColor.RED + "Could not find plugin \"" + trimmedArgs[0] + "\"");
return true;
}
if (updateManager.doDownload(trimmedArgs[0])) {
- p.sendMessage(ChatColor.WHITE + "[" + ChatColor.AQUA + "Voxel" + ChatColor.LIGHT_PURPLE + "Update" + ChatColor.WHITE + "] Successfully downloaded \"" + ChatColor.GREEN + trimmedArgs[0] + ChatColor.WHITE + "\"");
+ sender.sendMessage(ChatColor.WHITE + "[" + ChatColor.AQUA + "Voxel" + ChatColor.LIGHT_PURPLE + "Update" + ChatColor.WHITE + "] Successfully downloaded \"" + ChatColor.GREEN + trimmedArgs[0] + ChatColor.WHITE + "\"");
} else {
- p.sendMessage(ChatColor.RED + "Download failed. See server logs for details.");
+ sender.sendMessage(ChatColor.RED + "Download failed. See server logs for details.");
}
}
return true;
} else if (comm.equalsIgnoreCase("voxelupdate")) {
if (args.length == 0) {
- p.sendMessage(ChatColor.GOLD + "Use: /voxelupdate <plugin>");
+ sender.sendMessage(ChatColor.GOLD + "Use: /voxelupdate <plugin>");
} else {
if (!updateManager.getListofPlugins().contains(trimmedArgs[0])) {
- p.sendMessage(ChatColor.RED + "Could not find plugin \"" + trimmedArgs[0] + "\"");
+ sender.sendMessage(ChatColor.RED + "Could not find plugin \"" + trimmedArgs[0] + "\"");
return true;
}
if (updateManager.needsUpdate(trimmedArgs[0])) {
if (updateManager.doDownload(trimmedArgs[0])) {
- p.sendMessage(ChatColor.WHITE + "[" + ChatColor.AQUA + "Voxel" + ChatColor.LIGHT_PURPLE + "Update" + ChatColor.WHITE + "] Successfully downloaded \"" + ChatColor.GREEN + trimmedArgs[0] + ChatColor.WHITE + "\"");
+ sender.sendMessage(ChatColor.WHITE + "[" + ChatColor.AQUA + "Voxel" + ChatColor.LIGHT_PURPLE + "Update" + ChatColor.WHITE + "] Successfully downloaded \"" + ChatColor.GREEN + trimmedArgs[0] + ChatColor.WHITE + "\"");
} else {
- p.sendMessage(ChatColor.RED + "Download failed. See server logs for details.");
+ sender.sendMessage(ChatColor.RED + "Download failed. See server logs for details.");
}
}
}
return true;
} else if (comm.equalsIgnoreCase("voxelinfo")) {
for (String tempplugin : voxelplugins) {
- p.sendMessage(tempplugin + ": \u00a7a" + updateManager.get(tempplugin, "description"));
+ sender.sendMessage(tempplugin + ": \u00a7a" + updateManager.get(tempplugin, "description"));
}
return true;
}

No commit comments for this range

Something went wrong with that request. Please try again.