Lists all built-in sounds during addsong tab-completion

This commit is contained in:
Kristian Knarvik 2022-10-31 17:44:08 +01:00
parent 49f7f533b0
commit 855ae55662

View File

@ -3,6 +3,7 @@ package net.knarcraft.minstrel.command;
import net.citizensnpcs.api.CitizensAPI; import net.citizensnpcs.api.CitizensAPI;
import net.citizensnpcs.api.npc.NPC; import net.citizensnpcs.api.npc.NPC;
import net.knarcraft.minstrel.trait.MinstrelTrait; import net.knarcraft.minstrel.trait.MinstrelTrait;
import org.bukkit.Sound;
import org.bukkit.SoundCategory; import org.bukkit.SoundCategory;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -112,8 +113,9 @@ public class MinstrelTabCompleter implements TabCompleter {
return filterMatchingContains(soundCategories, args[1]); return filterMatchingContains(soundCategories, args[1]);
} else if (args.length == 3) { } else if (args.length == 3) {
List<String> exampleSongNames = new ArrayList<>(); List<String> exampleSongNames = new ArrayList<>();
exampleSongNames.add("minecraft:records.custom.medieval_3_g_mixolydian"); for (Sound sound : Sound.values()) {
exampleSongNames.add("minecraft:block.amethyst_block.step"); exampleSongNames.add(sound.getKey().getNamespace() + ":" + sound.getKey().getKey());
}
return filterMatchingContains(exampleSongNames, args[2]); return filterMatchingContains(exampleSongNames, args[2]);
} else if (args.length == 4) { } else if (args.length == 4) {
return filterMatchingContains(exampleLengths, args[3]); return filterMatchingContains(exampleLengths, args[3]);