Builder > Buffer

This commit is contained in:
GJ 2013-01-30 18:58:31 -05:00
parent fc5dda78f5
commit 01c8b8ad4a
3 changed files with 17 additions and 17 deletions

View File

@ -48,15 +48,15 @@ public class ACommand implements CommandExecutor {
return true; return true;
default: default:
StringBuffer buffer = new StringBuffer(); StringBuilder builder = new StringBuilder();
buffer.append(args[0]); builder.append(args[0]);
for (int i = 1; i < args.length; i++) { for (int i = 1; i < args.length; i++) {
buffer.append(" "); builder.append(" ");
buffer.append(args[i]); builder.append(args[i]);
} }
String message = buffer.toString(); String message = builder.toString();
if (sender instanceof Player) { if (sender instanceof Player) {
Player player = (Player) sender; Player player = (Player) sender;

View File

@ -64,15 +64,15 @@ public class PCommand implements CommandExecutor {
return true; return true;
} }
StringBuffer buffer = new StringBuffer(); StringBuilder builder = new StringBuilder();
buffer.append(args[0]); builder.append(args[0]);
for (int i = 1; i < args.length; i++) { for (int i = 1; i < args.length; i++) {
buffer.append(" "); builder.append(" ");
buffer.append(args[i]); builder.append(args[i]);
} }
String message = buffer.toString(); String message = builder.toString();
McMMOPartyChatEvent chatEvent = new McMMOPartyChatEvent(plugin, player.getName(), party.getName(), message); McMMOPartyChatEvent chatEvent = new McMMOPartyChatEvent(plugin, player.getName(), party.getName(), message);
plugin.getServer().getPluginManager().callEvent(chatEvent); plugin.getServer().getPluginManager().callEvent(chatEvent);
@ -101,15 +101,15 @@ public class PCommand implements CommandExecutor {
return true; return true;
} }
StringBuffer buffer = new StringBuffer(); StringBuilder builder = new StringBuilder();
buffer.append(args[1]); builder.append(args[1]);
for (int i = 2; i < args.length; i++) { for (int i = 2; i < args.length; i++) {
buffer.append(" "); builder.append(" ");
buffer.append(args[i]); builder.append(args[i]);
} }
String message = buffer.toString(); String message = builder.toString();
McMMOPartyChatEvent chatEvent = new McMMOPartyChatEvent(plugin, "Console", args[0], message); McMMOPartyChatEvent chatEvent = new McMMOPartyChatEvent(plugin, "Console", args[0], message);
plugin.getServer().getPluginManager().callEvent(chatEvent); plugin.getServer().getPluginManager().callEvent(chatEvent);

View File

@ -108,7 +108,7 @@ public class PartyCommand implements CommandExecutor {
Server server = mcMMO.p.getServer(); Server server = mcMMO.p.getServer();
String leader = party.getLeader(); String leader = party.getLeader();
StringBuffer tempList = new StringBuffer(); StringBuilder tempList = new StringBuilder();
int membersNear = PartyManager.getNearMembers(player, party, ShareHandler.partyShareRange).size(); int membersNear = PartyManager.getNearMembers(player, party, ShareHandler.partyShareRange).size();
int membersOnline = party.getOnlineMembers().size() - 1; int membersOnline = party.getOnlineMembers().size() - 1;
@ -128,7 +128,7 @@ public class PartyCommand implements CommandExecutor {
else { else {
tempList.append(ChatColor.GRAY); tempList.append(ChatColor.GRAY);
} }
tempList.append(otherPlayerName + " "); tempList.append(otherPlayerName).append(" ");
} }
String status = LocaleLoader.getString("Party.Status.Locked"); String status = LocaleLoader.getString("Party.Status.Locked");