Seemless Update Request #6

This commit is contained in:
Navoei
2022-08-20 20:11:35 -05:00
parent eb3b1dc381
commit ad351a0ed6
5 changed files with 18 additions and 9 deletions

View File

@@ -10,6 +10,7 @@ import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.NamespacedKey;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;
import org.bukkit.persistence.PersistentDataContainer;
@@ -34,7 +35,7 @@ public class CreateCommand extends SubCommand {
@Override
public String getSyntax() {
return ChatColor.GREEN + "/customdisc create <filename> \"Custom Lore\".";
return ChatColor.GREEN + "/customdisc create <filename> \"Custom Lore\"";
}
@Override
@@ -47,6 +48,11 @@ public class CreateCommand extends SubCommand {
String songname = "";
String filename = args[1];
if (customName(readQuotes(args)).equalsIgnoreCase("")) {
player.sendMessage(ChatColor.RED + "You must provide a name for your disc.");
return;
}
File getDirectory = new File(CustomDiscs.getInstance().getDataFolder(), "musicdata");
File songFile = new File(getDirectory.getPath(), filename);
if (songFile.exists()) {
@@ -71,6 +77,7 @@ public class CreateCommand extends SubCommand {
.color(NamedTextColor.GRAY)
.build();
itemLore.add(customLoreSong);
meta.addItemFlags(ItemFlag.values());
meta.lore(itemLore);
PersistentDataContainer data = meta.getPersistentDataContainer();