geforkt von Mirrors/Paper
Added proper feedback to default commands.
By: EvilSeph <evilseph@gmail.com>
Dieser Commit ist enthalten in:
Ursprung
49c3dee8f8
Commit
8cb39a7daf
@ -60,9 +60,10 @@ public class ClearCommand extends VanillaCommand {
|
||||
|
||||
int data = args.length >= 3 ? getInteger(sender, args[2], 0) : -1;
|
||||
int count = player.getInventory().clear(id, data);
|
||||
|
||||
Command.broadcastCommandMessage(sender, "Cleared the inventory of " + player.getDisplayName() + ", removing " + count + " items");
|
||||
} else {
|
||||
sender.sendMessage(ChatColor.RED + "Can't find user " + args[0]);
|
||||
sender.sendMessage(ChatColor.RED + "Can't find player " + args[0]);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -7,6 +7,7 @@ import org.apache.commons.lang.Validate;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.OfflinePlayer;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.StringUtil;
|
||||
@ -36,7 +37,7 @@ public class DeopCommand extends VanillaCommand {
|
||||
((Player) player).sendMessage(ChatColor.YELLOW + "You are no longer op!");
|
||||
}
|
||||
|
||||
sender.sendMessage("De-opped " + args[0]);
|
||||
Command.broadcastCommandMessage(sender, "De-opped " + args[0]);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -49,10 +49,10 @@ public class ExpCommand extends VanillaCommand {
|
||||
if (isLevel) {
|
||||
if (isTaking) {
|
||||
player.giveExpLevels(-amount);
|
||||
sender.sendMessage("Taken " + amount + " level(s) from " + player.getName());
|
||||
Command.broadcastCommandMessage(sender, "Taken " + amount + " level(s) from " + player.getName());
|
||||
} else {
|
||||
player.giveExpLevels(amount);
|
||||
sender.sendMessage("Given " + amount + " level(s) to " + player.getName());
|
||||
Command.broadcastCommandMessage(sender, "Given " + amount + " level(s) to " + player.getName());
|
||||
}
|
||||
} else {
|
||||
if (isTaking) {
|
||||
@ -60,11 +60,11 @@ public class ExpCommand extends VanillaCommand {
|
||||
return false;
|
||||
} else {
|
||||
player.giveExp(amount);
|
||||
sender.sendMessage("Given " + amount + " experience to " + player.getName());
|
||||
Command.broadcastCommandMessage(sender, "Given " + amount + " experience to " + player.getName());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
sender.sendMessage("Can't find user, was one provided?\n" + ChatColor.RED + "Usage: " + usageMessage);
|
||||
sender.sendMessage("Can't find player, was one provided?\n" + ChatColor.RED + "Usage: " + usageMessage);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -67,16 +67,16 @@ public class GameModeCommand extends VanillaCommand {
|
||||
sender.sendMessage("Game mode change for " + player.getName() + " failed!");
|
||||
} else {
|
||||
if (player == sender) {
|
||||
Command.broadcastCommandMessage(sender, "Set own game mode to " + mode.toString() + " mode", false);
|
||||
Command.broadcastCommandMessage(sender, "Set own game mode to " + mode.toString() + " mode");
|
||||
} else {
|
||||
Command.broadcastCommandMessage(sender, "Set " + player.getName() + "'s game mode to " + mode.toString() + " mode", false);
|
||||
Command.broadcastCommandMessage(sender, "Set " + player.getName() + "'s game mode to " + mode.toString() + " mode");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
sender.sendMessage(player.getName() + " already has game mode " + mode.getValue());
|
||||
}
|
||||
} else {
|
||||
sender.sendMessage("Can't find user " + playerArg);
|
||||
sender.sendMessage("Can't find player " + playerArg);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -37,7 +37,7 @@ public class GameRuleCommand extends VanillaCommand {
|
||||
String value = args[1];
|
||||
|
||||
world.setGameRuleValue(rule, value);
|
||||
Command.broadcastCommandMessage(sender, "Game rule has been updated");
|
||||
Command.broadcastCommandMessage(sender, "Game rule " + rule + " has been set to: " + value);
|
||||
} else {
|
||||
String value = world.getGameRuleValue(rule);
|
||||
sender.sendMessage(rule + " = " + value);
|
||||
|
@ -68,7 +68,7 @@ public class GiveCommand extends VanillaCommand {
|
||||
sender.sendMessage("There's no item called " + args[1]);
|
||||
}
|
||||
} else {
|
||||
sender.sendMessage("Can't find user " + args[0]);
|
||||
sender.sendMessage("Can't find player " + args[0]);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
@ -4,6 +4,7 @@ import java.util.Arrays;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
public class ReloadCommand extends BukkitCommand {
|
||||
@ -20,7 +21,7 @@ public class ReloadCommand extends BukkitCommand {
|
||||
if (!testPermission(sender)) return true;
|
||||
|
||||
Bukkit.reload();
|
||||
sender.sendMessage(ChatColor.GREEN + "Reload complete.");
|
||||
Command.broadcastCommandMessage(sender, ChatColor.GREEN + "Reload complete.");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -6,6 +6,7 @@ import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@ -36,7 +37,7 @@ public class SpawnpointCommand extends VanillaCommand {
|
||||
} else {
|
||||
player = Bukkit.getPlayerExact(args[0]);
|
||||
if (player == null) {
|
||||
sender.sendMessage("Can't find user " + args[0]);
|
||||
sender.sendMessage("Can't find player " + args[0]);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -51,12 +52,12 @@ public class SpawnpointCommand extends VanillaCommand {
|
||||
int z = getInteger(sender, args[pos], MIN_COORD, MAX_COORD);
|
||||
|
||||
player.setBedSpawnLocation(new Location(world, x, y, z), true);
|
||||
sender.sendMessage("Set " + player.getDisplayName() + "'s spawnpoint to " + x + ", " + y + ", " + z);
|
||||
Command.broadcastCommandMessage(sender, "Set " + player.getDisplayName() + "'s spawnpoint to " + x + ", " + y + ", " + z);
|
||||
}
|
||||
} else if (args.length <= 1) {
|
||||
Location location = player.getLocation();
|
||||
player.setBedSpawnLocation(location, true);
|
||||
sender.sendMessage("Set " + player.getDisplayName() + "'s spawnpoint to " + location.getX() + ", " + location.getY() + ", " + location.getZ());
|
||||
Command.broadcastCommandMessage(sender, "Set " + player.getDisplayName() + "'s spawnpoint to " + location.getX() + ", " + location.getY() + ", " + location.getZ());
|
||||
} else {
|
||||
sender.sendMessage(ChatColor.RED + "Usage: " + usageMessage);
|
||||
return false;
|
||||
|
@ -51,7 +51,7 @@ public class TeleportCommand extends VanillaCommand {
|
||||
if (args.length < 3) {
|
||||
Player target = Bukkit.getPlayerExact(args[args.length - 1]);
|
||||
if (target == null) {
|
||||
sender.sendMessage("Can't find user " + args[args.length - 1] + ". No tp.");
|
||||
sender.sendMessage("Can't find player " + args[args.length - 1] + ". No tp.");
|
||||
return true;
|
||||
}
|
||||
player.teleport(target, TeleportCause.COMMAND);
|
||||
|
@ -41,6 +41,7 @@ public class TellCommand extends VanillaCommand {
|
||||
Bukkit.getLogger().info("[" + sender.getName() + "->" + player.getName() + "] " + message);
|
||||
}
|
||||
|
||||
sender.sendMessage("[" + sender.getName() + "->" + player.getName() + "] " + message);
|
||||
player.sendMessage(result);
|
||||
}
|
||||
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren