From 4e7765a7e7e13a3234051f413f8c512b3d8597b9 Mon Sep 17 00:00:00 2001 From: Electroblob <35599699+Electroblob77@users.noreply.github.com> Date: Mon, 4 Jun 2018 18:04:36 +0100 Subject: [PATCH] Allow tab-completion of spell names in commands without specifying the modid --- src/main/java/electroblob/wizardry/spell/Spell.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/electroblob/wizardry/spell/Spell.java b/src/main/java/electroblob/wizardry/spell/Spell.java index c4e6d90f..f15e49dd 100644 --- a/src/main/java/electroblob/wizardry/spell/Spell.java +++ b/src/main/java/electroblob/wizardry/spell/Spell.java @@ -1,5 +1,6 @@ package electroblob.wizardry.spell; +import java.util.Collection; import java.util.HashSet; import java.util.List; import java.util.Set; @@ -403,12 +404,11 @@ public abstract class Spell extends IForgeRegistryEntry.Impl implements C } /** Returns a list of all registered spells' registry names, excluding the 'none' spell. Used in commands. */ - public static String[] getSpellNames(){ + public static Collection getSpellNames(){ // Maybe it would be better to store all of this statically? Set keys = new HashSet(registry.getKeys()); keys.remove(registry.getKey(Spells.none)); - // Streams! - return keys.stream().map(ResourceLocation::toString).toArray(String[]::new); + return keys; } /**