summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/bukkit/block/Block.java4
-rw-r--r--src/main/java/org/bukkit/command/SimpleCommandMap.java8
-rw-r--r--src/main/java/org/bukkit/command/defaults/ListCommand.java9
-rw-r--r--src/main/java/org/bukkit/command/defaults/MeCommand.java15
-rw-r--r--src/main/java/org/bukkit/command/defaults/SayCommand.java12
-rw-r--r--src/main/java/org/bukkit/command/defaults/TellCommand.java6
-rw-r--r--src/main/java/org/bukkit/command/defaults/WhitelistCommand.java8
7 files changed, 34 insertions, 28 deletions
diff --git a/src/main/java/org/bukkit/block/Block.java b/src/main/java/org/bukkit/block/Block.java
index 43ca5d4f..e4a9be93 100644
--- a/src/main/java/org/bukkit/block/Block.java
+++ b/src/main/java/org/bukkit/block/Block.java
@@ -139,7 +139,7 @@ public interface Block {
*/
void setData(byte data);
- void setData(byte data, boolean applyPhyiscs);
+ void setData(byte data, boolean applyPhysics);
/**
* Sets the type of this block
@@ -158,7 +158,7 @@ public interface Block {
boolean setTypeId(int type, boolean applyPhysics);
- boolean setTypeIdAndData(int type, byte data, boolean applyPhyiscs);
+ boolean setTypeIdAndData(int type, byte data, boolean applyPhysics);
/**
* Gets the face relation of this block compared to the given block<br />
diff --git a/src/main/java/org/bukkit/command/SimpleCommandMap.java b/src/main/java/org/bukkit/command/SimpleCommandMap.java
index 0e88405f..603632ed 100644
--- a/src/main/java/org/bukkit/command/SimpleCommandMap.java
+++ b/src/main/java/org/bukkit/command/SimpleCommandMap.java
@@ -190,13 +190,16 @@ public class SimpleCommandMap implements CommandMap {
for (String alias : values.keySet()) {
String[] targetNames = values.get(alias);
List<Command> targets = new ArrayList<Command>();
- String bad = "";
+ StringBuilder bad = new StringBuilder();
for (String name : targetNames) {
Command command = getCommand(name);
if (command == null) {
- bad += name + ", ";
+ if (bad.length() > 0) {
+ bad.append(", ");
+ }
+ bad.append(name);
} else {
targets.add(command);
}
@@ -211,7 +214,6 @@ public class SimpleCommandMap implements CommandMap {
}
if (bad.length() > 0) {
- bad = bad.substring(0, bad.length() - 2);
server.getLogger().warning("The following command(s) could not be aliased under '" + alias + "' because they do not exist: " + bad);
}
}
diff --git a/src/main/java/org/bukkit/command/defaults/ListCommand.java b/src/main/java/org/bukkit/command/defaults/ListCommand.java
index ef3d544e..b7fc3b0a 100644
--- a/src/main/java/org/bukkit/command/defaults/ListCommand.java
+++ b/src/main/java/org/bukkit/command/defaults/ListCommand.java
@@ -1,7 +1,6 @@
package org.bukkit.command.defaults;
import org.bukkit.Bukkit;
-import org.bukkit.command.Command;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@@ -17,17 +16,17 @@ public class ListCommand extends VanillaCommand {
public boolean execute(CommandSender sender, String currentAlias, String[] args) {
if (!testPermission(sender)) return true;
- String players = "";
+ StringBuilder players = new StringBuilder();
for (Player player : Bukkit.getOnlinePlayers()) {
if (players.length() > 0) {
- players += ", ";
+ players.append(", ");
}
- players += player.getDisplayName();
+ players.append(player.getDisplayName());
}
- sender.sendMessage("Connected players: " + players);
+ sender.sendMessage("Connected players: " + players.toString());
return true;
}
diff --git a/src/main/java/org/bukkit/command/defaults/MeCommand.java b/src/main/java/org/bukkit/command/defaults/MeCommand.java
index 9dd8c2bb..c2422a5a 100644
--- a/src/main/java/org/bukkit/command/defaults/MeCommand.java
+++ b/src/main/java/org/bukkit/command/defaults/MeCommand.java
@@ -20,14 +20,17 @@ public class MeCommand extends VanillaCommand {
return false;
}
- String message = "";
-
- for (int i = 0; i < args.length; i++) {
- if (i > 0) message += " ";
- message += args[i];
+ StringBuilder message = new StringBuilder();
+ message.append(sender.getName());
+ if (args.length > 0) {
+ message.append(args[0]);
+ for (int i = 1; i < args.length; i++) {
+ message.append(" ");
+ message.append(args[i]);
+ }
}
- Bukkit.broadcastMessage("* " + sender.getName() + " " + message);
+ Bukkit.broadcastMessage("* " + message.toString());
return true;
}
diff --git a/src/main/java/org/bukkit/command/defaults/SayCommand.java b/src/main/java/org/bukkit/command/defaults/SayCommand.java
index 31d0a4ac..37fdac76 100644
--- a/src/main/java/org/bukkit/command/defaults/SayCommand.java
+++ b/src/main/java/org/bukkit/command/defaults/SayCommand.java
@@ -21,11 +21,13 @@ public class SayCommand extends VanillaCommand {
return false;
}
- String message = "";
-
- for (int i = 0; i < args.length; i++) {
- if (i > 0) message += " ";
- message += args[i];
+ 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]);
+ }
}
if (!(sender instanceof ConsoleCommandSender)) {
diff --git a/src/main/java/org/bukkit/command/defaults/TellCommand.java b/src/main/java/org/bukkit/command/defaults/TellCommand.java
index 92cbd74e..4fce3b1c 100644
--- a/src/main/java/org/bukkit/command/defaults/TellCommand.java
+++ b/src/main/java/org/bukkit/command/defaults/TellCommand.java
@@ -27,11 +27,11 @@ public class TellCommand extends VanillaCommand {
if (player == null) {
sender.sendMessage("There's no player by that name online.");
} else {
- String message = "";
+ StringBuilder message = new StringBuilder();
for (int i = 1; i < args.length; i++) {
- if (i > 1) message += " ";
- message += args[i];
+ if (i > 1) message.append(" ");
+ message.append(args[i]);
}
String result = ChatColor.GRAY + sender.getName() + " whispers " + message;
diff --git a/src/main/java/org/bukkit/command/defaults/WhitelistCommand.java b/src/main/java/org/bukkit/command/defaults/WhitelistCommand.java
index 272a062e..4e9cb0f0 100644
--- a/src/main/java/org/bukkit/command/defaults/WhitelistCommand.java
+++ b/src/main/java/org/bukkit/command/defaults/WhitelistCommand.java
@@ -39,17 +39,17 @@ public class WhitelistCommand extends VanillaCommand {
} else if (args[0].equalsIgnoreCase("list")) {
if (badPerm(sender, "list")) return true;
- String result = "";
+ StringBuilder result = new StringBuilder();
for (OfflinePlayer player : Bukkit.getWhitelistedPlayers()) {
if (result.length() > 0) {
- result += " ";
+ result.append(" ");
}
- result += player.getName();
+ result.append(player.getName());
}
- sender.sendMessage("White-listed players: " + result);
+ sender.sendMessage("White-listed players: " + result.toString());
return true;
}
} else if (args.length == 2) {