mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-07 16:57:42 +01:00
Few more style cleanups
By: Nathan Adams <dinnerbone@dinnerbone.com>
This commit is contained in:
parent
ad38184dc2
commit
b50b4ca047
@ -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 />
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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)) {
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user