add getUniqueExecutableDefinitions to ApplicationCommandDefinition
This commit is contained in:
parent
cf45d0e8ea
commit
fd749b31d8
@ -1,6 +1,7 @@
|
|||||||
package net.tomatentum.marinara.interaction.commands;
|
package net.tomatentum.marinara.interaction.commands;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.tomatentum.marinara.interaction.commands.annotation.ApplicationCommand;
|
import net.tomatentum.marinara.interaction.commands.annotation.ApplicationCommand;
|
||||||
@ -45,10 +46,15 @@ public class ApplicationCommandDefinition {
|
|||||||
return applicationCommand;
|
return applicationCommand;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<ExecutableCommandDefinition> getExecutableDefinitons() {
|
public ExecutableCommandDefinition[] getExecutableDefinitons() {
|
||||||
return executableDefinitons;
|
return executableDefinitons.toArray(new ExecutableCommandDefinition[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ExecutableCommandDefinition[] getUniqueExecutableDefinitions() {
|
||||||
|
HashSet<ExecutableCommandDefinition> set = new HashSet<>();
|
||||||
|
executableDefinitons.forEach(set::add);
|
||||||
|
return set.toArray(new ExecutableCommandDefinition[0]);
|
||||||
|
}
|
||||||
public int getSubCommandGroupCount() {
|
public int getSubCommandGroupCount() {
|
||||||
return subCommandGroupCount;
|
return subCommandGroupCount;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user