Bugfix: Spaces cannot be used in disc names

This commit is contained in:
Navoei
2022-09-04 19:11:50 -05:00
parent f06ad64505
commit e646b45af6
5 changed files with 19 additions and 21 deletions

View File

@@ -41,7 +41,7 @@ public class CreateCommand extends SubCommand {
@Override
public void perform(Player player, String[] args) {
if (isMusicDisc(player)) {
if (args.length == 3) {
if (args.length >= 3) {
if (!player.hasPermission("customdiscs.create")) {
player.sendMessage(ChatColor.RED + "You do not have permission to execute this command!");
@@ -94,10 +94,8 @@ public class CreateCommand extends SubCommand {
player.sendMessage("Your filename is: " + ChatColor.GRAY + songname);
player.sendMessage("Your custom name is: " + ChatColor.GRAY + customName(readQuotes(args)));
} else if (args.length < 3) {
player.sendMessage(ChatColor.RED + "Insufficient arguments! ( /customdisc create <filename> \"Custom Lore\" )");
} else {
player.sendMessage(ChatColor.RED + "Too many arguments! ( /customdisc create <filename> \"Custom Lore\" )");
player.sendMessage(ChatColor.RED + "Insufficient arguments! ( /customdisc create <filename> \"Custom Lore\" )");
}
} else {
player.sendMessage(ChatColor.RED + "You are not holding a music disc in your main hand!");