Generic cleanup of warnings, whitespace and style.
By: Erik Broes <erikbroes@grum.nl>
This commit is contained in:
@@ -29,7 +29,7 @@ public class DeopCommand extends VanillaCommand {
|
||||
player.setOp(false);
|
||||
|
||||
if (player instanceof Player) {
|
||||
((Player)player).sendMessage(ChatColor.YELLOW + "You are no longer op!");
|
||||
((Player) player).sendMessage(ChatColor.YELLOW + "You are no longer op!");
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -28,7 +28,7 @@ public class ExpCommand extends VanillaCommand {
|
||||
try {
|
||||
int exp = Integer.parseInt(args[1]);
|
||||
|
||||
Command.broadcastCommandMessage(sender, "Giving " + exp + " exp to " + player.getName());
|
||||
Command.broadcastCommandMessage(sender, "Giving " + exp + " exp to " + player.getName());
|
||||
|
||||
player.giveExp(exp);
|
||||
} catch (NumberFormatException ex) {
|
||||
|
||||
@@ -18,7 +18,7 @@ public class KillCommand extends VanillaCommand {
|
||||
if (!testPermission(sender)) return true;
|
||||
|
||||
if (sender instanceof Player) {
|
||||
Player player = (Player)sender;
|
||||
Player player = (Player) sender;
|
||||
|
||||
EntityDamageEvent ede = new EntityDamageEvent(player, EntityDamageEvent.DamageCause.SUICIDE, 1000);
|
||||
Bukkit.getPluginManager().callEvent(ede);
|
||||
|
||||
@@ -23,10 +23,10 @@ public class MeCommand extends VanillaCommand {
|
||||
StringBuilder message = new StringBuilder();
|
||||
message.append(sender.getName());
|
||||
if (args.length > 0) {
|
||||
for (int i = 0; i < args.length; i++) {
|
||||
message.append(" ");
|
||||
message.append(args[i]);
|
||||
}
|
||||
for (String arg : args) {
|
||||
message.append(" ");
|
||||
message.append(arg);
|
||||
}
|
||||
}
|
||||
|
||||
Bukkit.broadcastMessage("* " + message.toString());
|
||||
|
||||
@@ -29,7 +29,7 @@ public class OpCommand extends VanillaCommand {
|
||||
player.setOp(true);
|
||||
|
||||
if (player instanceof Player) {
|
||||
((Player)player).sendMessage(ChatColor.YELLOW + "You are now op!");
|
||||
((Player) player).sendMessage(ChatColor.YELLOW + "You are now op!");
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -19,7 +19,7 @@ public class PluginsCommand extends Command {
|
||||
@Override
|
||||
public boolean execute(CommandSender sender, String currentAlias, String[] args) {
|
||||
if (!testPermission(sender)) return true;
|
||||
|
||||
|
||||
sender.sendMessage("Plugins: " + getPluginList());
|
||||
return true;
|
||||
}
|
||||
@@ -27,13 +27,13 @@ public class PluginsCommand extends Command {
|
||||
private String getPluginList() {
|
||||
StringBuilder pluginList = new StringBuilder();
|
||||
Plugin[] plugins = Bukkit.getPluginManager().getPlugins();
|
||||
|
||||
|
||||
for (Plugin plugin : plugins) {
|
||||
if (pluginList.length() > 0) {
|
||||
pluginList.append(ChatColor.WHITE);
|
||||
pluginList.append(", ");
|
||||
}
|
||||
|
||||
|
||||
pluginList.append(plugin.isEnabled() ? ChatColor.GREEN : ChatColor.RED);
|
||||
pluginList.append(plugin.getDescription().getName());
|
||||
}
|
||||
|
||||
@@ -23,11 +23,11 @@ public class SayCommand extends VanillaCommand {
|
||||
|
||||
StringBuilder message = new StringBuilder();
|
||||
if (args.length > 0) {
|
||||
message.append(args[0]);
|
||||
for (int i = 1; i < args.length; i++) {
|
||||
message.append(" ");
|
||||
message.append(args[i]);
|
||||
}
|
||||
message.append(args[0]);
|
||||
for (int i = 1; i < args.length; i++) {
|
||||
message.append(" ");
|
||||
message.append(args[i]);
|
||||
}
|
||||
}
|
||||
|
||||
if (!(sender instanceof ConsoleCommandSender)) {
|
||||
|
||||
@@ -15,7 +15,7 @@ public class TimeCommand extends VanillaCommand {
|
||||
|
||||
@Override
|
||||
public boolean execute(CommandSender sender, String currentAlias, String[] args) {
|
||||
if (args.length != 2) {
|
||||
if (args.length != 2) {
|
||||
sender.sendMessage(ChatColor.RED + "Incorrect usage. Correct usage:\n" + usageMessage);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public class ToggleDownfallCommand extends VanillaCommand {
|
||||
return true;
|
||||
}
|
||||
} else if (sender instanceof Player) {
|
||||
world = ((Player)sender).getWorld();
|
||||
world = ((Player) sender).getWorld();
|
||||
} else {
|
||||
world = Bukkit.getWorlds().get(0);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import org.bukkit.plugin.PluginDescriptionFile;
|
||||
public class VersionCommand extends Command {
|
||||
public VersionCommand(String name) {
|
||||
super(name);
|
||||
|
||||
|
||||
this.description = "Gets the version of this server including any plugins in use";
|
||||
this.usageMessage = "/version [plugin name]";
|
||||
this.setPermission("bukkit.command.version");
|
||||
@@ -22,7 +22,7 @@ public class VersionCommand extends Command {
|
||||
@Override
|
||||
public boolean execute(CommandSender sender, String currentAlias, String[] args) {
|
||||
if (!testPermission(sender)) return true;
|
||||
|
||||
|
||||
if (args.length == 0) {
|
||||
sender.sendMessage("This server is running " + Bukkit.getName() + " version " + Bukkit.getVersion() + " (Implementing API version " + Bukkit.getBukkitVersion() + ")");
|
||||
} else {
|
||||
@@ -32,7 +32,7 @@ public class VersionCommand extends Command {
|
||||
if (name.length() > 0) {
|
||||
name.append(' ');
|
||||
}
|
||||
|
||||
|
||||
name.append(arg);
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ public class VersionCommand extends Command {
|
||||
result.append(ChatColor.GREEN);
|
||||
result.append(authors.get(i));
|
||||
}
|
||||
|
||||
|
||||
return result.toString();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user